Skip to content

Dev/zlq 7 27 - #20

Merged
creeper5820 merged 4 commits into
mainfrom
dev/zlq-7-27
Jul 28, 2026
Merged

Dev/zlq 7 27#20
creeper5820 merged 4 commits into
mainfrom
dev/zlq-7-27

Conversation

@zlq04222

@zlq04222 zlq04222 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

摘要

  • 重构云台航向偏置与世界坐标到云台坐标的转换逻辑,新增航向采样计数及延迟攀爬方向处理。
  • 新增敌方据点、基地血量数据的上下文与 Lua 黑板字段。
  • 增加超级电容助推控制及哨兵事件上报、统计机制。
  • 扩展机器人状态监测,根据血量、攀爬方向和自动瞄准状态触发姿态切换事件。
  • 调整训练流程中的超级电容控制、导航重启等待逻辑及训练地图关键航点坐标。
  • 增加测试端点对导航重启和双方血量信息的监测输出。

@zlq04222
zlq04222 requested a review from creeper5820 July 28, 2026 07:58
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

本次变更扩展导航的偏航转换、攀爬控制、超级电容控制和哨兵事件输出,并在 Lua 黑板与状态任务中加入敌方血量和姿态事件处理,同时调整训练地图航点及流程时序。

Changes

导航与机器人状态控制

Layer / File(s) Summary
云台偏航状态与坐标转换
src/cxx/controller/motion.*, src/cxx/context.*
MotionFsm 新增偏航采样与云台偏置状态,重命名世界到云台坐标转换接口;上下文注册敌方据点和基地血量输入。
导航 Lua 接口与输出状态
src/cxx/component.cc, src/lua/action.lua, src/lua/api.lua
新增超级电容和哨兵事件接口,延迟转换攀爬世界偏航,并注册对应导航输出。
血量黑板与姿态事件上报
src/lua/blackboard.lua, src/lua/task/robot_status.lua, src/lua/endpoint/test.lua
黑板新增血量、临界阈值和 power_move 状态;状态任务根据运行条件选择姿态并发送变化事件,测试端点增加重启后血量日志任务。
训练流程与超级电容控制
src/lua/endpoint/train.lua, src/lua/map/train.lua
训练流程关闭或延迟超级电容控制,调整多个航点,并在横跨步骤前后切换超级电容状态。

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

Possibly related PRs

Suggested reviewers: creeper5820

Poem

小兔挥耳朵,导航换新装,
云台偏航稳稳量。
攀爬、哨兵报声响,
超电助力越过墙。
血量黑板记得忙,
训练路线向前闯!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive 标题仅包含分支/日期信息,无法体现本次改动的核心内容。 请改为一句简短且具体的标题,直接概括主要变更,例如新增的导航、哨兵事件或攀爬状态相关功能。
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.
✨ 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 dev/zlq-7-27

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: 1

🤖 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 `@src/lua/task/robot_status.lua`:
- Around line 33-37: 更新攀爬状态判断中的 climbing 表达式,使其覆盖 -1 与 1 之间除 0 外的双向中间状态:使用非零且大于
-1、小于 1 的条件。保留 power_defense 和 defense 对 climbing 结果的现有使用方式。
🪄 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 Plus

Run ID: 1cbe11e2-55f8-4594-a7d7-0db253f27a24

📥 Commits

Reviewing files that changed from the base of the PR and between 2877c2c and 2a1d677.

📒 Files selected for processing (12)
  • src/cxx/component.cc
  • src/cxx/context.cc
  • src/cxx/context.hh
  • src/cxx/controller/motion.cc
  • src/cxx/controller/motion.hh
  • src/lua/action.lua
  • src/lua/api.lua
  • src/lua/blackboard.lua
  • src/lua/endpoint/test.lua
  • src/lua/endpoint/train.lua
  • src/lua/map/train.lua
  • src/lua/task/robot_status.lua

Comment on lines +33 to +37
local s = api.get_climb_status()
local climbing = s > 0 and s < 1

local power_defense = hp < blackboard.rule.health_critical or (climbing and action.climb.up)
local defense = hp < blackboard.rule.health_limit or (climbing and not action.climb.up)

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/bash
rg -n 'climber_status|climb.*status' -C4 --type=cpp
rg -n 'get_climb_status' -C4

Repository: Alliance-Algorithm/rmcs-navigation

Length of output: 203


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== git files matching robot_status.lua/action.lua =="
git ls-files | rg '(^|/)robot_status\.lua$|(^|/)action\.lua$|climb|robot' || true

echo
echo "== locate relevant files =="
fd -a 'robot_status\.lua$|action\.lua$' . 2>/dev/null || find . -type f \( -name 'robot_status.lua' -o -name 'action.lua' \) -print

echo
echo "== search all files for climbing/action.climb status =="
rg -n 'climbing|climb|blocking_cross_step|get_climb_status|climber_status|crawling|SentryEvent|robot_status|action\.climb|last_posture|kPoseEvent' . -C 3 || true

Repository: Alliance-Algorithm/rmcs-navigation

Length of output: 17513


将攀爬进行中判断覆盖负值区间。

blocking_cross_step()status == 1.0status == -1.0 时才结束,说明 get_climb_status() 的中间值范围是 (-1, 1),当前 (0, 1) 的判断会漏掉 action.climb.up == false 对应的负方向攀爬;此时即使暴露也不满足 defense = ... or (climbing and not action.climb.up)。把 climbing 改为 s ~= 0 and s > -1 and s < 1 即可匹配现有的双向完成语义。

🤖 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 `@src/lua/task/robot_status.lua` around lines 33 - 37, 更新攀爬状态判断中的 climbing
表达式,使其覆盖 -1 与 1 之间除 0 外的双向中间状态:使用非零且大于 -1、小于 1 的条件。保留 power_defense 和 defense 对
climbing 结果的现有使用方式。

@creeper5820
creeper5820 merged commit 2a1d677 into main Jul 28, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants