🚀 Microduck Obstacle Avoidance in Isaac Lab: Sim2Real
Discover Microduck obstacle avoidance in Isaac Lab: Newton simulation, sim-to-real robotics, ToF sensor training, and exported policies tested on robots—learn how.

Teaching Microduck to Avoid Obstacles: From Simulation to Robot
A walking policy can keep a small robot upright and moving, but it doesn't automatically help it steer around a box in its path. If you retrain locomotion to also handle navigation, training gets more complex fast - and it becomes harder to figure out why something failed. NVIDIA's Microduck obstacle-avoidance workflow takes a more controlled approach: it freezes the existing walking policy and trains a separate navigation policy that tweaks movement commands using time-of-flight (ToF) sensor data.
This separation matters when you debug. If the robot's gait falls apart, start with locomotion. If it gets too close to an obstacle, look harder at navigation and its sensor inputs. The workflow uses Isaac Lab to train across parallel simulated environments and Newton to simulate physics and depth measurements. It then exports the navigation policy for supervised testing on a physical Microduck.
This article walks through the control architecture, how the simulation is set up to make sensor data more useful, what the training configuration does, and how to approach hardware testing without treating a good simulation run as proof the robot is ready.
What changes in the Microduck obstacle avoidance workflow
The core design choice is to separate locomotion from local navigation. The existing walking policy handles balance and turns velocity commands into joint actions. The new navigation policy reads ToF measurements and adjusts the operator's forward, lateral, and yaw commands so the robot steers around nearby obstacles.
The operator still picks the general direction with a gamepad. The navigation policy sits in the middle, modifying the requested movement before those commands reach the frozen walking policy. That keeps the job narrow: move toward a goal while maintaining enough distance from obstacles. It doesn't need to learn how to walk from scratch.
Why keep the walking policy fixed?
Freezing the walking policy keeps training focused. If both locomotion and obstacle avoidance are changing at the same time, it's much harder to tell which behavior caused a failure. It also makes the deployment interface clear: the navigation model outputs adjusted velocity commands, and the locomotion model turns those commands into motion.
That said, it's not a universal rule. If the current gait can't safely execute the turns or stops that navigation requires, then locomotion will have to change too. In that case, "freezing" would just hide a real limitation.
What each policy sees
The navigation actor receives ToF history plus body and controller state intended to be available on the real robot. During training, the critic can use additional simulation state to help learning. That extra information isn't required for the deployed actor.
This is basically sim-to-real hygiene: use richer feedback during training when it helps, but make sure the deployed policy relies on observations the robot can actually provide. It also creates a simple sanity check: does the observation stream on the robot match what the policy was trained to interpret?
How to build a useful simulation and ToF sensor model
A navigation policy can only learn from what it experiences. A single neat obstacle course encourages a narrow response to a narrow arrangement. The Microduck environment instead generates varied layouts from simple geometry and reusable OpenUSD assets, including cardboard boxes, an office bin, a bedside cabinet, cones, and barriers.
At each episode reset, the environment samples and rearranges obstacles. Layouts include objects scattered ahead of the robot, aligned or staggered rows, passages, barriers, and some open paths. Mirroring arrangements adds variation without forcing a whole new set of assets. Goals are placed in front of the duck, and movement commands guide it toward the goal while the policy navigates around obstacles.
Variation is more useful than visual complexity alone
It helps to choose simulation assets for training usefulness, not just realism. Detailed visuals can be nice, but for a ToF-driven policy the bigger question is whether the geometry produces useful ranges of obstacle distances, gaps, and approach angles. Reusable assets also make it easier to vary those conditions in a consistent way.
NVIDIA's workflow uses pinned SimReady asset packages so setups are repeatable. Pinning the asset revision is a small operational detail that matters: if a course changes unexpectedly, it's easier to tell whether it was a policy change or an asset update.
Model sensor imperfections, not just ideal readings
The simulated MicroDuck ToF camera represents a VL53L5CX sensor. It measures distance on an 8-by-8 grid, updates at 15 Hz, uses a 45-degree field of view, and covers a stated range of 0.12 to 4 metres. It follows the robot's head and is positioned to approximate where the physical sensor sits.
The simulation also adds imperfections. Training randomizes sensor mounting pitch and height, varies floor readings, and can degrade measurements near the grid edges. Noise, delays, and missing measurements all push the policy to handle something less "perfect" than a clean depth map.
This doesn't guarantee the simulator matches every hardware failure mode. It's mainly a way to reduce reliance on ideal inputs. Before deploying, you still need to check that the real sensor configuration, mounting, update rate, and data handling line up with what the policy saw during training.
How to train the navigation policy in Isaac Lab
The workflow uses Isaac Lab for reinforcement-learning environments and PPO training, with Newton handling physics and sensor simulation. The task name is IsaacContrib-ObstacleAvoidance-Flat-MicroDuck. Its configuration wires together the robot, the fixed walking policy, the sensor, actions, observations, commands, and reward terms.
In NVIDIA's example, training runs for 1,500 iterations across 16,384 parallel environments, with seed 42 on CUDA. Those environment counts aren't mandatory. If you're limited by GPU memory, lower --num_envs and expect it may take more iterations - or longer wall-clock time - to gather comparable experience.
The workflow also reports a smaller run on NVIDIA DGX Spark: 4,096 environments and 3,000 PPO updates, completed in about six hours. Use that as a reference setup, not a guarantee. Runtime depends on hardware, software versions, and your training conditions.
Set up the task and walking checkpoint
The documented setup uses Linux, a compatible NVIDIA GPU and driver, Git with Git LFS, and the uv package manager. The example clones the exp/microduck branch of Isaac Lab and syncs its locked dependencies:
git lfs install
git clone --branch exp/microduck https://github.com/isaac-sim/IsaacLab.git
cd IsaacLab
uv sync --frozen
Before obstacle training, download and export the upstream backlash walking checkpoint. The obstacle-avoidance task loads that exported walker automatically. Listing the available MicroDuck environments and presets helps verify you installed the expected task:
uv run isaaclab list_envs --keyword MicroDuck --show_presets
Train for progress and safe clearance
The reward balances progress toward a goal with safe movement. The robot earns credit when it follows the command and makes progress while maintaining enough clearance. Approaches that get too risky reduce that credit. Additional penalties discourage fast approaches, abrupt command changes, collisions, and falls.
Those terms encode trade-offs. A reward that only chases the goal can produce unsafe shortcuts. A reward that punishes proximity too hard might make the robot stop moving. The reward still needs to reflect the behavior you actually want in the real operating context, and your evaluation should check whether the learned policy balances progress and caution rather than optimizing one number.
The training command in the example is:
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
How to evaluate and export the policy
A training reward isn't enough to judge whether a navigation policy is actually useful. You need playback so you can see how the robot steers under new obstacle arrangements and how its actions respond to ToF input. The workflow uses the same assets, the same frozen walker, and the same sensor randomization as training - but switches the seed so you get different layouts.
Don't just check whether the robot reaches the goal. Watch for close approaches, sudden command jumps, stalls, falls, and inconsistent behavior when obstacles appear near the edges of the ToF grid. If it only works on one arrangement and breaks on a small layout change, it hasn't really demonstrated robust local navigation.
Play back a checkpoint
Checkpoints live under logs/rsl_rl/microduck_obstacle_avoidance_tof_flat_backlash/<timestamp>/ relative to the repository root. Pick a model_<iteration>.pt file from your run and pass its absolute path into the playback command. The example opens the Newton viewer and records 1,000 simulation steps; use --visualizer none for headless recording.
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 exports TorchScript and ONNX models into the checkpoint's exported folder. If ONNX comes with a .data companion file, keep that file alongside the model. An "export" that omits required companion data isn't a complete deployment artifact.
Evaluate outside the training pattern
Use held-out arrangements, not only the same obstacle course you saw during training. Change obstacle positions and spacing, test both clear paths and cluttered ones, and pay attention to cases where the ToF grid has incomplete or edge-heavy measurements. The goal isn't to claim formal safety from a few trials. The goal is to spot obvious weaknesses before moving to hardware.
Simulation is good for repeatability and scale, but it won't reproduce every real sensor, actuator, surface interaction, or timing effect. Treat a good simulation run as a reason to proceed to controlled hardware testing - not as proof the robot is ready for unsupervised operation.
How to test obstacle avoidance on a real Microduck
On hardware, a laptop runs the navigation model and sends adjusted gamepad commands to the robot's existing walking policy. Use the same walking-policy export that you used during navigation training. Keep the navigation ONNX file and any companion .data file together, then follow the project's deployment instructions for transferring and loading the walking policy.
Start with an upright, stationary robot in a clear, level test area. Confirm the ToF sensor reporting makes sense and that the navigation policy produces plausible commands before you let it move.
Use dry-run before sending movement commands
The deployment script's dry-run mode copies helper files and streams sensor data without sending movement commands. That lets you watch proposed commands as obstacles enter the sensor's view while the robot stays 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
Only switch to supervised gamepad control after the dry-run checks look good. In the documented interface, pushing the stick forward requests movement; the policy adjusts the command. Releasing the stick stops. The X key toggles navigation. Ctrl-C ends the session. The default forward-speed cap is 0.15 metres per second, with an additional close-obstacle brake and stale-input stopping.
These safeguards reduce the impact of some failures, but they don't replace a clear test area, a human operator, or a verified stop response. Start with simple obstacles and low speeds. Make sure releasing the controls actually stops the robot before trying anything more complex.
Treat deployment as a separate validation stage
The sim-to-real gap is an engineering problem, not a final checklist item. Sensor placement can differ, real readings can be noisy or unreliable, inference timing and network latency can change, and the physical surface can affect walking. Keep early trials supervised and only make the tests harder once the robot behaves predictably.
The source workflow points to other Microduck skills - rough-terrain walking, recovery, object interaction, and roller-skating. Those are separate behaviors. They don't automatically prove a navigation policy will generalize. Change commands, rewards, or environments on purpose, then evaluate the resulting policy against conditions it didn't see during training.
Conclusion
The useful idea in this Microduck workflow isn't just "train in simulation." It's containing the problem: preserve a known walking policy, train a separate controller for local obstacle avoidance, model imperfect ToF input, and test in varied environments to see whether the behavior holds beyond a single course.
Isaac Lab and Newton make that process easier to scale, while ONNX export and dry-run support make it practical to evaluate on hardware. The trade-off is still the same: simulation speeds up iteration, but it doesn't certify real-world behavior. Train broadly, inspect failures, validate the sensor and command path, and keep the first physical tests supervised.