Skip to content

fix(armor): correct armor count in EKFParameters#35

Merged
creeper5820 merged 1 commit intomainfrom
fix/armor-count-refinement
Mar 21, 2026
Merged

fix(armor): correct armor count in EKFParameters#35
creeper5820 merged 1 commit intomainfrom
fix/armor-count-refinement

Conversation

@heyeuu
Copy link
Copy Markdown
Member

@heyeuu heyeuu commented Mar 20, 2026

修正装甲板数目的逻辑,移除平衡步兵

修复装甲板数目逻辑

本 PR 修正了 EKFParameters::armor_num() 方法中的装甲板计数逻辑。

主要改动

src/module/predictor/ekf_parameter.hpp 文件中,简化了 armor_num(DeviceId const&) 方法的实现:

  • 移除了对"平衡步兵"的特殊处理:之前存在一个条件分支,当检测到"平衡步兵"设备类型时会返回装甲板数为 2,现已删除此逻辑
  • 删除了本地变量 is_balance 及其关联的条件判断分支
  • 统一了非哨兵/非基地设备的装甲板数:所有不是 OUTPOSTBASE 的设备现在都统一返回装甲板数为 4

当前实现

static auto armor_num(DeviceId const& device) -> int {
    auto num = int {};
    if (device == DeviceId::OUTPOST || device == DeviceId::BASE) num = 3;
    else num = 4;
    return num;
}

装甲板计数规则现为:

  • 哨兵 (OUTPOST):3 块
  • 基地 (BASE):3 块
  • 其他设备:4 块

影响范围

代码改动仅涉及 EKF 参数配置文件,未有公共接口签名变化。

@heyeuu heyeuu self-assigned this Mar 20, 2026
@heyeuu heyeuu added the bug Something isn't working label Mar 20, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 20, 2026

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: 4f51a9a9-0f01-42d7-baf2-da670f6fa541

📥 Commits

Reviewing files that changed from the base of the PR and between 469a046 and 70f8181.

📒 Files selected for processing (1)
  • src/module/predictor/ekf_parameter.hpp
💤 Files with no reviewable changes (1)
  • src/module/predictor/ekf_parameter.hpp

漫步

移除了 EKFParameters::armor_num() 函数中针对步兵单位的条件分支,统一将非哨兵和非基地的设备装甲数直接设为默认值 4,删除了 is_balance 局部变量及其相关逻辑。

变更

组队/文件 概述
装甲数参数简化
src/module/predictor/ekf_parameter.hpp
移除了 armor_num() 函数中设备类型条件判断,删除了针对步兵的特殊装甲数赋值(原为 2)以及 is_balance 变量逻辑,改为对所有非特殊设备统一应用默认装甲数 4。

代码审查工作量估计

🎯 1 (微小) | ⏱️ ~3 分钟

🐰 装甲数归整齐,条件分支一扫去,
步兵皆同四套甲,逻辑简洁又通透,
删行三两显风采!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确反映了PR的主要改动:修正EKFParameters中的装甲板数目逻辑。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix/armor-count-refinement
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

Tip

You can disable poems in the walkthrough.

Disable the reviews.poem setting to disable the poems in the walkthrough.

@heyeuu heyeuu requested a review from creeper5820 March 20, 2026 08:10
@heyeuu heyeuu linked an issue Mar 20, 2026 that may be closed by this pull request
@creeper5820 creeper5820 merged commit 2e54dc6 into main Mar 21, 2026
2 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in RMCS Auto Aim V2 Mar 21, 2026
@creeper5820 creeper5820 deleted the fix/armor-count-refinement branch March 21, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

装甲板数量的判断逻辑的优化

2 participants