Skip to content

Fix VBot navigation to use unified target positions for arena scoring#3

Merged
Logic-TARS merged 4 commits intomainfrom
copilot/fix-navigation-targets
Feb 11, 2026
Merged

Fix VBot navigation to use unified target positions for arena scoring#3
Logic-TARS merged 4 commits intomainfrom
copilot/fix-navigation-targets

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 11, 2026

VBot arena navigation was generating per-robot random targets (robot_init_pos + random_offset), making unified scoring impossible. All robots now navigate to the same fixed target.

Changes

Configuration (cfg.py)

  • Added target_point_a = [0.0, 1.5] (inner circle trigger)
  • Added target_point_b = [0.0, 0.0] (center, for future multi-stage)

Reset logic (vbot_section001_np.py)

# Before: each robot gets different target
target_positions = robot_init_pos[:, :2] + sampled[:, :2]

# After: all robots get unified target
target_point_a = np.array(cfg.target_point_a, dtype=np.float32)
target_positions = np.tile(target_point_a + arena_center, (num_envs, 1))

Target heading remains randomized for training diversity. Backward compatible with hasattr() checks.

Original prompt

问题描述

VBot 竞技场导航任务中,导航目标位置设定不正确,导致机器狗无法正确导航到圆心。

现状 ❌

  • 目标位置计算: target_positions = robot_init_pos[:, :2] + sampled[:, :2]
  • 问题: 目标位置 = 初始位置 + 随机偏移 [-5.0~5.0m]
  • 结果: 每只狗的目标位置都不同,且不在圆心,无法统一计分
  • 表现: 机器狗导航方向随机,无法完成"外圈→内圈→圆心"的三阶段任务

要求 ✅

根据题目和竞技场规范:

  • 所有机器狗应该有统一的、固定的导航目标
  • 阶段1: 从外圈 → 导航到内圈触发点 (0.0, 1.5)
  • 阶段2: 从内圈 → 导航到圆心 (0.0, 0.0)
  • 最终目标必须是圆心 (0.0, 0.0)

修复范围

  1. cfg.py: 添加竞技场导航参数配置
  2. vbot_section001_np.py - reset(): 修改目标位置生成逻辑,使用固定的触发点而非随机偏移
  3. vbot_section001_np.py - step(): 实现三阶段导航逻辑(如果需要)

技术细节

需要添加到 cfg.py

# 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])   # 内圈触发点(+1分)
target_point_b: list = field(default_factory=lambda: [0.0, 0.0])   # 圆心(+1分)

需要修改的代码(reset 方法)

当前代码位置: motrix_envs/src/motrix_envs/navigation/vbot/vbot_section001_np.py 第 795-815 行

当前逻辑:

cmd_range = cfg.commands.pose_command_range
if len(cmd_range) != 6:
    raise ValueError("commands.pose_command_range must have 6 values...")
    
dx_min, dy_min, yaw_min, dx_max, dy_max, yaw_max = cmd_range
sampled = np.random.uniform(
    low=np.array([dx_min, dy_min, yaw_min], dtype=np.float32),
    high=np.array([dx_max, dy_max, yaw_max], dtype=np.float32),
    size=(num_envs, 3),
)
target_positions = robot_init_pos[:, :2] + sampled[:, :2]  # ❌ 错误
target_headings = sampled[:, 2:3]
pose_commands = np.concatenate([target_positions, target_headings], axis=1)

正确逻辑:

# 竞技场模式:固定目标为内圈触发点 A
target_point_a = np.array(cfg.target_point_a if hasattr(cfg, 'target_point_a') else [0.0, 1.5], dtype=np.float32)
arena_center = np.array(cfg.arena_center if hasattr(cfg, 'arena_center') else [0.0, 0.0], dtype=np.float32)

# 所有机器狗的目标统一为内圈触发点 A
target_positions = np.tile(target_point_a + arena_center, (num_envs, 1))

# 朝向仍然随机(或也可以固定为 0)
if hasattr(cfg.commands, 'pose_command_range') and len(cfg.commands.pose_command_range) == 6:
    yaw_min, yaw_max = cfg.commands.pose_command_range[2], cfg.commands.pose_command_range[5]
    target_headings = np.random.uniform(yaw_min, yaw_max, size=(num_envs, 1))
else:
    target_headings = np.zeros((num_envs, 1), dtype=np.float32)

pose_commands = np.concatenate([target_positions, target_headings], axis=1)

验证标准

  • 初始化后所有机器狗的目标位置相同,都在 (0.0, 1.5) 或圆心 (0.0, 0.0)
  • 目标位置在可视化中正确显示(绿色标记应该在同一位置)
  • 机器狗能够导航向目标点
  • 到达触发点时计分系统能正常工作

This pull request was created from Copilot chat.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits February 11, 2026 11:58
- Add target_point_a (0.0, 1.5) and target_point_b (0.0, 0.0) to VBotSection001EnvCfg
- Modify reset() to use fixed unified target positions instead of random offsets
- All robots now navigate to the same target point (inner circle trigger point)

Co-authored-by: Logic-TARS <99871356+Logic-TARS@users.noreply.github.com>
Co-authored-by: Logic-TARS <99871356+Logic-TARS@users.noreply.github.com>
Co-authored-by: Logic-TARS <99871356+Logic-TARS@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix navigation target position for VBot arena Fix VBot navigation to use unified target positions for arena scoring Feb 11, 2026
Copilot AI requested a review from Logic-TARS February 11, 2026 12:04
@Logic-TARS Logic-TARS marked this pull request as ready for review February 11, 2026 12:07
@Logic-TARS Logic-TARS merged commit 1a3ac34 into main Feb 11, 2026
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