Skip to content

Track moving objects from the scan and avoid them without an oracle - #322

Merged
rsasaki0109 merged 2 commits into
masterfrom
feature/scan-pedestrian-tracking
Nov 21, 2026
Merged

rsasaki0109 merged 2 commits into
masterfrom
feature/scan-pedestrian-tracking

Conversation

@rsasaki0109

Copy link
Copy Markdown
Owner

Summary

#320 avoided predicted pedestrians, but its tracks came from the simulator. This PR finds and tracks them in the LiDAR scan.

ScanObjectTracker (python/src/cudarobotics/navigation/tracking.py, NumPy)

  1. Candidates.
    • OccupancyAge counts how long each rolling-grid cell has been occupied.
    • A point is a candidate when its 3x3 block holds no long-standing structure (a cell occupied for 20 frames).
    • Established walls therefore drop out, including the returns that land in the free cell in front of the wall surface. Anything new starts as an object.
  2. Clusters.
    • Points are linked within 0.3 m; clusters wider than 1.0 m are dropped.
    • The centre is corrected for the near-side bias of a scan (2r/π). This halved the position RMSE, from 0.23 m to 0.10 m.
  3. Tracks.
    • Greedy association within 0.8 m, then a constant-velocity Kalman filter.
    • A track is confirmed only after moving 0.3 m. Wall fragments jitter in place, so they never get confirmed.
    • Points touching structure cannot keep a track alive.
  4. Map gating.
    • Detection points stay out of the voxel map.
    • A still object is released to the map after 2 s; until then MPPI sees it as a stationary disc.
    • Confirmed tracks clear their last 10 s of positions from the occupancy grid.

Integration

  • CudaNavPipeline(tracker=...) gives tracks to the dynamic-obstacle path and exposes step.tracks, track_ids and dynamic_point_count.
  • cudarobotics-cudanav sim --scenario crossing --dynamic-mode tracked_scan uses no simulator knowledge. It reports recall, position/velocity RMSE and false tracks against the true pedestrians.

Core: MppiParams::dynamic_obstacle_overlap_allowance

  • Default 0, with behaviour bit-identical to Add a predicted dynamic-obstacle critic to CUDA MPPI and a crossing scenario #320.
  • When it is greater than 0:
    • a rollout collides only if it gets deeper than the robot's current, capped penetration of an observed disc;
    • the uncertainty growth is soft-only.
  • Without it, the scan-tracked robot froze in 6/6 runs: tracking errors put it inside a disc and left no valid rollout.
  • The pipeline sets 0.1 m only when it runs the tracker.
  • I also tried more permissive rules (blaming only motion relative to standing still). They produced robot-caused contacts with delayed, noisy oracle tracks, so they were dropped.

Results (6 seeds per condition, docs/results/cudanav_dynamic_obstacles_2026-11-21.md)

Condition Goal Robot-caused collisions Median time Median ped. yields
Map only 0/6 0 - 13
Tracked, zero velocity (oracle) 3/6 0 40.9 s 157
Prediction (oracle) 5/6 0 25.9 s 11
Prediction (oracle, 2-frame delay + noise) 4/6 12 43.6 s 178
Scan tracker + prediction (no oracle) 4/6 0 31.3 s 146

Limits

  • Synthetic plant and LiDAR.
  • 2-D model-free tracker: a person still for 2 s before moving becomes structure.
  • NumPy tracker plus a per-frame grid copy: frame p95 is about 25–35 ms, against 5–7 ms with the oracle.
  • Standoffs remain in 2/6 scan-tracker runs.
  • No Nav2 input yet.

Test plan

  • mppi_dynamic_obstacle_smoke (CTest):
    • the default stays bit-identical when disabled;
    • a co-located obstacle is still all_colliding;
    • the new allowance tolerates a 0.05 m overlap without driving deeper, and still rejects penetration beyond the cap.
  • cudanav_costmap_gpu_smoke is unchanged.
  • python/tests:
    • 80 passed, 1 skipped with a GPU; 60 passed, 2 skipped with no GPU visible;
    • new CPU tests: tracker confirmation and velocity, still-object release, wall rejection, deletion, input validation, bias correction, OccupancyAge structure and roll;
    • new GPU tests: the tracked crossing reaches the goal with recall > 0.8, the allowance is set only with a tracker, and tracked_scan without a tracker raises.
  • provenance (61 hashes), core sync, artifact verifier (now requires tracking.py), paper artifacts, redaction, and the CudaNav contract/closed-loop/version/systems-bundle script tests all pass.
  • CI

🤖 Generated with Claude Code

https://claude.ai/code/session_01ALg7o339S7Rpi9hd751Cbt

ScanObjectTracker (cudarobotics.navigation.tracking) finds moving objects in
the LiDAR scan itself and tracks them with constant-velocity Kalman filters:
- OccupancyAge counts how long each rolling-grid cell has been occupied;
  points whose 3x3 block holds no long-standing structure are candidates,
  so established walls (including returns that land in the free cell in
  front of the wall surface) drop out and anything new starts as an object;
- candidates are clustered (0.3 m, <= 1.0 m wide), centres corrected for
  the near-side bias of a scan, associated greedily and confirmed only after
  moving 0.3 m, which rejects wall fragments that jitter in place;
- every detection's points stay out of the voxel map; a still object is
  released to the map after 2 s (a stationary disc for MPPI until then);
  confirmed tracks clear their last 10 s of positions from the occupancy.

CudaNavPipeline(tracker=...) runs it per frame and hands the tracks to the
dynamic-obstacle path; `sim --scenario crossing --dynamic-mode tracked_scan`
evaluates it with tracking metrics against the true pedestrians.

MppiParams::dynamic_obstacle_overlap_allowance (default 0, unchanged
behaviour) lets a rollout collide only when it gets deeper than the robot's
current, capped penetration of an observed disc, with the uncertainty growth
soft-only. Without it the scan-tracked robot froze in every run whenever a
position error put it inside a disc; the pipeline sets 0.1 m only when it
runs the tracker.

6 seeds per condition (docs/results/cudanav_dynamic_obstacles_2026-11-21):
scan tracker 4/6 goals, 0 robot-caused collisions, 90.5% recall, 0.12 m
position / 0.28 m/s velocity RMSE; oracle prediction 5/6. Seeds 3-5 also
show that the delayed, noisy oracle condition from #320 can freeze or touch
pedestrians (2 runs, 12 contacts), most likely through the retreat
behaviour, which ignores predicted obstacles; documented as a limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALg7o339S7Rpi9hd751Cbt
@rsasaki0109
rsasaki0109 merged commit dc34315 into master Nov 21, 2026
11 checks passed
@rsasaki0109
rsasaki0109 deleted the feature/scan-pedestrian-tracking branch November 21, 2026 08:30
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.

1 participant