Uh oh!
There was an error while loading. Please reload this page.
feat(sentry): add chassis climb control - #90
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (6)
rmcs_ws/src/rmcs_bringup/config/sentry.yamlrmcs_ws/src/rmcs_core/plugins.xmlrmcs_ws/src/rmcs_core/src/controller/chassis/chassis_climber_controller.cpprmcs_ws/src/rmcs_core/src/controller/chassis/chassis_controller.cpprmcs_ws/src/rmcs_core/src/controller/chassis/chassis_power_controller.cpprmcs_ws/src/rmcs_core/src/hardware/sentry.cpp
| 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)); | ||
| } |
There was a problem hiding this comment.
🎯 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() 的现有控制流程不变。
| chassis_velocity_feedback_ready_ = chassis_velocity_.ready(); | ||
| if (!chassis_velocity_feedback_ready_) { | ||
| chassis_velocity_.make_and_bind_directly(0.0, 0.0, 0.0); | ||
| } | ||
There was a problem hiding this comment.
🩺 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"||trueechodoneRepository: Alliance-Algorithm/RMCS
Length of output: 10015
climbing_forward_velocity_ 需要补上兜底绑定。 这个输入虽然标成 required=false,但后面会直接 *climbing_forward_velocity_;在 mecanum-hero、steering-infantry、omni-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_ 时始终已绑定。
新增
ChassisClimberController- 增加前后爬梯电机控制输出
- 增加自动爬梯状态机,包含
ALIGN / APPROACH / SUPPORT_DEPLOY / DASH / SUPPORT_RETRACT- 支持手动支撑控制和自动爬梯触发
- 增加前爬梯功率估算与限幅配合逻辑
PR 摘要
新增
ChassisClimberController,实现爬梯机构的前后电机控制、自动爬梯状态机、手动支撑控制及前爬梯功率限幅。主要变更
ALIGN、APPROACH、SUPPORT_DEPLOY、DASH、SUPPORT_RETRACT。