TL;DR
在保持 Microduck 步行策略固定的同时,为其添加局部避障功能。利用可复用的 SimReady 资产构建多样化的课程场景,使用 Newton 光线投射器模拟飞行时间(ToF)传感器,并在 Isaac Lab 中训练控制器以调整绕开障碍物的游戏手柄速度指令。本教程涵盖仿真训练、评估、导出以及真机部署。
引言
步行策略可以让 Microduck 保持平衡,但它并未告诉机器人如何绕过路径中的障碍物。在本工作流中,我们复用第一篇 Microduck 教程中的步行策略,并保持其权重固定。这篇后续文章使用飞行时间(ToF)传感技术训练一个独立的避障控制器。你通过游戏手柄选择方向;控制器在将速度指令传递给步行策略之前对其进行调整。
NVIDIA Isaac Lab 是一个开源框架,用于在数千个 GPU 并行仿真中训练策略,它提供了机器人学习环境。Newton 模拟物理和传感器的深度测量数据。我们将介绍控制架构,在多样的障碍物布局上进行训练,评估生成的策略,并为硬件测试准备接口。
对于仿真和训练,请准备:
配备兼容 NVIDIA GPU 和驱动程序的 Linux 系统。请参阅 Isaac Lab 安装指南以获取平台要求。
Git(含 Git LFS)以及 uv 包管理器。
对于真机测试,请准备:
配置好的 Microduck。加载导航任务所使用的相同反向间隙步行策略导出文件。
支持ToF的传感器及其已记录的配置。
配对的游戏手柄以及带有障碍物的平坦测试区域。
快速安装
如果尚未安装 uv,请先安装它。然后克隆 Isaac Lab 仓库的 exp/microduck 分支并安装其依赖项:
git lfs install
git clone --branch exp/microduck https://github.com/isaac-sim/IsaacLab.git
cd IsaacLab
uv sync --frozen
设置完成后,列出可用的 Microduck 环境和预设:
uv run isaaclab list_envs --keyword MicroDuck --show_presets
下载步行策略
在训练之前,先下载并导出上游的反向间隙(backlash)步行检查点。避障任务会自动加载导出的步行策略。
uv run isaaclab play \
--task IsaacContrib-Velocity-Rough-MicroDuck \
--rl_library rsl_rl --checkpoint pretrained \
--num_envs 1 --visualizer none \
--video newton_gl --video_length 1 \
presets=backlash
该环境结合了简单图元与通过 Hugging Face 上的 SimReady Central 提供的 OpenUSD 资产。我们使用纸板箱、办公垃圾桶和床头柜,并搭配锥形筒。从 IsaacLab 仓库根目录下载固定版本的 box、bin 和 cabinet 包到 assets/simready。
uvx --from huggingface-hub hf download nvidia/simready-assets \
--repo-type dataset \
--revision 9d4556bfe80868c1d27a7a7ba1c2774e63e8cedd \
--include "box_cardboard_a01/" \
--include "trashCan_office_black_a03/" \
--include "table_bedside_b01/*" \
--local-dir ./assets/simready
在每个回合重置时,环境代码会自动采样布局、打乱道具并改变其位置和旋转角度。大多数课程将障碍物散布在鸭子前方,同时混合了少量清晰路径、屏障和通道。代码还会镜像布局并混合对齐与交错排列的行。
目标点位于鸭子前方。移动指令引导它朝向目标,而策略会调整这些指令以绕过障碍物。
图 1. 使用 SimReady 资产和简单几何体构建的多样化障碍课程布局。
IsaacContrib-ObstacleAvoidance-Flat-MicroDuck 任务将避障与平衡分离。导航策略使用飞行时间(ToF)传感以 50 Hz 的频率调整前进、横向和偏航指令。冻结的行走策略随后将这些指令转换为关节动作,使机器人能够在不重新训练其行走行为的情况下学习避障。
在训练过程中,导航策略的执行器接收真实机器人上可用的 ToF 历史记录以及身体和控制器的状态。其评论家可以访问额外的仿真状态以指导学习,但在部署时不需要使用。
奖励机制鼓励向目标前进、安全到达以及围绕障碍物移动。只有在机器人以足够的间隙取得进展时,执行移动指令才能获得积分;冒险的接近方式会减少该积分。惩罚机制抑制快速接近、指令突变、碰撞和跌倒。
避障任务位于 isaaclab_tasks.contrib.microduck_obstacle 中。其配置文件为 obstacle_avoidance_env_cfg.py,ToF 传感位于 sensors.py 中,动作、指令、观测值和奖励则组织在 mdp/ 目录下。
对 ToF 传感器进行建模
MicroDuckToFCamera 扩展了 Newton 的 LegacyMultiMeshRayCasterCamera,用于模拟 VL53L5CX——microduck 上的一种紧凑型飞行时间(ToF)传感器,它以 15 Hz 的频率在 8×8 网格上测量距离。仿真传感器的视场角为 45°,量程为 0.12–4 米。它跟随鸭子的头部移动,其安装位置与真实鸭子上的传感器相似。
真实的录制数据影响了仿真中的传感器放置和地面读数。训练过程加入了噪声、延迟和缺失的测量值——包括网格边缘附近的数据——以使策略能够适应不完美的数据。以下代码片段展示了已包含在任务配置中的选定传感器设置。您无需单独编辑或运行此代码。
head_tof = MicroDuckToFCameraCfg(
prim_path=MICRODUCK_HEAD_BODY_PATH,
update_period= 1.0 / 15.0 ,
pattern_cfg=patterns.PinholeCameraPatternCfg(
focal_length= 1.0 , width= 8 , height= 8 ,
horizontal_aperture=_TOF_APERTURE,
vertical_aperture=_TOF_APERTURE,
),
randomization=ToFRandomizationCfg(
mount_pitch_degrees=(- 10.0 , 10.0 ),
mount_height_m=(- 0.02 , 0.02 ),
floor_validity_midpoint_offset_m=( 0.0 , 0.13 ),
near_floor_edge_impairment_probability= 0.5 ,
),
data_types=[ "distance_to_image_plane" , "distance_to_camera" ],
max_distance=TOF_MAX_RANGE,
depth_clipping_behavior= "zero" ,
)
使用 PPO 在 16,384 个并行环境中对导航策略进行训练,共进行 1,500 次训练迭代。其执行器、评论家、归一化器和优化器均从头开始初始化。任务配置加载了固定的行走检查点、机器人模型和障碍物资产。
此处显示的 16,384 个环境是可配置的,并非最低要求。降低 --num_envs 参数以适应您 GPU 的可用内存。随着并行收集经验的环境数量减少,达到相当的策略性能可能需要更多的训练迭代次数和更长的训练时间。我们还在 NVIDIA DGX Spark 上使用该策略进行了训练,使用 4,096 个并行环境进行了 3,000 次 PPO 更新,耗时约 6 小时,展示了同一工作流的小规模配置示例。
运行以下命令以训练策略:
uv run isaaclab train \
--task IsaacContrib-ObstacleAvoidance-Flat-MicroDuck \
--rl_library rsl_rl \
--num_envs 16384 \
--max_iterations 1500 \
--seed 42 \
--device cuda:0 \
--visualizer none \
presets=backlash
图 2. MicroDuck 并行避障仿真
回放使用与训练相同的属性、基元、冻结行走器和传感器随机化,但采用不同的种子以生成新的障碍物布局。
导航检查点保存在相对于仓库根目录的 logs/rsl_rl/microduck_obstacle_avoidance_tof_flat_backlash/
uv run --extra video isaaclab play \
--task IsaacContrib-ObstacleAvoidance-Flat-MicroDuck \
--rl_library rsl_rl \
--checkpoint /absolute/path/to/model.pt \
--num_envs 1 \
--seed 6173 \
--device cuda:0 \
--viz newton_gl \
--video newton_gl \
--video_length 1000 \
presets=backlash
回放会将 TorchScript 和 ONNX 模型保存在检查点的导出文件夹中。请将 ONNX 数据文件与模型保持在同一位置。
图 3. 带有请求运动、策略转向和 ToF 输入叠加的锥道评估。
这些部署工具在笔记本电脑上运行导航模型,并将调整后的游戏手柄命令发送给机器人上的行走策略。使用与导航训练期间相同的行走策略。
第 1 节将行走器的 ONNX 导出保存到相对于 Isaac Lab 仓库根目录的 .pretrained_checkpoints/rsl_rl/https/omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/6.2/Isaac/IsaacLab/PretrainedCheckpoints/rsl_rl/exported/policy.onnx 。
使用 Pollen 的策略加载指南加载该行走策略。部署 README 包含了传输步骤,包括如何打包使用外部数据文件的 ONNX 导出。
从您的 Isaac Lab 签出目录中,设置 SSH 访问并检查机器人直立静止时的推理:
cd scripts/deploy/microduck_tof_nav
ssh-copy-id microduck@ROBOT_HOST
uv run nav_pad.py --robot ROBOT_HOST \
--model /absolute/path/to/navigation/exported/policy.onnx \
--dry-run --seconds 30
Dry-run(干运行)会复制辅助工具并流式传输传感器数据,但不发送任何移动命令。观察当障碍物进入传感器视野时提出的命令。请将导航 ONNX 及其任何配套 .data 文件放在一起。
一旦这些检查通过,开始受监督的游戏手柄导航:
uv run nav_pad.py --robot ROBOT_HOST \
--model /absolute/path/to/navigation/exported/policy.onnx
向前推动摇杆以请求移动;策略会调整命令以避免障碍物。松开摇杆以停止,按 X 切换导航,并按 Ctrl-C 结束会话。默认情况下,前进速度限制为 0.15 m/s,并配有额外的近距障碍物制动和 stale-input(陈旧输入)停止机制。在空旷区域开始测试,并在测试路线前验证停止功能。
有关控制、日志和故障排除,请参阅部署 README。
图 4. Microduck 使用其 8×8 ToF 传感器绕过锥体,左侧为实时画面,右侧为基于其日志的 3D 重建。蓝色显示策略转向,紫色显示操作员干预。
Microduck 任务集合包括平坦和粗糙地形上的速度跟踪;站立恢复、坐立转换以及带跌倒恢复的行走(VelStand);踢球、拾取地面物体和前滚翻(Roulade)。轮滑任务增加了速度跟踪和 swizzle 运动、蹲伏滑行、斜坡下降、在轮子上站立以及旋转。
图 5. 15 个 Microduck 任务视图:平坦和粗糙地形行走、恢复、物体交互和轮滑动作。
构建您的下一个策略
从第一个 Microduck 教程开始,然后从 Microduck 任务集合中选择一个任务,以使用 Newton 在 Isaac Lab 中构建您的下一个策略。通过更改命令、奖励或环境来探索新行为——从粗糙地形行走到感知驱动的避障。在机器人上测试之前,先在训练集之外的场景中评估您的策略。
资源
致谢
该工作流程建立在Pollen Robotics的Microduck硬件和软件、最初的Microduck强化学习项目、BAM执行器建模工作,以及Isaac Lab和Newton集成之上。
TL;DR
Add local obstacle avoidance to Microduck while keeping its walking policy fixed. Build varied courses with reusable SimReady assets, model ToF sensing with Newton’s raycaster, and train a controller in Isaac Lab to adjust gamepad velocity commands around obstacles. This tutorial covers simulation training, evaluation, export, and real-robot deployment.
Introduction
A walking policy can keep Microduck balanced, but it does not tell the robot how to steer around an obstacle in its path. In this workflow, we reuse the walking policy from our first Microduck tutorial and keep its weights fixed. This follow-up trains a separate avoidance controller using time-of-flight (ToF) sensing. You choose a direction with a gamepad; the controller adjusts the velocity command before passing it to the walking policy.
NVIDIA Isaac Lab is an open-source framework for training policies across thousands of GPU-parallel simulations and it provides the robot-learning environment. Newton simulates physics and the sensor’s depth measurements. We will cover the control architecture, train on varied obstacle layouts, evaluate the resulting policies, and prepare the interface for hardware testing.
For simulation and training, prepare:
A Linux system with a compatible NVIDIA GPU and driver. See the Isaac Lab installation guide for platform requirements.
Git with Git LFS, and the uv package manager.
For physical-robot testing, prepare:
A configured Microduck. Load the same backlash walking-policy export used by the navigation task.
A supported ToF sensor with its configuration recorded.
A paired gamepad and a level test area with obstacles.
Quick install
Install uv if it is not already installed. Then clone the exp/microduck branch of the Isaac Lab repository and install its dependencies:
git lfs install
git clone --branch exp/microduck https://github.com/isaac-sim/IsaacLab.git
cd IsaacLab
uv sync --frozen
Once setup is complete, list the available Microduck environments and presets:
uv run isaaclab list_envs --keyword MicroDuck --show_presets
Download the walking policy
Download and export the upstream backlash walking checkpoint once before training. The obstacle avoidance task loads the exported walking policy automatically.
uv run isaaclab play \
--task IsaacContrib-Velocity-Rough-MicroDuck \
--rl_library rsl_rl --checkpoint pretrained \
--num_envs 1 --visualizer none \
--video newton_gl --video_length 1 \
presets=backlash
The environment combines simple primitives with OpenUSD assets available through SimReady Central on Hugging Face. We use a cardboard box , office bin , bedside cabinet alongside cones. From the IsaacLab repository root, download the pinned box, bin and cabinet packages into assets/simready.
uvx --from huggingface-hub hf download nvidia/simready-assets \
--repo-type dataset \
--revision 9d4556bfe80868c1d27a7a7ba1c2774e63e8cedd \
--include "box_cardboard_a01/" \
--include "trashCan_office_black_a03/" \
--include "table_bedside_b01/*" \
--local-dir ./assets/simready
At each episode reset, the environment code automatically samples a layout, shuffles the props, and varies their placement and rotation. Most courses scatter obstacles ahead of the duck, with a smaller mix of clear paths, barriers and passages. The code also mirrors layouts and mixes aligned and staggered rows.
Goals start ahead of the duck. Movement commands guide it toward the goal while the policy adjusts them around obstacles.
Figure 1. Varied obstacle-course layouts with SimReady assets and primitive geometry.
The IsaacContrib-ObstacleAvoidance-Flat-MicroDuck task separates obstacle avoidance from balance. A navigation policy uses ToF sensing to adjust forward, lateral, and yaw commands at 50 Hz. The frozen walking policy then converts those commands into joint actions, allowing the robot to learn obstacle avoidance without retraining its walking behavior.
During training, the navigation policy’s actor receives ToF history and body and controller state available on the real robot. Its critic has access to additional simulation state to guide learning, but is not needed for deployment.
Rewards encourage progress toward the goal, safe arrivals, and movement around obstacles. Following a movement command earns credit only when the robot makes progress with sufficient clearance; risky approaches reduce that credit. Penalties discourage fast approaches, abrupt command changes, collisions, and falls.
The obstacle-avoidance task lives in isaaclab_tasks.contrib.microduck_obstacle . Its configuration is in obstacle_avoidance_env_cfg.py , ToF sensing is in sensors.py , and actions, commands, observations and rewards are organized under mdp/ .
Model the ToF sensor
MicroDuckToFCamera extends Newton’s LegacyMultiMeshRayCasterCamera to model the VL53L5CX—a compact time-of-flight (ToF) sensor on the microduck that measures distance across an 8×8 grid at 15Hz. The simulated sensor has a 45° field of view and a 0.12–4 m range. It follows the duck’s head, with placement similar to the sensor on the real duck.
Real recordings informed the sensor placement and floor readings in simulation. Training adds noise, delays and missing measurements—including near the grid’s edges—to expose the policy to imperfect data. The excerpt below shows selected sensor settings already included in the task configuration. You do not need to edit or run this code separately.
head_tof = MicroDuckToFCameraCfg(
prim_path=MICRODUCK_HEAD_BODY_PATH,
update_period= 1.0 / 15.0 ,
pattern_cfg=patterns.PinholeCameraPatternCfg(
focal_length= 1.0 , width= 8 , height= 8 ,
horizontal_aperture=_TOF_APERTURE,
vertical_aperture=_TOF_APERTURE,
),
randomization=ToFRandomizationCfg(
mount_pitch_degrees=(- 10.0 , 10.0 ),
mount_height_m=(- 0.02 , 0.02 ),
floor_validity_midpoint_offset_m=( 0.0 , 0.13 ),
near_floor_edge_impairment_probability= 0.5 ,
),
data_types=[ "distance_to_image_plane" , "distance_to_camera" ],
max_distance=TOF_MAX_RANGE,
depth_clipping_behavior= "zero" ,
)
Train the navigation policy with PPO across 16,384 parallel environments for 1,500 training iterations. Its actor, critic, normalizers, and optimizer start fresh. The task configuration loads the fixed walking checkpoint, robot model, and obstacle assets.
The 16,384 environments shown here are configurable, not a minimum requirement. Lower --num_envs to fit your GPU’s available memory. With fewer environments collecting experience in parallel, reaching comparable policy performance may require more training iterations and longer training time. We also trained this policy on NVIDIA DGX Spark in approximately 6 hours using 4,096 parallel environments for 3,000 PPO updates, demonstrating a smaller-scale configuration for the same workflow.
Run this command to train the policy:
uv run isaaclab train \
--task IsaacContrib-ObstacleAvoidance-Flat-MicroDuck \
--rl_library rsl_rl \
--num_envs 16384 \
--max_iterations 1500 \
--seed 42 \
--device cuda:0 \
--visualizer none \
presets=backlash
Figure 2. Parallel MicroDuck obstacle-avoidance simulation
Playback uses the same props, primitives, frozen walker and sensor randomization as training, with a different seed for new obstacle arrangements.
Navigation checkpoints are saved under logs/rsl_rl/microduck_obstacle_avoidance_tof_flat_backlash/
uv run --extra video isaaclab play \
--task IsaacContrib-ObstacleAvoidance-Flat-MicroDuck \
--rl_library rsl_rl \
--checkpoint /absolute/path/to/model.pt \
--num_envs 1 \
--seed 6173 \
--device cuda:0 \
--viz newton_gl \
--video newton_gl \
--video_length 1000 \
presets=backlash
Playback saves TorchScript and ONNX models in the checkpoint’s exported folder. Keep the ONNX data file alongside the model.
Figure 3. Cone-course evaluation with requested motion, policy steering, and ToF input overlays.
These deployment tools run the navigation model on a laptop and send adjusted gamepad commands to the walking policy on the robot. Use the same walking policy that was used during navigation training.
Section 1 saves the walker’s ONNX export to .pretrained_checkpoints/rsl_rl/https/omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/6.2/Isaac/IsaacLab/PretrainedCheckpoints/rsl_rl/exported/policy.onnx , relative to the Isaac Lab repository root.
Load that walking policy using Pollen’s policy-loading guide . The deployment README includes the transfer steps, including how to package an ONNX export that uses an external data file.
From your Isaac Lab checkout, set up SSH access and check inference with the robot standing upright and still:
cd scripts/deploy/microduck_tof_nav
ssh-copy-id microduck@ROBOT_HOST
uv run nav_pad.py --robot ROBOT_HOST \
--model /absolute/path/to/navigation/exported/policy.onnx \
--dry-run --seconds 30
Dry-run copies the helpers and streams sensor data, but sends no movement commands. Watch the proposed commands as obstacles enter the sensor’s view. Keep the navigation ONNX and any companion .data file together.
Once those checks pass, start supervised gamepad navigation:
uv run nav_pad.py --robot ROBOT_HOST \
--model /absolute/path/to/navigation/exported/policy.onnx
Hold the stick forward to request movement; the policy adjusts the command to avoid obstacles. Release the stick to stop, press X to toggle navigation, and use Ctrl-C to end the session. Forward speed is capped at 0.15 m/s by default, with an additional close-obstacle brake and stale-input stopping. Start in a clear area and verify stopping before testing a course.
See the deployment README for controls, logs and troubleshooting.
Figure 4. Microduck steers around cones using its 8×8 ToF sensor, with real footage on the left and a 3D rebuild from its logs on the right. Blue shows the policy steering, purple shows the operator intervention.
The Microduck task collection includes velocity tracking on flat and rough terrain; stand-up recovery, sit–stand transitions, and walking with fall recovery (VelStand); ball kicking, ground picking, and forward rolls (Roulade). Roller-skating tasks add velocity tracking and swizzle motion, crouch-gliding, slope descent, standing up on skates, and spins.
Figure 5. Fifteen Microduck task views: flat and rough-terrain walking, recovery, object interaction, and roller-skating motions.
Build your next policy
Start with the first Microduck tutorial , then choose a task from the Microduck task collection to build your next policy in Isaac Lab with Newton. Explore new behaviors by changing commands, rewards, or environments—from rough-terrain walking to perception-driven obstacle avoidance. Evaluate your policy on scenes outside the training set before testing on the robot.
Resources
Acknowledgments
This workflow builds on Pollen Robotics’ Microduck hardware and software, the original Microduck reinforcement-learning project , BAM actuator modeling work , and the Isaac Lab and Newton integrations.
首次收录 · 2026-11-25 · 10.68 分