Skip to content

feat(map): MapTrackerMove引入积极转向策略和自适应转速#1039

Merged
isHarryh merged 6 commits intoMaaEnd:mainfrom
isHarryh:main
Mar 6, 2026
Merged

feat(map): MapTrackerMove引入积极转向策略和自适应转速#1039
isHarryh merged 6 commits intoMaaEnd:mainfrom
isHarryh:main

Conversation

@isHarryh
Copy link
Member

@isHarryh isHarryh commented Mar 6, 2026

概要

此 PR 向 MapTrackerMove 节点引入了积极转向策略和自适应转速调整特性。

此外,移除了该节点的两个高级可选参数,但未对现有 pipeline 造成影响。

由 Sourcery 提供的总结

在简化旋转配置参数的同时,为 MapTrackerMove 引入自适应旋转控制以及更激进的方向校正。

新功能:

  • 增加自适应旋转速度机制,可根据最近的移动和方向变化学习合适的相机旋转速度。
  • 优化旋转调整行为,区分严重与轻度的方向偏差,并据此选择合适的移动模式。
  • 使推断旋转步骤动态依赖精度,并支持可配置的上下限。

增强改进:

  • 改进导航日志记录,为调试提供更丰富的位置和旋转上下文信息。
  • 引入辅助常量和实用工具,用于基于当前增量与速度计算增强的旋转调整。
  • 从 MapTrackerMove 的参数和默认值中移除 rotation_speedrotation_timeout,在简化配置的同时保留现有流水线行为。

文档:

  • 更新中英文开发者文档,从 MapTrackerMove 中移除已废弃的 rotation_speedrotation_timeout 参数。
Original summary in English

Summary by Sourcery

Introduce adaptive rotation control and more aggressive orientation correction in MapTrackerMove while simplifying rotation configuration parameters.

New Features:

  • Add an adaptive rotation speed mechanism that learns appropriate camera rotation speed from recent movement and orientation changes.
  • Refine rotation adjustment behavior to distinguish between severe and moderate misalignment, choosing appropriate movement modes accordingly.
  • Make infer rotation step dynamically depend on precision with configurable bounds.

Enhancements:

  • Improve navigation logging with richer position and rotation context for debugging.
  • Introduce helper constants and a utility for computing augmented rotation adjustments based on current delta and speed.
  • Remove rotation_speed and rotation_timeout from MapTrackerMove parameters and defaults to simplify configuration while preserving existing pipeline behavior.

Documentation:

  • Update Chinese and English developer documentation to remove the deprecated rotation_speed and rotation_timeout parameters from MapTrackerMove.

Copilot AI review requested due to automatic review settings March 6, 2026 08:24
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - 我在这里给出了一些高层次的反馈:

  • 在自适应旋转模块中,建议当 |actualRotDelta| 低于一个较小阈值时直接跳过更新,而不是只依赖 1e-6 的 epsilon,这样可以避免在接近零旋转时产生非常大的 idealSpeed 值,使整体逻辑更健壮。
  • 用于更新 rotationSpeed 的权重常数 0.6180.382 如果提取为具名常量(例如 ROTATION_SPEED_DECAYROTATION_SPEED_LEARN_RATE),会更方便理解和调参。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- 在自适应旋转模块中,建议当 |actualRotDelta| 低于一个较小阈值时直接跳过更新,而不是只依赖 1e-6 的 epsilon,这样可以避免在接近零旋转时产生非常大的 `idealSpeed` 值,使整体逻辑更健壮。
- 用于更新 `rotationSpeed` 的权重常数 `0.618``0.382` 如果提取为具名常量(例如 `ROTATION_SPEED_DECAY``ROTATION_SPEED_LEARN_RATE`),会更方便理解和调参。

Sourcery 对开源项目是免费的——如果你觉得我们的代码评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English

Hey - I've left some high level feedback:

  • In the adaptive rotation block, consider skipping the update when |actualRotDelta| is below a small threshold instead of relying only on the 1e-6 epsilon, to avoid very large idealSpeed values from near-zero rotations and make the logic more robust.
  • The weighting constants 0.618 and 0.382 used for updating rotationSpeed would be easier to reason about and tune if extracted into named constants (e.g., ROTATION_SPEED_DECAY, ROTATION_SPEED_LEARN_RATE).
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the adaptive rotation block, consider skipping the update when |actualRotDelta| is below a small threshold instead of relying only on the 1e-6 epsilon, to avoid very large `idealSpeed` values from near-zero rotations and make the logic more robust.
- The weighting constants `0.618` and `0.382` used for updating `rotationSpeed` would be easier to reason about and tune if extracted into named constants (e.g., `ROTATION_SPEED_DECAY`, `ROTATION_SPEED_LEARN_RATE`).

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

此 PR 为 MapTrackerMove 动作引入“更积极的转向策略”与“自适应转速调整”,同时移除 rotation_speed / rotation_timeout 两个高级可选参数,并同步更新中英文开发文档;此外对 MapTrackerInferrotStep 计算做了更连续的自适应调整。

Changes:

  • MapTrackerMove:新增自适应转向速度状态与计算逻辑,并调整转向/移动策略(大偏差更保守、小偏差更积极)。
  • MapTrackerMove:移除 rotation_speedrotation_timeout 参数及其默认值/校验;文档同步删除对应说明。
  • MapTrackerInfer:将 rotStep 从分段逻辑改为基于 precision 的连续映射,并限制在区间内。

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/zh_cn/developers/map-tracker.md 删除 rotation_speed / rotation_timeout 参数说明(中文文档同步)
docs/en_us/developers/map-tracker.md 删除 rotation_speed / rotation_timeout 参数说明(英文文档同步)
agent/go-service/map-tracker/move.go 引入自适应转速与新的转向策略;移除旧参数及其校验;新增 calcAppliedDeltaRotation
agent/go-service/map-tracker/infer.go rotStep 计算改为连续映射并钳制范围
agent/go-service/map-tracker/const.go 增加旋转速度上下限与默认值常量;移除旧参数默认值

@isHarryh
Copy link
Member Author

isHarryh commented Mar 6, 2026

此 PR 未对任务节点造成影响,属于非破坏性的、可兼容的变更,将直接合并。

@isHarryh isHarryh merged commit 0befade into MaaEnd:main Mar 6, 2026
16 checks passed
MistEO pushed a commit that referenced this pull request Mar 9, 2026
## 概要

此 PR 向 MapTrackerMove 节点引入了积极转向策略和自适应转速调整特性。

此外,移除了该节点的两个高级可选参数,但未对现有 pipeline 造成影响。

## 由 Sourcery 提供的总结

在简化旋转配置参数的同时,为 MapTrackerMove 引入自适应旋转控制以及更激进的方向校正。

新功能:
- 增加自适应旋转速度机制,可根据最近的移动和方向变化学习合适的相机旋转速度。
- 优化旋转调整行为,区分严重与轻度的方向偏差,并据此选择合适的移动模式。
- 使推断旋转步骤动态依赖精度,并支持可配置的上下限。

增强改进:
- 改进导航日志记录,为调试提供更丰富的位置和旋转上下文信息。
- 引入辅助常量和实用工具,用于基于当前增量与速度计算增强的旋转调整。
- 从 MapTrackerMove 的参数和默认值中移除 `rotation_speed` 和
`rotation_timeout`,在简化配置的同时保留现有流水线行为。

文档:
- 更新中英文开发者文档,从 MapTrackerMove 中移除已废弃的 `rotation_speed` 和
`rotation_timeout` 参数。

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Introduce adaptive rotation control and more aggressive orientation
correction in MapTrackerMove while simplifying rotation configuration
parameters.

New Features:
- Add an adaptive rotation speed mechanism that learns appropriate
camera rotation speed from recent movement and orientation changes.
- Refine rotation adjustment behavior to distinguish between severe and
moderate misalignment, choosing appropriate movement modes accordingly.
- Make infer rotation step dynamically depend on precision with
configurable bounds.

Enhancements:
- Improve navigation logging with richer position and rotation context
for debugging.
- Introduce helper constants and a utility for computing augmented
rotation adjustments based on current delta and speed.
- Remove rotation_speed and rotation_timeout from MapTrackerMove
parameters and defaults to simplify configuration while preserving
existing pipeline behavior.

Documentation:
- Update Chinese and English developer documentation to remove the
deprecated rotation_speed and rotation_timeout parameters from
MapTrackerMove.

</details>
MistEO pushed a commit that referenced this pull request Mar 9, 2026
## 概要

此 PR 向 MapTrackerMove 节点引入了积极转向策略和自适应转速调整特性。

此外,移除了该节点的两个高级可选参数,但未对现有 pipeline 造成影响。

## 由 Sourcery 提供的总结

在简化旋转配置参数的同时,为 MapTrackerMove 引入自适应旋转控制以及更激进的方向校正。

新功能:
- 增加自适应旋转速度机制,可根据最近的移动和方向变化学习合适的相机旋转速度。
- 优化旋转调整行为,区分严重与轻度的方向偏差,并据此选择合适的移动模式。
- 使推断旋转步骤动态依赖精度,并支持可配置的上下限。

增强改进:
- 改进导航日志记录,为调试提供更丰富的位置和旋转上下文信息。
- 引入辅助常量和实用工具,用于基于当前增量与速度计算增强的旋转调整。
- 从 MapTrackerMove 的参数和默认值中移除 `rotation_speed` 和
`rotation_timeout`,在简化配置的同时保留现有流水线行为。

文档:
- 更新中英文开发者文档,从 MapTrackerMove 中移除已废弃的 `rotation_speed` 和
`rotation_timeout` 参数。

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Introduce adaptive rotation control and more aggressive orientation
correction in MapTrackerMove while simplifying rotation configuration
parameters.

New Features:
- Add an adaptive rotation speed mechanism that learns appropriate
camera rotation speed from recent movement and orientation changes.
- Refine rotation adjustment behavior to distinguish between severe and
moderate misalignment, choosing appropriate movement modes accordingly.
- Make infer rotation step dynamically depend on precision with
configurable bounds.

Enhancements:
- Improve navigation logging with richer position and rotation context
for debugging.
- Introduce helper constants and a utility for computing augmented
rotation adjustments based on current delta and speed.
- Remove rotation_speed and rotation_timeout from MapTrackerMove
parameters and defaults to simplify configuration while preserving
existing pipeline behavior.

Documentation:
- Update Chinese and English developer documentation to remove the
deprecated rotation_speed and rotation_timeout parameters from
MapTrackerMove.

</details>
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