Skip to content

[WIP] Fix target position to navigate to arena center#2

Merged
Logic-TARS merged 1 commit intomainfrom
copilot/fix-navigation-target-positions
Feb 11, 2026
Merged

[WIP] Fix target position to navigate to arena center#2
Logic-TARS merged 1 commit intomainfrom
copilot/fix-navigation-target-positions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 11, 2026

Fix VBot Navigation Target Position to Use Three-Stage Navigation

Problem

Current implementation sets target positions as random offsets from robot initial position, causing robots to navigate to random locations instead of the arena trigger points.

Solution Plan

  • 1. Update cfg.py to define target_point_a and target_point_b
  • 2. Modify reset() method in vbot_section001_np.py to set targets based on dog_stage
  • 3. Add logic to update targets when stage changes in update_state() method
  • 4. Test the changes to ensure three-stage navigation works correctly

Key Changes

  1. Stage 0 → 1: Target = [0.0, 1.5] (inner circle trigger point A) +1 point
  2. Stage 1 → 2: Target = [0.0, 0.0] (center trigger point B) +1 point
  3. Removed random offset target generation and now use fixed stage-based targets

Changes Made

  • Added target_point_a and target_point_b to VBotSection001EnvCfg in cfg.py
  • Modified reset() method to initialize all dogs to stage 0 with target = target_point_a
  • Added dynamic target update logic in update_state() that changes targets based on dog_stage
  • Targets now automatically switch from inner circle to center when dogs reach trigger points
Original prompt

问题描述

VBot 导航竞技场中,导航终点目标位置设定不正确,导致机器狗没有导航到圆心。

根本原因 ❌

reset() 方法中,目标位置是相对于机器狗初始位置的随机偏移

# 当前代码(错误)
cmd_range = cfg.commands.pose_command_range  # [-5.0, -5.0, -3.14, 5.0, 5.0, 3.14]
target_positions = robot_init_pos[:, :2] + sampled[:, :2]  # 相对初始位置的偏移

这导致:

  • 机器狗初始位置:外圈随机(3.0m)
  • 目标位置:初始位置 + 随机偏移(-5.0~5.0)
  • 问题:目标不在圆心,位置完全随机!

要求 ✅

根据题目规范,竞技场导航应该有三阶段目标

阶段0 → 1: 外圈 → 内圈 (触发点A: [0.0, 1.5])   +1分
阶段1 → 2: 内圈 → 圆心 (触发点B: [0.0, 0.0])   +1分

修复内容

  1. 在 cfg.py 中定义竞技场参数(如果未定义):

    @dataclass
    class VBotSection001EnvCfg:
        # 竞技场参数
        arena_center: list = field(default_factory=lambda: [0.0, 0.0])
        arena_outer_radius: float = 3.0
        arena_inner_radius: float = 1.5
        boundary_radius: float = 3.5
        target_point_a: list = field(default_factory=lambda: [0.0, 1.5])  # 内圈
        target_point_b: list = field(default_factory=lambda: [0.0, 0.0])  # 圆心
  2. 修改 vbot_section001_np.py 的 reset() 方法

    • 将目标位置生成从"相对初始位置的偏移"改为"固定的竞技场触发点"
    • 初始阶段:目标为 target_point_a(内圈)
    • 当机器狗到达 target_point_a 后,目标切换为 target_point_b(圆心)
  3. 实现三阶段导航逻辑

    # 根据当前阶段设置目标位置
    if dog_stage[i] == 0:  # 未到达内圈
        target = target_point_a  # [0.0, 1.5]
    elif dog_stage[i] == 1:  # 已到达内圈,前往圆心
        target = target_point_b  # [0.0, 0.0]

关键文件

  • motrix_envs/src/motrix_envs/navigation/vbot/cfg.py - 配置参数
  • motrix_envs/src/motrix_envs/navigation/vbot/vbot_section001_np.py - 目标位置生成和阶段管理

参考文档

  • ACCEPTANCE_CHECKLIST.md - 竞技场参数规范
  • ENVIRONMENT_COMPARISON.md - 三阶段目标定义
  • USAGE_GUIDE.md - 任务流程说明

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Logic-TARS Logic-TARS marked this pull request as ready for review February 11, 2026 11:48
@Logic-TARS Logic-TARS merged commit 1c0b946 into main Feb 11, 2026
1 check failed
Copilot AI requested a review from Logic-TARS February 11, 2026 11:49
Copilot stopped work on behalf of Logic-TARS due to an error February 11, 2026 11:49
Logic-TARS added a commit that referenced this pull request Mar 4, 2026
P0: 出生位置从Y=5.83移至Y=7.83(2026平台中心), 随机范围收窄确保Y∈[6.83,8.83]
P1: 新增竞赛里程碑(波浪+10,路线选择+5,吊桥+10/河床+5,终点下楼+5)
P1: 基于X坐标区分吊桥(X<-1)和河床(X>0)路线
P1: 拜年红包分值修正: #1(桥面)=0(含在吊桥路线), #2(桥底)=+5
P1: scene_section012.xml添加7个视觉标记球(2拜年红+5贺礼金)
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