Skip to content

feat: Standard flight support#85

Merged
creeper5820 merged 30 commits into
mainfrom
creeper/flight
Jul 6, 2026
Merged

feat: Standard flight support#85
creeper5820 merged 30 commits into
mainfrom
creeper/flight

Conversation

@creeper5820

@creeper5820 creeper5820 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

本次变更主要为 RMCS 增加标准飞控(Flight)支持,并联动完善了相关控制、射击与 UI 配置。

  • 新增 flight.yaml 参数配置,补齐飞控硬件、云台、摩擦轮、拨弹、裁判交互、自动瞄准及 odin_ros_driver 等运行参数。
  • 新增 rmcs_core::hardware::Flight 硬件插件,实现飞控板、IMU、遥控器、CAN/UART 通信、TF 与裁判串口等整套硬件接入,并导出为插件。
  • 新增 rmcs_core::referee::app::ui::Flight UI 插件,用于展示弹药、摩擦轮状态和自动瞄准模式指示。
  • 在插件注册中替换/新增了 Flight 相关硬件、控制器与 UI 组件,同时移除了部分旧车体/控制器插件注册。
  • 云台控制加入自动瞄准开关、yaw 限位支持,以及基于当前角度的控制方向裁剪。
  • 射击控制改用新的 /auto_aim/should_shoot 输入,并调整自动/手动射击判定逻辑。
  • 电机模型新增 kMHF7015 类型支持。
  • StatusRing 增加 supercap/battery 显示开关参数。
  • 其余 CMake、描述文件与若干导出行主要为格式化或小幅整理。

总体来看,这次提交完成了飞控平台从硬件接入、控制链路到 UI 展示的一整套标准化支持。

heyeuu and others added 28 commits July 5, 2026 20:12
…cripts

- Refactor flight_mavros to support absolute pose tracking and feedback.
- Optimize odin1 launch script by integrating hardware drivers and auto-aim.
- Remove default Rviz startup to reduce system overhead in headless mode.
- Synchronize coordinate transformations for cross-platform deployment.
…te heat management, and conduct aerial tracking tests
…; fix:reverse the feeder's rotation direction
Add support for steering-hero and steering-hero-little, including hardware drivers, chassis control, gimbal control, shooting control, Hero UI integration, corresponding bringup configs, and plugin registration.

Also correct LK motor torque constants:
- kMG5010Ei10: 0.90909 -> 0.1
- kMG6012Ei8: 1.09 -> 1.09 / 8.0

To keep mainline vehicle control output unchanged, also retune:
- omni-infantry yaw velocity PID parameters
- sentry bottom yaw velocity PID / viscous FF parameters

Also remove the unmaintained mecanum-hero config.

Known issues (not blocking this merge):
- The Hero UI shooter condition / state_word path is still leftover debug wiring and is not connected to the current active runtime path
- HeroFrictionWheelController still preserves the historical friction-wheel index convention; for now this is only documented with a TODO and should later be replaced by an explicit first-stage mapping
- steering-hero-little still has a mismatch between PlayerViewer limit parameters and control logic, which requires follow-up calibration
- HeroChassisPowerController inherits the existing ChassisPowerController risk of reading uninitialized members / propagating non-finite values; this is a pre-existing shared issue, not newly introduced by this merge
- steering-hero-little uses different vehicle_radius values in steering_wheel_status and steering_wheel_controller
- HeroFrictionWheelController does not clear its jam fault counter after recovery, and Ctrl+F currently triggers a double profile toggle
- PutterController does not reset putter_timeout_count_ during normal stage transitions
- ChassisClimberController repeatedly resets back_climber_recover_count during auto-climb
- The Hero UI Ctrl+E bottom-yaw tracking toggle is currently level-triggered, so holding the keys causes repeated flipping

Co-authored-by: floatpigeon <floatpigeon@proton.me>
Co-authored-by: dwx5 <1591215786@qq.com>
Co-authored-by: zhzy-star <2807406212@qq.com>
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

新增 Flight 飞控硬件与 UI 插件、bringup 运行参数配置,扩展 LkMotor 电机型号;调整云台自动瞄准触发与 yaw 限位逻辑、拨弹控制器射击判据(从 fire_control 切换为 should_shoot)、状态环可见性开关;更新 plugins.xml 注册项;对若干文件做格式化调整(无语义变化)。

Changes

Flight 硬件与 UI 集成

Layer / File(s) Summary
容器启动配置
.script/template/entrypoint
新增基于 USBFS_MEMORY_MB 环境变量的 usbfs 内存参数写入逻辑,失败/不可写时输出告警并继续。
Flight bringup 配置与构建
rmcs_ws/src/rmcs_bringup/config/flight.yaml, rmcs_ws/src/rmcs_core/CMakeLists.txt
新增完整飞控运行时参数(执行器更新率、硬件/控制器/UI 映射、PID 增益等);CMake 配置格式重排(语义不变)。
Flight 硬件插件实现
rmcs_ws/src/rmcs_core/src/hardware/flight.cpp, rmcs_ws/src/rmcs_core/src/hardware/device/lk_motor.hpp, rmcs_ws/src/rmcs_core/plugins.xml
新增 Flight 硬件插件,完成电机/IMU 配置、TF 计算、CAN/UART 通信回调、命令组帧与状态服务;LkMotor 新增 kMHF7015 电机类型;plugins.xml 注册 Flight 硬件类并移除 MecanumHero
云台自动瞄准与 yaw 限位
rmcs_ws/src/rmcs_core/src/controller/gimbal/simple_gimbal_controller.cpp, .../two_axis_gimbal_solver.hpp, plugins.xml
新增 /auto_aim/should_control 开关与 allFinite 判据控制自动瞄准方向;TwoAxisGimbalSolver 新增 enable_yaw_limit/clamp_yaw_limit 限制 yaw 角范围;plugins.xml 注册 SimpleGimbalController 并移除 ChassisControllerV2/OmniInfantryPlannerGimbalController
拨弹控制器自动瞄准联动
rmcs_ws/src/rmcs_core/src/controller/shooting/bullet_feeder_controller_17mm.cpp, heat_controller.cpp
射击触发判据由 fire_control_ 切换为新的 /auto_aim/should_shootshould_shoot_),调整自动模式触发逻辑与变量类型;heat_controller 仅导出宏格式调整。
Flight UI 与状态环可见性
rmcs_ws/src/rmcs_core/src/referee/app/ui/flight.cpp, .../widget/status_ring.hpp, command/interaction/ui.cpp, referee/status.cpp, plugins.xml
新增 Flight UI 插件展示弹药/摩擦轮/自动瞄准状态并刷新模式指示器;StatusRing 新增 supercap/battery 可见性开关;plugins.xml 注册 UI Flight 并移除 AngleOutput;其余文件仅格式调整。
TF 描述格式化
rmcs_ws/src/rmcs_description/include/rmcs_description/sentry_description.hpp, tf_description.hpp
多个 fast_tf::Joint 特化中 using Parent 声明空格对齐规范化,无语义变化。

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CANBus
  participant Flight
  participant TFTree
  participant FlightCommand
  CANBus->>Flight: can0~3_receive_callback(电机/IMU数据)
  Flight->>Flight: update_motors()/update_imu()
  Flight->>TFTree: 发布云台/相机TF
  Flight->>FlightCommand: command_update()
  FlightCommand->>CANBus: 发送控制帧
Loading
sequenceDiagram
  participant Mouse
  participant SimpleGimbalController
  participant TwoAxisGimbalSolver
  participant BulletFeederController

  Mouse->>SimpleGimbalController: right/switch触发auto_aim_requested
  SimpleGimbalController->>SimpleGimbalController: 检查should_control与control_direction(allFinite)
  SimpleGimbalController->>TwoAxisGimbalSolver: SetControlDirection(...)
  TwoAxisGimbalSolver->>TwoAxisGimbalSolver: clamp_control_direction / clamp_yaw_limit
  BulletFeederController->>BulletFeederController: 读取should_shoot_决定bullet_allowance触发
Loading

Possibly related PRs

  • Alliance-Algorithm/RMCS#67: 主PR新增 TwoAxisGimbalSolver::enable_yaw_limit(...) 及相关yaw限位状态/输入,二者均修改同一 two_axis_gimbal_solver.hpp 文件中的同一类。
  • Alliance-Algorithm/RMCS#73: 与主PR共同修改 two_axis_gimbal_solver.hppTwoAxisGimbalSolver 类)、referee/status.cppupdate_map_command())及共享的 plugins.xml 插件注册。

Suggested reviewers: qzhhhi, Yukikaze2233, heyeuu

Poem

飞控插件跃上枝头,
云台锁定yaw角不再溜,
弹药裕量随瞄准而流,
兔子敲键盘,尾巴轻抖抖,
🐇✨ 提交合并,代码入坞!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed 标题明确指向本次新增的 flight 支持,且与变更集中的飞控/飞行相关组件新增相符。
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch creeper/flight

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (6)
rmcs_ws/src/rmcs_core/src/hardware/flight.cpp (2)

175-213: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

四个 CAN 接收回调中的帧长度检查与 store_status() 内部校验重复

can0_receive_callback/can1_receive_callback/can2_receive_callback/can3_receive_callback 均额外判断了 data.can_data.size() < 8,但 device::LkMotor::store_status() 已经内部校验了 can_data.size() != 8(见 lk_motor.hpp 第150-151行),device::DjiMotor 大概率也有相同的内部校验。对比 omni_infantry.cpp 中同类回调(can1/can2_receive_callback)并未做此重复判断,说明该额外检查是冗余的。

Based on learnings, "External pre-checks/guards that merely duplicate these same validations are considered redundant by the project maintainer and should generally be avoided unless they enforce additional, non-overlapping invariants."

♻️ 建议精简(示例,以 can0 为例)
 void can0_receive_callback(const librmcs::data::CanDataView& data) override {
-    if (data.is_extended_can_id || data.is_remote_transmission || data.can_data.size() < 8)
-        [[unlikely]]
+    if (data.is_extended_can_id || data.is_remote_transmission) [[unlikely]]
         return;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rmcs_ws/src/rmcs_core/src/hardware/flight.cpp` around lines 175 - 213, 四个 CAN
接收回调中的帧长度预检查与各自的 store_status() 内部校验重复了,属于冗余逻辑。请在
can0_receive_callback、can1_receive_callback、can2_receive_callback 和
can3_receive_callback 中移除 data.can_data.size() < 8 这类外部长度判断,仅保留 extended/remote
帧过滤和 CAN ID 分发,让
gimbal_left_friction_、gimbal_right_friction_、gimbal_bullet_feeder_、gimbal_yaw_motor_、gimbal_pitch_motor_
统一依赖 store_status() 自身的校验。

Source: Learnings


159-172: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

补上显式头文件
rmcs_ws/src/rmcs_core/src/hardware/flight.cpp 这里最好直接加入 <sstream><format><print>;项目已是 C++23,std::println 的标准版本没问题,但现在依赖间接包含太脆弱。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rmcs_ws/src/rmcs_core/src/hardware/flight.cpp` around lines 159 - 172,
status_service_callback currently relies on indirectly included headers for
std::ostringstream, std::format_string, and std::println, which makes the C++23
usage in this callback fragile. Add the explicit standard headers for the
formatting and stream types at the top of the file so the function remains
self-contained, and keep the existing logic in status_service_callback
unchanged.
rmcs_ws/src/rmcs_core/CMakeLists.txt (1)

10-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

无条件添加 -O2 可能覆盖 Debug 构建类型的优化设置。

add_compile_options(-O2 ...) 会对所有构建类型(包括 CMAKE_BUILD_TYPE=Debug)强制启用 -O2,这会影响调试体验(变量优化掉、单步执行错乱等)。建议改用基于 CMAKE_BUILD_TYPE 的生成器表达式,仅在 Release/RelWithDebInfo 下追加优化标志。

♻️ 建议修改
 if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-    add_compile_options(-O2 -Wall -Wextra -Wpedantic)
+    add_compile_options(-Wall -Wextra -Wpedantic
+        $<$<NOT:$<CONFIG:Debug>>:-O2>)
 endif()
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rmcs_ws/src/rmcs_core/CMakeLists.txt` around lines 10 - 12, The global
compile options in the CMakeLists logic currently force -O2 for every build,
including Debug, which can break debugging behavior. Update the compiler flag
handling in the top-level CMake logic near the add_compile_options block so that
optimization is only added for Release or RelWithDebInfo builds, using
CMAKE_BUILD_TYPE or a generator-expression-based condition, while keeping the
warning flags unchanged.
rmcs_ws/src/rmcs_bringup/config/flight.yaml (1)

25-26: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

value_broadcaster/tf_broadcaster 参数块与已注释掉的组件不一致。

Lines 25-26 已将这两个组件从 components 列表注释掉,但 lines 38-59 对应的参数块仍然保留,成为无效配置。建议一并注释或删除,避免误导后续维护者。

Also applies to: 38-59

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rmcs_ws/src/rmcs_bringup/config/flight.yaml` around lines 25 - 26, The flight
configuration still keeps the value_broadcaster and tf_broadcaster parameter
blocks even though their corresponding component entries in the components list
are commented out. Update the configuration around the affected broadcaster
sections so the parameter blocks are either commented out or removed to match
the disabled components, keeping the remaining YAML consistent and avoiding
stale settings.
rmcs_ws/src/rmcs_bringup/launch/rmcs.launch.py (1)

51-61: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

is_automatic 分支目前是空操作,自动启动 odin_ros_driver 的代码被整段注释。

if is_automatic: pass 未执行任何操作,紧随其后启动 odin_ros_drivertmux-launch.sh)的 Node 也被完整注释掉。这意味着 auto. 前缀的机器人配置目前不会再自动拉起飞控驱动,与该 PR "Flight硬件与UI集成"的目标存在出入。

如果这是有意的阶段性提交(后续 PR 补全),建议在此处留一条 TODO/说明;如果不是,需要恢复该启动逻辑或改用文件顶部新增的 IncludeLaunchDescription/PythonLaunchDescriptionSource(目前也未被实际使用)。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rmcs_ws/src/rmcs_bringup/launch/rmcs.launch.py` around lines 51 - 61, The
is_automatic branch in rmcs.launch.py is currently a no-op because the
odin_ros_driver startup Node is commented out, so the automatic launch path does
nothing. Either restore the Node launch for tmux-launch.sh inside the
is_automatic flow or, if this is intentionally deferred, replace the empty pass
with a clear TODO/comment indicating the missing auto-start behavior; also
remove or wire up the unused
IncludeLaunchDescription/PythonLaunchDescriptionSource imports so the launch
logic in the launch description is consistent.
rmcs_ws/src/rmcs_core/src/controller/shooting/bullet_feeder_controller_17mm.cpp (1)

31-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

转轮射频建议参数化。

shot_frequencysafe_shot_frequencyeject_frequencydeep_eject_frequency 均通过 get_parameter(...) 从配置读取,唯独 rotary_knob_shot_frequency 硬编码为 8.0。不同机器人/赛前调参场景下该值可能需要调整,建议同样暴露为可配置参数以保持一致性并方便调优。

♻️ 建议的参数化方式
-        constexpr double rotary_knob_shot_frequency = 8.0;
+        double rotary_knob_shot_frequency = get_parameter("rotary_knob_shot_frequency").as_double();
         bullet_feeder_rotary_knob_velocity_ =
             bullet_feeder_angle_per_bullet * rotary_knob_shot_frequency;

并在 flight.yaml(及其他相关配置)中补充该参数。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@rmcs_ws/src/rmcs_core/src/controller/shooting/bullet_feeder_controller_17mm.cpp`
around lines 31 - 33, `BulletFeederController17mm` still hardcodes
`rotary_knob_shot_frequency` while the other shot/eject rates are loaded via
`get_parameter(...)`. Update the controller to read this value from
configuration as a parameter, use it when computing
`bullet_feeder_rotary_knob_velocity_`, and add the corresponding setting to the
relevant YAML config files so it can be tuned per robot or match.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rmcs_ws/src/hikcamera`:
- Line 1: The submodule pointer for hikcamera is set to a commit that cannot be
resolved from the remote, so clean checkouts fail during git submodule update
--init. Update the hikcamera submodule reference to a commit that exists on the
remote configured in .gitmodules, or synchronize the submodule remote so the
current commit is fetchable; verify the submodule SHA and remote URL remain
consistent.

In `@rmcs_ws/src/rmcs_bringup/config/flight.yaml`:
- Around line 117-119: The bullet_feeder_controller configuration currently
leaves debug_ignore_friction_ready enabled by default, bypassing the
friction-wheel readiness safety check. Update the bullet_feeder_controller ROS
parameter in the flight.yaml config to use the normal-safe default and keep this
debug-only switch disabled unless explicitly needed; verify the parameter is set
appropriately alongside the other bullet_feeder_controller ros__parameters so
the feeder cannot act before the friction wheels are ready.

In `@rmcs_ws/src/rmcs_core/plugins.xml`:
- Around line 2-4: The plugin manifest still registers
rmcs_core::hardware::FlightMavros even though there is no corresponding
implementation in rmcs_core, so pluginlib loading will fail. Either remove the
FlightMavros class entry from plugins.xml or add the missing FlightMavros
implementation and ensure it matches the registered class type, while keeping
the existing MecanumHero and Flight declarations consistent with their actual
component classes.

In `@rmcs_ws/src/rmcs_core/src/referee/app/ui/flight.cpp`:
- Around line 46-54: In flight::update(), the auto-aim indicator currently uses
only mouse_->right to decide the UI state, so it can show enabled even when
control has not actually been taken over. Update the logic passed to
status_ring_.update_auto_aim_enable to combine the existing request state with
the real control state from /auto_aim/should_control and the direction-validity
condition, keeping the change localized in flight::update and the status_ring_
update call.

In `@rmcs_ws/src/rmcs_core/src/referee/command/interaction/ui.cpp`:
- Around line 149-169: The text-update path in write_updating_text_field() is
starving normal shape updates because it returns immediately on the first text
shape and scans the entire CfsScheduler<Shape> every cycle. Update the
scheduling so text updates do not always preempt ordinary shapes—either split
the text and shape queues, add a round-robin/quota mechanism, or otherwise bound
how often write_updating_text_field() can consume a cycle. Use the existing Text
state_word_ in ui/hero.cpp and the write_updating_text_field() flow in ui.cpp to
locate the change, and preserve fairness so non-text shapes continue to make
progress.

---

Nitpick comments:
In `@rmcs_ws/src/rmcs_bringup/config/flight.yaml`:
- Around line 25-26: The flight configuration still keeps the value_broadcaster
and tf_broadcaster parameter blocks even though their corresponding component
entries in the components list are commented out. Update the configuration
around the affected broadcaster sections so the parameter blocks are either
commented out or removed to match the disabled components, keeping the remaining
YAML consistent and avoiding stale settings.

In `@rmcs_ws/src/rmcs_bringup/launch/rmcs.launch.py`:
- Around line 51-61: The is_automatic branch in rmcs.launch.py is currently a
no-op because the odin_ros_driver startup Node is commented out, so the
automatic launch path does nothing. Either restore the Node launch for
tmux-launch.sh inside the is_automatic flow or, if this is intentionally
deferred, replace the empty pass with a clear TODO/comment indicating the
missing auto-start behavior; also remove or wire up the unused
IncludeLaunchDescription/PythonLaunchDescriptionSource imports so the launch
logic in the launch description is consistent.

In `@rmcs_ws/src/rmcs_core/CMakeLists.txt`:
- Around line 10-12: The global compile options in the CMakeLists logic
currently force -O2 for every build, including Debug, which can break debugging
behavior. Update the compiler flag handling in the top-level CMake logic near
the add_compile_options block so that optimization is only added for Release or
RelWithDebInfo builds, using CMAKE_BUILD_TYPE or a generator-expression-based
condition, while keeping the warning flags unchanged.

In
`@rmcs_ws/src/rmcs_core/src/controller/shooting/bullet_feeder_controller_17mm.cpp`:
- Around line 31-33: `BulletFeederController17mm` still hardcodes
`rotary_knob_shot_frequency` while the other shot/eject rates are loaded via
`get_parameter(...)`. Update the controller to read this value from
configuration as a parameter, use it when computing
`bullet_feeder_rotary_knob_velocity_`, and add the corresponding setting to the
relevant YAML config files so it can be tuned per robot or match.

In `@rmcs_ws/src/rmcs_core/src/hardware/flight.cpp`:
- Around line 175-213: 四个 CAN 接收回调中的帧长度预检查与各自的 store_status() 内部校验重复了,属于冗余逻辑。请在
can0_receive_callback、can1_receive_callback、can2_receive_callback 和
can3_receive_callback 中移除 data.can_data.size() < 8 这类外部长度判断,仅保留 extended/remote
帧过滤和 CAN ID 分发,让
gimbal_left_friction_、gimbal_right_friction_、gimbal_bullet_feeder_、gimbal_yaw_motor_、gimbal_pitch_motor_
统一依赖 store_status() 自身的校验。
- Around line 159-172: status_service_callback currently relies on indirectly
included headers for std::ostringstream, std::format_string, and std::println,
which makes the C++23 usage in this callback fragile. Add the explicit standard
headers for the formatting and stream types at the top of the file so the
function remains self-contained, and keep the existing logic in
status_service_callback unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a820ed67-3346-40e5-ba2b-b3f141a9e1af

📥 Commits

Reviewing files that changed from the base of the PR and between 1e99fd9 and dfe4f35.

📒 Files selected for processing (23)
  • .gitmodules
  • .script/template/entrypoint
  • rmcs_ws/src/hikcamera
  • rmcs_ws/src/odin_ros_driver
  • rmcs_ws/src/rmcs_auto_aim_v2
  • rmcs_ws/src/rmcs_bringup/config/flight.yaml
  • rmcs_ws/src/rmcs_bringup/launch/rmcs.launch.py
  • rmcs_ws/src/rmcs_bringup/package.xml
  • rmcs_ws/src/rmcs_core/CMakeLists.txt
  • rmcs_ws/src/rmcs_core/package.xml
  • rmcs_ws/src/rmcs_core/plugins.xml
  • rmcs_ws/src/rmcs_core/src/controller/gimbal/simple_gimbal_controller.cpp
  • rmcs_ws/src/rmcs_core/src/controller/gimbal/two_axis_gimbal_solver.hpp
  • rmcs_ws/src/rmcs_core/src/controller/shooting/bullet_feeder_controller_17mm.cpp
  • rmcs_ws/src/rmcs_core/src/controller/shooting/heat_controller.cpp
  • rmcs_ws/src/rmcs_core/src/hardware/device/lk_motor.hpp
  • rmcs_ws/src/rmcs_core/src/hardware/flight.cpp
  • rmcs_ws/src/rmcs_core/src/hardware/omni_infantry.cpp
  • rmcs_ws/src/rmcs_core/src/referee/app/ui/flight.cpp
  • rmcs_ws/src/rmcs_core/src/referee/app/ui/shape/shape.hpp
  • rmcs_ws/src/rmcs_core/src/referee/app/ui/widget/status_ring.hpp
  • rmcs_ws/src/rmcs_core/src/referee/command/interaction/ui.cpp
  • rmcs_ws/src/rmcs_core/src/referee/status.cpp

Comment thread rmcs_ws/src/hikcamera Outdated
Comment thread rmcs_ws/src/rmcs_bringup/config/flight.yaml Outdated
Comment thread rmcs_ws/src/rmcs_core/plugins.xml Outdated
Comment thread rmcs_ws/src/rmcs_core/src/referee/app/ui/flight.cpp
Comment thread rmcs_ws/src/rmcs_core/src/referee/command/interaction/ui.cpp Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
rmcs_ws/src/rmcs_core/src/controller/shooting/bullet_feeder_controller_17mm.cpp (1)

190-190: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

直接 include 的 <cmath>/<limits> 被移除,存在传递包含风险。

文件仍使用 std::numeric_limits(Line 190)以及 std::round(构造函数中),这些符号分别依赖 <limits><cmath>。移除直接 include 后依赖其他头文件间接提供,若上游头文件发生变化可能导致编译失败。

♻️ 建议恢复直接 include
+#include <cmath>
+#include <limits>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@rmcs_ws/src/rmcs_core/src/controller/shooting/bullet_feeder_controller_17mm.cpp`
at line 190, The direct includes for <cmath> and <limits> were removed, but
bullet_feeder_controller_17mm.cpp still uses std::numeric_limits in the nan_
declaration and std::round in the constructor, so restore those headers in this
translation unit instead of relying on transitive includes. Update the include
list near the top of the file to explicitly add the missing standard headers and
keep the existing symbols working regardless of upstream header changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@rmcs_ws/src/rmcs_core/src/controller/shooting/bullet_feeder_controller_17mm.cpp`:
- Line 190: The direct includes for <cmath> and <limits> were removed, but
bullet_feeder_controller_17mm.cpp still uses std::numeric_limits in the nan_
declaration and std::round in the constructor, so restore those headers in this
translation unit instead of relying on transitive includes. Update the include
list near the top of the file to explicitly add the missing standard headers and
keep the existing symbols working regardless of upstream header changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b465dcec-2188-4853-976c-9c86d1c42701

📥 Commits

Reviewing files that changed from the base of the PR and between dfe4f35 and 1820c84.

📒 Files selected for processing (10)
  • .gitmodules
  • rmcs_ws/src/rmcs_bringup/config/flight.yaml
  • rmcs_ws/src/rmcs_core/plugins.xml
  • rmcs_ws/src/rmcs_core/src/controller/gimbal/simple_gimbal_controller.cpp
  • rmcs_ws/src/rmcs_core/src/controller/gimbal/two_axis_gimbal_solver.hpp
  • rmcs_ws/src/rmcs_core/src/controller/shooting/bullet_feeder_controller_17mm.cpp
  • rmcs_ws/src/rmcs_core/src/referee/app/ui/flight.cpp
  • rmcs_ws/src/rmcs_core/src/referee/app/ui/widget/status_ring.hpp
  • rmcs_ws/src/rmcs_core/src/referee/command/interaction/ui.cpp
  • rmcs_ws/src/rmcs_core/src/referee/status.cpp
✅ Files skipped from review due to trivial changes (3)
  • rmcs_ws/src/rmcs_core/src/referee/status.cpp
  • rmcs_ws/src/rmcs_core/src/referee/command/interaction/ui.cpp
  • .gitmodules
🚧 Files skipped from review as they are similar to previous changes (3)
  • rmcs_ws/src/rmcs_bringup/config/flight.yaml
  • rmcs_ws/src/rmcs_core/src/controller/gimbal/simple_gimbal_controller.cpp
  • rmcs_ws/src/rmcs_core/src/referee/app/ui/flight.cpp

@creeper5820 creeper5820 requested a review from qzhhhi July 6, 2026 09:23
@creeper5820 creeper5820 moved this from Todo to Done in RMCS Jul 6, 2026
@creeper5820 creeper5820 moved this from Done to In progress in RMCS Jul 6, 2026
@creeper5820 creeper5820 merged commit f1ddece into main Jul 6, 2026
1 check was pending
@github-project-automation github-project-automation Bot moved this from In progress to Done in RMCS Jul 6, 2026
@creeper5820 creeper5820 deleted the creeper/flight branch July 6, 2026 16:03
qzhhhi pushed a commit that referenced this pull request Jul 6, 2026
- Add flight.yaml parameter config for Flight hardware, gimbal, friction wheels, feeder, referee interaction, auto-aim, and odin_ros_driver.
- Add rmcs_core::hardware::Flight hardware plugin supporting flight controller, IMU, remote control, CAN/UART comms, TF, and referee serial.
- Add rmcs_core::referee::app::ui::Flight UI plugin for ammo, friction wheel status, and auto-aim mode display.
- Replace/add Flight-related hardware, controller, and UI components in plugin registry; remove some legacy chassis/controller registrations.
- Add auto-aim toggle, yaw limit support, and direction clamping based on current angle to gimbal control.
- Switch shooting control to /auto_aim/should_shoot input and refine auto/manual shooting logic.
- Add kMHF7015 motor type support.
- Add supercap/battery display toggle to StatusRing.
- Minor CMake, description file, and export formatting/cleanup.

Co-authored-by: heyeuu <2829004293@qq.com>
Co-authored-by: zlq040222 <1542498005@qq.com>
ZGZ713912 added a commit that referenced this pull request Jul 7, 2026
commit 2c63c7d
Author: creeper5820 <131014151+creeper5820@users.noreply.github.com>
Date:   Tue Jul 7 00:03:30 2026 +0800

    feat: Integrate flight support (#85)

    - Add flight.yaml parameter config for Flight hardware, gimbal, friction wheels, feeder, referee interaction, auto-aim, and odin_ros_driver.
    - Add rmcs_core::hardware::Flight hardware plugin supporting flight controller, IMU, remote control, CAN/UART comms, TF, and referee serial.
    - Add rmcs_core::referee::app::ui::Flight UI plugin for ammo, friction wheel status, and auto-aim mode display.
    - Replace/add Flight-related hardware, controller, and UI components in plugin registry; remove some legacy chassis/controller registrations.
    - Add auto-aim toggle, yaw limit support, and direction clamping based on current angle to gimbal control.
    - Switch shooting control to /auto_aim/should_shoot input and refine auto/manual shooting logic.
    - Add kMHF7015 motor type support.
    - Add supercap/battery display toggle to StatusRing.
    - Minor CMake, description file, and export formatting/cleanup.

    Co-authored-by: heyeuu <2829004293@qq.com>
    Co-authored-by: zlq040222 <1542498005@qq.com>

commit 1e99fd9
Author: Zihan Qin <zihanqin2048@gmail.com>
Date:   Fri Jun 12 11:48:28 2026 +0800

    feat: Add event interfaces and board-clocked IMU pipeline (#83)

    This commit lays the groundwork for upcoming IMU-camera hardware synchronization.

    - Add event input/output support to rmcs_executor
    - Add board clock, IMU snapshot, and raw camera frame message types
    - Integrate board-timestamped BMI088 EKF outputs in OmniInfantry
    - Add utility primitives used by the sync pipeline

    Known limitation:
    - OmniInfantry does not preserve the old BMI088 body-to-sensor mapping. This is intentional because that platform is retired and its original mechanical layout no longer exists. It is kept only as the remaining single-board hardware target for sync pipeline testing, so preserving its legacy IMU axis alignment is no longer necessary.

commit c0ab658
Author: Zihan Qin <zihanqin2048@gmail.com>
Date:   Wed Jun 10 18:00:35 2026 +0800

    feat: Fold climbable-infantry into maintained steering-infantry (#82)

    - Convert the active climbable-infantry line into the maintained steering-infantry variant. Remove the stair-climbing control chain and dedicated climber motors, revert the temporary VT13 / merged-remote stack back to pure DR16, and rename the cleaned result back to steering-infantry because the historical steering-infantry is no longer maintained.
    - Update SteeringInfantry to the rmcs-board-lite split top/bottom board path and refresh its bringup config for the current robot. Also restore the original /gimbal/calibrate and /steers/calibrate semantics, remove the temporary yaw watchdog path, make pitch control explicitly use LK velocity commands, and recover accidentally removed mainline content while keeping only the required steering-infantry merge delta.

    Update librmcs from v3.2.0b0 to v3.2.0 for the required board-lite SDK.

    Co-authored-by: Palejoker <2797572751@qq.com>
    Co-authored-by: Fin_Resect <chenchengyue201@126.com>

commit b5ae6cb
Author: Zihan Qin <zihanqin2048@gmail.com>
Date:   Tue Jun 9 22:20:27 2026 +0800

    feat: Integrate steering-hero support (#80)

    Add support for steering-hero and steering-hero-little, including hardware drivers, chassis control, gimbal control, shooting control, Hero UI integration, corresponding bringup configs, and plugin registration.

    Also correct LK motor torque constants:
    - kMG5010Ei10: 0.90909 -> 0.1
    - kMG6012Ei8: 1.09 -> 1.09 / 8.0

    To keep mainline vehicle control output unchanged, also retune:
    - omni-infantry yaw velocity PID parameters
    - sentry bottom yaw velocity PID / viscous FF parameters

    Also remove the unmaintained mecanum-hero config.

    Known issues (not blocking this merge):
    - The Hero UI shooter condition / state_word path is still leftover debug wiring and is not connected to the current active runtime path
    - HeroFrictionWheelController still preserves the historical friction-wheel index convention; for now this is only documented with a TODO and should later be replaced by an explicit first-stage mapping
    - steering-hero-little still has a mismatch between PlayerViewer limit parameters and control logic, which requires follow-up calibration
    - HeroChassisPowerController inherits the existing ChassisPowerController risk of reading uninitialized members / propagating non-finite values; this is a pre-existing shared issue, not newly introduced by this merge
    - steering-hero-little uses different vehicle_radius values in steering_wheel_status and steering_wheel_controller
    - HeroFrictionWheelController does not clear its jam fault counter after recovery, and Ctrl+F currently triggers a double profile toggle
    - PutterController does not reset putter_timeout_count_ during normal stage transitions
    - ChassisClimberController repeatedly resets back_climber_recover_count during auto-climb
    - The Hero UI Ctrl+E bottom-yaw tracking toggle is currently level-triggered, so holding the keys causes repeated flipping

    Co-authored-by: floatpigeon <floatpigeon@proton.me>
    Co-authored-by: dwx5 <1591215786@qq.com>
    Co-authored-by: zhzy-star <2807406212@qq.com>

commit 8407c1d
Author: qzhhhi <zihanqin2048@gmail.com>
Date:   Sat May 30 23:17:41 2026 +0800

    style: Apply clang-format across all C++ source files
ZGZ713912 added a commit that referenced this pull request Jul 7, 2026
commit 2c63c7d
Author: creeper5820 <131014151+creeper5820@users.noreply.github.com>
Date:   Tue Jul 7 00:03:30 2026 +0800

    feat: Integrate flight support (#85)

    - Add flight.yaml parameter config for Flight hardware, gimbal, friction wheels, feeder, referee interaction, auto-aim, and odin_ros_driver.
    - Add rmcs_core::hardware::Flight hardware plugin supporting flight controller, IMU, remote control, CAN/UART comms, TF, and referee serial.
    - Add rmcs_core::referee::app::ui::Flight UI plugin for ammo, friction wheel status, and auto-aim mode display.
    - Replace/add Flight-related hardware, controller, and UI components in plugin registry; remove some legacy chassis/controller registrations.
    - Add auto-aim toggle, yaw limit support, and direction clamping based on current angle to gimbal control.
    - Switch shooting control to /auto_aim/should_shoot input and refine auto/manual shooting logic.
    - Add kMHF7015 motor type support.
    - Add supercap/battery display toggle to StatusRing.
    - Minor CMake, description file, and export formatting/cleanup.

    Co-authored-by: heyeuu <2829004293@qq.com>
    Co-authored-by: zlq040222 <1542498005@qq.com>

commit 1e99fd9
Author: Zihan Qin <zihanqin2048@gmail.com>
Date:   Fri Jun 12 11:48:28 2026 +0800

    feat: Add event interfaces and board-clocked IMU pipeline (#83)

    This commit lays the groundwork for upcoming IMU-camera hardware synchronization.

    - Add event input/output support to rmcs_executor
    - Add board clock, IMU snapshot, and raw camera frame message types
    - Integrate board-timestamped BMI088 EKF outputs in OmniInfantry
    - Add utility primitives used by the sync pipeline

    Known limitation:
    - OmniInfantry does not preserve the old BMI088 body-to-sensor mapping. This is intentional because that platform is retired and its original mechanical layout no longer exists. It is kept only as the remaining single-board hardware target for sync pipeline testing, so preserving its legacy IMU axis alignment is no longer necessary.

commit c0ab658
Author: Zihan Qin <zihanqin2048@gmail.com>
Date:   Wed Jun 10 18:00:35 2026 +0800

    feat: Fold climbable-infantry into maintained steering-infantry (#82)

    - Convert the active climbable-infantry line into the maintained steering-infantry variant. Remove the stair-climbing control chain and dedicated climber motors, revert the temporary VT13 / merged-remote stack back to pure DR16, and rename the cleaned result back to steering-infantry because the historical steering-infantry is no longer maintained.
    - Update SteeringInfantry to the rmcs-board-lite split top/bottom board path and refresh its bringup config for the current robot. Also restore the original /gimbal/calibrate and /steers/calibrate semantics, remove the temporary yaw watchdog path, make pitch control explicitly use LK velocity commands, and recover accidentally removed mainline content while keeping only the required steering-infantry merge delta.

    Update librmcs from v3.2.0b0 to v3.2.0 for the required board-lite SDK.

    Co-authored-by: Palejoker <2797572751@qq.com>
    Co-authored-by: Fin_Resect <chenchengyue201@126.com>

commit b5ae6cb
Author: Zihan Qin <zihanqin2048@gmail.com>
Date:   Tue Jun 9 22:20:27 2026 +0800

    feat: Integrate steering-hero support (#80)

    Add support for steering-hero and steering-hero-little, including hardware drivers, chassis control, gimbal control, shooting control, Hero UI integration, corresponding bringup configs, and plugin registration.

    Also correct LK motor torque constants:
    - kMG5010Ei10: 0.90909 -> 0.1
    - kMG6012Ei8: 1.09 -> 1.09 / 8.0

    To keep mainline vehicle control output unchanged, also retune:
    - omni-infantry yaw velocity PID parameters
    - sentry bottom yaw velocity PID / viscous FF parameters

    Also remove the unmaintained mecanum-hero config.

    Known issues (not blocking this merge):
    - The Hero UI shooter condition / state_word path is still leftover debug wiring and is not connected to the current active runtime path
    - HeroFrictionWheelController still preserves the historical friction-wheel index convention; for now this is only documented with a TODO and should later be replaced by an explicit first-stage mapping
    - steering-hero-little still has a mismatch between PlayerViewer limit parameters and control logic, which requires follow-up calibration
    - HeroChassisPowerController inherits the existing ChassisPowerController risk of reading uninitialized members / propagating non-finite values; this is a pre-existing shared issue, not newly introduced by this merge
    - steering-hero-little uses different vehicle_radius values in steering_wheel_status and steering_wheel_controller
    - HeroFrictionWheelController does not clear its jam fault counter after recovery, and Ctrl+F currently triggers a double profile toggle
    - PutterController does not reset putter_timeout_count_ during normal stage transitions
    - ChassisClimberController repeatedly resets back_climber_recover_count during auto-climb
    - The Hero UI Ctrl+E bottom-yaw tracking toggle is currently level-triggered, so holding the keys causes repeated flipping

    Co-authored-by: floatpigeon <floatpigeon@proton.me>
    Co-authored-by: dwx5 <1591215786@qq.com>
    Co-authored-by: zhzy-star <2807406212@qq.com>

commit 8407c1d
Author: qzhhhi <zihanqin2048@gmail.com>
Date:   Sat May 30 23:17:41 2026 +0800

    style: Apply clang-format across all C++ source files
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.

5 participants