Skip to content

wip: add dynamic yaw limits to auto aim and remove unused package fro… - #66

Merged
creeper5820 merged 1 commit into
mainfrom
feat/dynamic-yaw-limits
Jul 3, 2026
Merged

creeper5820 merged 1 commit into
mainfrom
feat/dynamic-yaw-limits

Conversation

@creeper5820

@creeper5820 creeper5820 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

…m cmake

本次修改为自瞄链路加入了动态 yaw 限制,并同步调整了火控接口与配置:

  • 新增 /auto_aim/yaw_velocity 输入,AutoAimComponent 会根据 yaw 角速度估算并传递 max_yaw_velmax_yaw_acc
  • AutoAim::Context 增加 yaw 相关动态约束字段,主循环与弹道/开火控制流程改为使用这些运行时限制。
  • FireControllerV2 重构为通过 State 结构传入时间、姿态和动态约束,update 接口随之调整。
  • 配置与测试构建中移除了不再使用的 max_accmax_vel 以及 TinyMPC 相关 CMake 拉取逻辑。
  • README 补充了新的自瞄输入说明及极限射击窗口估计相关内容。

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f48aa1fc-48b6-42d1-b178-5e56655c0bb3

📥 Commits

Reviewing files that changed from the base of the PR and between 02a130b and b30c45e.

📒 Files selected for processing (8)
  • README.md
  • config/config.yaml
  • src/component.cpp
  • src/kernel/auto_aim.cpp
  • src/kernel/auto_aim.hpp
  • src/kernel/fire_control.cpp
  • src/kernel/fire_control.hpp
  • test/CMakeLists.txt
💤 Files with no reviewable changes (2)
  • test/CMakeLists.txt
  • config/config.yaml

Walkthrough

本次改动新增 /auto_aim/yaw_velocity 输入,用于在运行时估计 max_yaw_vel/max_yaw_acc 并通过 AutoAim::Context 传递;FireControllerV2::update 接口由离散参数改为统一 State 结构体,攻击窗口与瞄准计算相应使用动态限值;同时移除了 config.yaml 中的静态 max_vel/max_acc 配置以及测试构建中 TinyMPC 的 FetchContent 逻辑。

Changes

动态 yaw 速度/加速度约束

Layer / File(s) Summary
组件层新增 yaw_velocity 输入与限值计算
src/component.cpp, README.md
新增 /auto_aim/yaw_velocity 输入接口,跟踪历史速度与时间戳,通过差分估计加速度,得到的最大速度/加速度写入上下文,并在 README 补充说明。
AutoAim 上下文与主循环使用限值
src/kernel/auto_aim.hpp, src/kernel/auto_aim.cpp
Context 新增 max_yaw_vel(10.0)/max_yaw_acc(200.0)默认值,Command 初始化写法微调;主循环从当前上下文读取覆盖这两个值并纳入日志输出。
FireControllerV2 接口改为 State 并使用动态限值
src/kernel/fire_control.hpp, src/kernel/fire_control.cpp, src/kernel/auto_aim.cpp
update 接口由 (Timestamp, yaw, pitch) 改为单一 State(含 timestamp/yaw/pitch/max_yaw_vel/max_yaw_acc);内部缓存字段合并为 state,攻击窗口计算与瞄准评估改用 state.max_yaw_vel/max_yaw_accstate.yaw/pitch;主循环调用方式相应更新。
配置与构建清理
config/config.yaml, test/CMakeLists.txt
移除 fire_control 下静态的 max_acc/max_vel 配置项;移除测试构建中 TinyMPC 的 FetchContent 拉取逻辑及相关编译选项。

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Gimbal
  participant AutoAimComponent
  participant AutoAimContext as AutoAim::Context
  participant AutoAimLoop as AutoAim主循环
  participant FireControllerV2

  Gimbal->>AutoAimComponent: yaw_velocity(rad/s)
  AutoAimComponent->>AutoAimComponent: 差分估算max_yaw_acc/max_yaw_vel
  AutoAimComponent->>AutoAimContext: ctx.max_yaw_vel / ctx.max_yaw_acc
  AutoAimLoop->>AutoAimContext: 读取max_yaw_vel/max_yaw_acc
  AutoAimLoop->>FireControllerV2: update(State{timestamp,yaw,pitch,max_yaw_vel,max_yaw_acc})
  FireControllerV2->>FireControllerV2: get_attack_window()使用动态限值
Loading

Possibly related PRs

Suggested reviewers: heyeuu

Poem

兔耳竖起测风向,
云台转速心中量,
最大加速最大航,
一键传入State箱,
攻击窗口更明朗,
蹦跳庆祝新战场!🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了动态 yaw 限制和移除未使用 CMake 依赖这两个主要改动。
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.
✨ 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 feat/dynamic-yaw-limits

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.

@creeper5820
creeper5820 merged commit 2a80130 into main Jul 3, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in RMCS Auto Aim V2 Jul 3, 2026
@creeper5820
creeper5820 deleted the feat/dynamic-yaw-limits branch July 3, 2026 08:45
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.

1 participant