Separate tools and tests - #9
Conversation
WalkthroughThe pull request relocates visualization and HikCamera-related build targets from the test directory to a newly established tool CMakeLists.txt. Build configuration for three executables (visualization, hikcamera, streaming) is consolidated in the tool directory, with conditional logic based on HikCamera package availability. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
tool/CMakeLists.txt (2)
29-36: Conditionally sethikcamerainclude directories.Line 31 includes
${hikcamera_INCLUDE_DIRS}unconditionally, but thehikcamerapackage is searched withQUIET(line 20) and may not be available. While CMake will safely expand undefined variables to empty strings, this pattern is fragile and doesn't clearly communicate the intent that this include path is optional.Consider moving the
hikcamerainclude directory inside the conditional block (lines 57–87) whereHIKCAMERA_AVAILABLEis checked:include_directories( ${RMCS_SRC_DIR} - ${hikcamera_INCLUDE_DIRS} ${rclcpp_INCLUDE_DIRS} ${visualization_msgs_INCLUDE_DIRS} ${geometry_msgs_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ) set(TOOL_DIR ${CMAKE_CURRENT_SOURCE_DIR}) # Visualization add_executable( visualization ${TOOL_DIR}/visualization.cpp ${RMCS_SRC_DIR}/utility/rclcpp/visual/armor.cpp ${RMCS_SRC_DIR}/utility/rclcpp/visual/posture.cpp ${RMCS_SRC_DIR}/utility/panic.cpp ${RMCS_SRC_DIR}/utility/math/solve_armors.cpp ${RMCS_SRC_DIR}/utility/rclcpp/node.cpp ) target_link_libraries( visualization rclcpp::rclcpp ${visualization_msgs_LIBRARIES} ${geometry_msgs_LIBRARIES} ) if(HIKCAMERA_AVAILABLE) + include_directories(${hikcamera_INCLUDE_DIRS}) # Hikcamera add_executable(
85-87: Use English in status messages for consistency.The fallback status message at line 86 uses Chinese ("hikcamera 未检测到,跳过相关构建"), but the rest of the codebase uses English for comments, variable names, and messages. Consider translating this to English for consistency.
else() - message(STATUS "hikcamera 未检测到,跳过相关构建") + message(STATUS "hikcamera not detected; skipping related builds") endif()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
test/CMakeLists.txt(0 hunks)tool/CMakeLists.txt(1 hunks)
💤 Files with no reviewable changes (1)
- test/CMakeLists.txt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
🔇 Additional comments (1)
tool/CMakeLists.txt (1)
41-55: The visualization target has all required dependencies. Verification of the actual source and header files included in this target shows no usage of OpenCV or yaml-cpp. The implementation uses Eigen3 for mathematics and ROS2 messaging libraries (visualization_msgs and geometry_msgs) for rendering, all of which are already properly linked.Likely an incorrect or invalid review comment.
|
修正 Coderabbit 的设定 |
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.