Skip to content

feat(sentry): add chassis climb control - #90

Merged
gqsdjhh merged 1 commit into
dev/sentryfrom
dev/climb_sentry
Jul 13, 2026
Merged

feat(sentry): add chassis climb control#90
gqsdjhh merged 1 commit into
dev/sentryfrom
dev/climb_sentry

Conversation

@gqsdjhh

@gqsdjhhgqsdjhh commented Jul 13, 2026

Copy link
Copy Markdown

新增 ChassisClimberController
- 增加前后爬梯电机控制输出
- 增加自动爬梯状态机,包含 ALIGN / APPROACH / SUPPORT_DEPLOY / DASH / SUPPORT_RETRACT
- 支持手动支撑控制和自动爬梯触发
- 增加前爬梯功率估算与限幅配合逻辑

PR 摘要

新增 ChassisClimberController,实现爬梯机构的前后电机控制、自动爬梯状态机、手动支撑控制及前爬梯功率限幅。

主要变更

  • 新增自动爬梯流程:ALIGNAPPROACHSUPPORT_DEPLOYDASHSUPPORT_RETRACT
  • 支持自动爬梯触发、中止、台阶循环、超时处理及手动支撑回缩。
  • 新增前爬梯功率估算与限幅逻辑,联动底盘功率控制器输出功率上限。
  • 扩展底盘速度与角速度控制,使爬梯前进速度可接管常规控制。
  • 在 Sentry 硬件中加入前后爬梯电机初始化、状态更新、CAN 收发及底盘俯仰 IMU 输出。
  • 注册爬梯控制器插件,并新增相关参数配置;同步更新电机标定参数及组件启用状态。

@coderabbitai

coderabbitaiBot commented Jul 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 18d86be2-fb5f-4f18-9487-fef04f27274b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev/climb_sentry

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.

@coderabbitaicoderabbitaiBot 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: 2

🧹 Nitpick comments (1)
rmcs_ws/src/rmcs_core/src/controller/chassis/chassis_power_controller.cpp (1)

136-137: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

前爬梯功率上限被直接赋值为整车控制功率上限,请确认功率预算是否会被重复占用。control_power_limit_/chassis/climber/front/control_power_limit)与 chassis_control_power_limit_ 取相同的 power_limit。前爬梯功率限幅器(ChassisClimberFrontPowerLimiter)据此对前爬梯力矩限幅,这意味着前爬梯可独占整车全部控制功率预算,若与底盘轮组的功耗叠加,可能超过裁判系统功率上限。请确认这是有意作为“上限”传递,还是应为前爬梯分配一部分预算。

🤖 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/chassis/chassis_power_controller.cpp`
around lines 136 - 137, Review the assignments in the chassis power controller
and prevent ChassisClimberFrontPowerLimiter from receiving the full vehicle
control budget through control_power_limit_. Determine the intended shared power
allocation with the chassis wheels, then assign control_power_limit_ only the
front climber’s allocated portion while preserving chassis_control_power_limit_
as the vehicle-level limit.
🤖 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/rmcs_core/src/controller/chassis/chassis_climber_controller.cpp`:
- Around line 135-140: 将 stop_manual_support() 从自动爬梯控制循环中移除,避免每帧重置
back_climber_recover_count。改为在 AutoClimbState 从 IDLE 进入自动爬梯时执行一次性初始化,并保持
update_auto_climb_control() 与 apply_climb_control() 的现有控制流程不变。
In `@rmcs_ws/src/rmcs_core/src/controller/chassis/chassis_controller.cpp`:
- Around line 63-67: 在 ChassisController 的 before_updating() 中为
climbing_forward_velocity_ 增加可选输入兜底:检查 ready(),未就绪时调用
make_and_bind_directly(kNaN)。保持已有 chassis_velocity_ 处理逻辑不变,并确保后续直接解引用
climbing_forward_velocity_ 时始终已绑定。
---
Nitpick comments:
In `@rmcs_ws/src/rmcs_core/src/controller/chassis/chassis_power_controller.cpp`:
- Around line 136-137: Review the assignments in the chassis power controller
and prevent ChassisClimberFrontPowerLimiter from receiving the full vehicle
control budget through control_power_limit_. Determine the intended shared power
allocation with the chassis wheels, then assign control_power_limit_ only the
front climber’s allocated portion while preserving chassis_control_power_limit_
as the vehicle-level limit.
🪄 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: 19b06f88-36ed-4382-bc04-e1d4a29bb28c

📥 Commits

Reviewing files that changed from the base of the PR and between 14931aa and a9d17dc.

📒 Files selected for processing (6)
  • rmcs_ws/src/rmcs_bringup/config/sentry.yaml
  • rmcs_ws/src/rmcs_core/plugins.xml
  • rmcs_ws/src/rmcs_core/src/controller/chassis/chassis_climber_controller.cpp
  • rmcs_ws/src/rmcs_core/src/controller/chassis/chassis_controller.cpp
  • rmcs_ws/src/rmcs_core/src/controller/chassis/chassis_power_controller.cpp
  • rmcs_ws/src/rmcs_core/src/hardware/sentry.cpp

Comment on lines +135 to +140
if (auto_climb_state_ != AutoClimbState::IDLE) {
stop_manual_support();
apply_climb_control(update_auto_climb_control());
} else {
apply_climb_control(update_manual_support_control(keyboard));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bashset -euo pipefail
FILE="rmcs_ws/src/rmcs_core/src/controller/chassis/chassis_climber_controller.cpp"# Show the relevant regions around the cited lines and related helpers.
sed -n '120,170p'"$FILE"printf'\n----\n'
sed -n '450,575p'"$FILE"printf'\n----\n'
sed -n '575,670p'"$FILE"

Repository: Alliance-Algorithm/RMCS

Length of output: 11830


🏁 Script executed:

#!/bin/bashset -euo pipefail
FILE="rmcs_ws/src/rmcs_core/src/controller/chassis/chassis_climber_controller.cpp"# Inspect the auto-climb state machine and the entry path that may reset the counter.
sed -n '360,470p'"$FILE"printf'\n----\n'
sed -n '470,560p'"$FILE"

Repository: Alliance-Algorithm/RMCS

Length of output: 8662


自动爬梯时不要每帧重置 stop_manual_support() 这里每次进入自动分支都会把 back_climber_recover_count 重新设为 1500,导致 update_auto_climb_support_retract() 里的 <= 1200 快速回缩分支和 apply_climb_control() 里的第二档限扭分支都进不去。把这个重置移到进入自动爬梯时的一次性初始化即可。

🤖 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/chassis/chassis_climber_controller.cpp`
around lines 135 - 140, 将 stop_manual_support() 从自动爬梯控制循环中移除,避免每帧重置
back_climber_recover_count。改为在 AutoClimbState 从 IDLE 进入自动爬梯时执行一次性初始化,并保持
update_auto_climb_control() 与 apply_climb_control() 的现有控制流程不变。

Comment on lines +63 to +67
chassis_velocity_feedback_ready_ = chassis_velocity_.ready();
if (!chassis_velocity_feedback_ready_) {
chassis_velocity_.make_and_bind_directly(0.0, 0.0, 0.0);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bashset -euo pipefail
# Inspect the target file around the referenced lines and related symbols.
file='rmcs_ws/src/rmcs_core/src/controller/chassis/chassis_controller.cpp'echo'--- outline ---'
ast-grep outline "$file" --view expanded ||trueecho'--- relevant line ranges ---'
sed -n '1,120p'"$file"| cat -n
echo'--- mid section ---'
sed -n '120,260p'"$file"| cat -n
echo'--- search for climbing_forward_velocity_ usage ---'
rg -n "climbing_forward_velocity_|gimbal_yaw_angle_|chassis_velocity_|make_and_bind_directly|ready\\(""$file"

Repository: Alliance-Algorithm/RMCS

Length of output: 16873


🏁 Script executed:

#!/bin/bashset -euo pipefail
echo'--- search for /chassis/climbing_forward_velocity publishers/usages ---'
rg -n "/chassis/climbing_forward_velocity|climbing_forward_velocity" rmcs_ws -g '!**/build/**' -g '!**/install/**' -g '!**/log/**'echo'--- locate sentry/config files mentioning climber or chassis controller ---'
fd -a 'sentry.yaml|*.yaml|*.yml' rmcs_ws 2>/dev/null | sed -n '1,120p'

Repository: Alliance-Algorithm/RMCS

Length of output: 1585


🏁 Script executed:

#!/bin/bashset -euo pipefail
# Find the InputInterface definition and inspect dereference semantics.
rg -n "class InputInterface|struct InputInterface|operator\\*|ready\\(|make_and_bind_directly" rmcs_ws -g '!**/build/**' -g '!**/install/**' -g '!**/log/**'echo'--- candidate files for InputInterface ---'
fd -a 'input_interface.*|interface.*input.*|*.hpp|*.h' rmcs_ws/src rmcs_ws/include 2>/dev/null | sed -n '1,120p'

Repository: Alliance-Algorithm/RMCS

Length of output: 11061


🏁 Script executed:

#!/bin/bashset -euo pipefail
echo'--- inspect InputInterface semantics ---'
sed -n '60,120p' rmcs_ws/src/rmcs_executor/include/rmcs_executor/component.hpp | cat -n
echo'--- find chassis controller / climber controller composition references ---'
rg -n "chassis_controller|chassis_climber_controller|/chassis/climbing_forward_velocity|climbing_forward_velocity" rmcs_ws -g '!**/build/**' -g '!**/install/**' -g '!**/log/**' -g '*.yaml' -g '*.yml' -g '*.cpp' -g '*.hpp' -g '*.launch*' -g '*.xml'

Repository: Alliance-Algorithm/RMCS

Length of output: 5579


🏁 Script executed:

#!/bin/bashset -euo pipefail
forfin \
rmcs_ws/src/rmcs_bringup/config/sentry.yaml \
rmcs_ws/src/rmcs_bringup/config/mecanum-hero.yaml \
rmcs_ws/src/rmcs_bringup/config/steering-infantry.yaml \
rmcs_ws/src/rmcs_bringup/config/omni-infantry.yaml \
rmcs_ws/src/rmcs_bringup/config/deformable-infantry-omni.yaml \
rmcs_ws/src/rmcs_bringup/config/deformable-infantry-steering.yaml
doecho"=== $f ==="
rg -n "chassis_controller|chassis_climber_controller|/chassis/climbing_forward_velocity|/chassis/velocity|components:|controller:""$f"||trueechodone

Repository: Alliance-Algorithm/RMCS

Length of output: 10015


climbing_forward_velocity_ 需要补上兜底绑定。 这个输入虽然标成 required=false,但后面会直接 *climbing_forward_velocity_;在 mecanum-herosteering-infantryomni-infantry 等只加载 ChassisController、没有 ChassisClimberController 输出来源的配置下,会直接崩溃。建议像其它可选输入一样在 before_updating() 里用 ready() 补一个 make_and_bind_directly(kNaN)

🤖 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/chassis/chassis_controller.cpp` around
lines 63 - 67, 在 ChassisController 的 before_updating() 中为
climbing_forward_velocity_ 增加可选输入兜底:检查 ready(),未就绪时调用
make_and_bind_directly(kNaN)。保持已有 chassis_velocity_ 处理逻辑不变,并确保后续直接解引用
climbing_forward_velocity_ 时始终已绑定。

@gqsdjhh
gqsdjhh merged commit 490c705 into dev/sentryJul 13, 2026
1 check passed
@github-project-automationgithub-project-automationBot moved this from Todo to Done in RMCSJul 13, 2026
Sign up for freeto 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.

1 participant

@gqsdjhh