Repository navigation
Add a predicted dynamic-obstacle critic to CUDA MPPI and a crossing scenario - #320
Merged
Merged
Conversation
…cenario MppiGpu::setDynamicObstacles takes up to 64 constant-velocity discs. When dynamic_obstacle_weight > 0 the rollout kernel penalizes clearance to each predicted position, c = |q(tau) - (p + v tau)| - r - robot_radius - growth * tau: c < 0 adds collision_cost (so it feeds valid ratio, all colliding and retreat), 0 <= c < margin adds weight * (margin - c)^2 * dt. With weight 0 or no obstacles the term is skipped and plans are bit-identical (tests/mppi_dynamic_obstacle_smoke.cu); the native S-course loop is unchanged at 229 frames and 0.153% drift. Python: MppiPlanner.set_dynamic_obstacles, and CudaNavPipeline.step(..., dynamic_obstacles=rows) clears each track's disc from the occupancy grid (device and host chains) and passes the tracks to MPPI. New `cudarobotics-cudanav sim --scenario crossing` runs one traversal while two pedestrians cross the corridors, comparing map-only, tracked-without- velocity, and predicted handling with an oracle tracker that can be delayed, noisy and lossy. 3 seeds per condition (docs/results/cudanav_dynamic_obstacles_2026-11-21): - map only: 0/3 reach the goal (lethal pedestrian trails block the corridor); - tracked, zero velocity: 1/3 (pedestrians yield to it 186 frames, median); - predicted (oracle): 3/3 in 24.3 s median, no pedestrian ever yields; - predicted with 2-frame delay and noise: 3/3 in 39.3 s median. No robot-caused collision in any run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ALg7o339S7Rpi9hd751Cbt
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Until now, the production CUDA MPPI saw moving obstacles only as static costmap cells. This PR adds a constant-velocity prediction critic, and a CudaNav closed loop in which pedestrians cross the S-course.
Core:
MppiGpu::setDynamicObstacles(const DynamicObstacle*, int), with up to 64 discs{x, y, vx, vy, radius}.MppiParams, off by default:dynamic_obstacle_weight;margin(0.4 m);robot_radius(0.25 m);growth(0.1 m/s), which inflates the obstacle with the prediction horizon.tau:c = |q(tau) - (p + v tau)| - r - robot_radius - growth tau.c < 0addscollision_cost, which feedsvalid_rollout_ratio,all_collidingand retreat.0 <= c < marginaddsweight (margin - c)^2 dt.Python:
MppiPlanner.set_dynamic_obstacles(rows).CudaNavPipeline.step(..., dynamic_obstacles=rows):_CudaNavGridChain.clear_discon the device chain and NumPy on the host chain;Scenario:
cudarobotics-cudanav sim --scenario crossing --dynamic-mode map|tracked_static|predicted.--seedoption sets their schedules.--obs-latency-frames,--obs-position-noise-m,--obs-velocity-noise-mpsand--obs-dropoutoptions degrade it.Results (3 seeds per condition,
docs/results/cudanav_dynamic_obstacles_2026-11-21.md)Limits
LidarObjectPipelinetracks cars and vans only, so a scan-based pedestrian tracker is the next step.Test plan
mppi_dynamic_obstacle_smoke:all_colliding;cudanav_gpu_closed_loop_s_course --checkis unchanged at 229 frames and 0.153% drift.python/tests:python_source_provenance.py --check(60 hashes),test_python_core_sync.py,test_verify_python_release_artifacts.py,validate_paper_artifacts.py,redact_gpu_identity.py --check, and the CudaNav contract/closed-loop/version script tests all pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01ALg7o339S7Rpi9hd751Cbt