Skip to content

Separate tools and tests - #10

Merged
creeper5820 merged 2 commits into
mainfrom
refactor/separate-test-and-tool
Dec 15, 2025
Merged

Separate tools and tests#10
creeper5820 merged 2 commits into
mainfrom
refactor/separate-test-and-tool

Conversation

@creeper5820

@creeper5820 creeper5820 commented Dec 15, 2025

Copy link
Copy Markdown
Collaborator

将工具和测试分离,减少自动化测试的构建时间并方便开发人员平时使用工具应用

Summary by CodeRabbit

  • Chores
    • 新增工具集的构建配置与编译规则,支持更现代的C++标准与依赖声明。
    • 引入对 HikCamera 的可选检测与支持(自动启用/跳过构建)。
    • 精简测试构建,移除与 HikCamera 及可视化相关的示例目标与构建项。

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

test/CMakeLists.txt 中删除了 HikCamera 与相关示例与可视化的构建逻辑;新增 tool/CMakeLists.txt,为 rmcs_auto_aim_v2_tools 项目建立 CMake 配置(C++23、ROS2 依赖、OpenCV、yaml-cpp)、可选 HikCamera 检测及若干可执行文件目标(visualization、hikcamera、streaming)。

Changes

Cohort / File(s) 变更概要
测试构建配置移除
test/CMakeLists.txt
删除 HikCamera 相关的 find_package(hikcamera)HIKCAMERA_AVAILABLE 检查以及条件示例目标(example_hikcameraexample_streaming);移除 Visualization 可执行及其 RTP/可视化目标和相关链接配置。
工具项目构建配置新增
tool/CMakeLists.txt
新增完整 CMake 项目定义:cmake_minimum_required(VERSION 3.22)project(rmcs_auto_aim_v2_tools)C++23 设置;设置 RMCS_SOURCE_DIR/RMCS_SRC_DIRfind_package 引入 rclcppvisualization_msgsgeometry_msgsyaml-cppOpenCV;配置 include 路径与 TOOL_DIR;定义 visualization 可执行并链接 ROS 库与消息包;添加对 hikcamera 的 QUIET 检测逻辑,基于可用性有条件地添加并链接 hikcamerastreaming 可执行,否则输出跳过构建的状态消息。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 分钟

需要额外关注的点:

  • tool/CMakeLists.txt 中对 HikCamera 的检测分支(hikcamera_FOUNDhikcamera_LIBRARIES)及其可移植性。
  • 可执行目标的 include 路径与链接库顺序(visualizationhikcamerastreaming)是否覆盖所有依赖。
  • 相对路径变量 RMCS_SOURCE_DIR / RMCS_SRC_DIR 在不同工作区结构下的准确性与健壮性。

诗篇

🐰 新构建在晨露中跳跃,
CMake 旗帜高高举,
HikCamera 若来若往,
小工具静候春风里。

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确反映了核心变更内容,即将工具和测试构建逻辑分离到不同的CMakeLists.txt文件中。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/separate-test-and-tool

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b1ddddd and 3615e6c.

📒 Files selected for processing (1)
  • tool/CMakeLists.txt (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tool/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

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
tool/CMakeLists.txt (1)

86-86: 消息文本混用语言。

状态消息使用中文,而代码其余部分为英文。建议统一为英文以符合国际化开发规范。

-    message(STATUS "hikcamera 未检测到,跳过相关构建")
+    message(STATUS "hikcamera not found, skipping related builds")
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b6fda31 and b1ddddd.

📒 Files selected for processing (2)
  • test/CMakeLists.txt (0 hunks)
  • tool/CMakeLists.txt (1 hunks)
💤 Files with no reviewable changes (1)
  • test/CMakeLists.txt
🔇 Additional comments (1)
tool/CMakeLists.txt (1)

4-5: C++23 标准支持验证。

C++23 是最新的 C++ 标准,某些编译器/平台可能不完全支持。请确认目标平台(特别是 ROS 2 支持的编译工具链)能够支持此标准。

Comment thread tool/CMakeLists.txt Outdated
Comment thread tool/CMakeLists.txt
Comment thread tool/CMakeLists.txt
@creeper5820
creeper5820 requested a review from qzhhhi December 15, 2025 09:27

@qzhhhi qzhhhi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把Rabbit的问题处理了

@qzhhhi qzhhhi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@creeper5820
creeper5820 merged commit 8687c42 into main Dec 15, 2025
2 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in RMCS Auto Aim V2 Dec 15, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Dec 15, 2025
heyeuu pushed a commit that referenced this pull request Dec 15, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Dec 15, 2025
@creeper5820
creeper5820 deleted the refactor/separate-test-and-tool branch December 17, 2025 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants