Skip to content

feat(perception+costs): pedestrian-intent cost layer (shadow mode) - #502

Open
shreyjoshi2004 wants to merge 14 commits into
Nova-UTD:devfrom
shreyjoshi2004:feature_pedestrian_cost_layer
Open

feat(perception+costs): pedestrian-intent cost layer (shadow mode)#502
shreyjoshi2004 wants to merge 14 commits into
Nova-UTD:devfrom
shreyjoshi2004:feature_pedestrian_cost_layer

Conversation

@shreyjoshi2004

@shreyjoshi2004 shreyjoshi2004 commented Jun 13, 2026

Copy link
Copy Markdown

Summary

Activates the dormant pedestrian-intent perception pipeline by projecting intent detections into a metric cost grid /grid/pedestrian, published in shadow mode — observable in RViz but not registered in grid_summation_node, so the planned path is unaffected this round.

  • PedestrianInfo.msg gains metric pos_x/pos_y (base_link).
  • New pure module pedestrian_geometry.py — monocular pinhole projection (estimate_depth, project_to_base_link); the producer populates pos_x/pos_y, with cam_offset_x/cam_offset_y params (default 0.0) for a measured extrinsic later.
  • New pure-logic module costs/pedestrian_costmap.py (distance_to_cost, pose_to_grid_coords, paint_disk) — no ROS imports, fully unit-tested.
  • New thin pedestrian_costmap_node publishing /grid/pedestrian (151×151 @ 0.4 m/cell, base_link, origin (-20.0, -30.0)) — matches the sibling cost layers' grid contract (Add lane-aware cost layer and fix grid_summation_node x/y and reshape bugs #493/fix(costs): correct grid output size and origin for all costmap nodes #494). Non-forward/degenerate poses are skipped so they can't paint a phantom cost on the ego cell.
  • Wiring: entry point, package.xml deps, param yaml, standalone launch, README, and a shadow Node definition in launch_node_definitions.py.

⚠️ Stacked on #501

This branch is stacked on the bugfix in #501. Until #501 merges into dev, this PR's diff also contains #501's bugfix commit (plus the planning-doc commits). Once #501 merges, GitHub drops the overlap automatically — merge #501 first.

Out of scope (Phase 3, separate PR)

Registering /grid/pedestrian in grid_summation_node (routing into steering + speed cost), real camera extrinsics / pinhole re-validation, and tuning d_max_m/inflation_radius_m/publish_rate_hz on real/sim data.

Test Plan

  • Pure-logic unit tests: 16 costs + 8 geometry (projection) — all pass via pytest.
  • Shadow-mode invariant: grep pedestrian grid_summation_node.py → no matches.
  • Needs CI / dev container (ROS): colcon build navigator_msgs (verify pos_x/pos_y exist), colcon build costs + ros2 pkg executables costs | grep pedestrian_costmap_node, ros2 launch costs pedestrian_costmap.launch.py then ros2 topic hz /grid/pedestrian (~15 Hz) and ros2 topic echo --field info (resolution 0.4, width/height 151, origin -20.0/-30.0). Could not run in the macOS authoring env.

🤖 Generated with Claude Code

shreyjoshi2004 and others added 14 commits June 13, 2026 15:46
The image-shape unpack shadowed the YOLO bbox width/height, so every
PedestrianInfo carried the full image dimensions. Rename the image-shape
locals to img_h/img_w so they no longer clobber the bbox dims.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…mode)

Add design for a new cost layer that activates the unused /pedestrians
intent pipeline: extend PedestrianInfo with metric position, populate it
in the perception node, and publish /grid/pedestrian from a new
pedestrian_costmap_node. Shadow mode — not wired into grid_summation yet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fold in deep-stress-test findings vs codebase, recent commits, Nova docs:
- §5.1: document + fix pre-existing variable-shadowing bug in the producer
  (width/height fields currently carry image dims, not bbox dims)
- §6: split into pure-logic module + thin node for testability; pin grid
  conventions against the Nova-UTD#493/Nova-UTD#494 x-y-flip and origin-swap regressions;
  adopt lane_controlled style (callbacks, clock, int16->int8)
- §7: correct the "one-line" live-wiring claim — routing one grid to both
  steering and speed needs a dedicated grid_summation branch
- §8: new package-wiring section (entry point, launch, deps, params, README)
  since the lane_controlled template is itself unregistered/dead code
- §10/§11: pytest-style pure-function tests + producer regression test; doc
  follow-ups

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…s, README)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Final-review follow-up: a degenerate bbox (estimate_depth -> 0) or a
detection at/behind the camera plane yields pos_x <= 0, which maps to the
ego cell under the default zero camera offset. Skip such poses so the
shadow grid never paints a phantom obstacle on the vehicle itself.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@shreyjoshi2004
shreyjoshi2004 force-pushed the feature_pedestrian_cost_layer branch from da9ed48 to 0117c40 Compare June 13, 2026 20:50
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