Skip to content

Detect red-light stop-line crossings at the front bumper - #604

Open
kawaeeeee wants to merge 2 commits into
Emerge-Lab:3.0from
scien-inc:fix/front-bumper-stop-line
Open

kawaeeeee wants to merge 2 commits into
Emerge-Lab:3.0from
scien-inc:fix/front-bumper-stop-line

Conversation

@kawaeeeee

@kawaeeeee kawaeeeee commented Nov 2, 2026 •

Copy link
Copy Markdown

What

Detect red-light stop-line entry when the physical front bumper crosses the line. For a 4 m vehicle moving from center x = -2.5 m to -1.5 m toward a stop line at x = 0, the bumper moves from -0.5 m to +0.5 m. The current center-based check misses this entry; this change reports the infraction and therefore applies the existing stop-line penalty at that step.

  • Sweep both front corners between the previous and current poses, including vehicle width and heading.
  • Report one entry event: later crossings by the other front corner, center, or rear do not repeat it.
  • Retain the existing red-state, direction, elevation, proximity, and lateral-extension filters.

Why

The current check allows the front of the vehicle to protrude across a red-light stop line without triggering its violation flag or penalty. Front-based entry makes the stopping reference consistent with keeping the vehicle body before the line.

Notes

  • 4 bernhard dev #570 introduced a rear-bumper entry event; 6 bernhard dev #580 subsequently changed the reference to the center and cited evaluation-time size inflation. This PR deliberately proposes the physical front bumper. On current 3.0, eval_perceived_size_margin_m changes observations only; the check uses sim_length and sim_width, and a regression test covers that distinction.
  • Entering on green and then crossing with the center after the light turns red does not produce a new violation.
  • This changes infraction timing and can change rewards, removal timing, and evaluation results for existing policies. Policy retraining was not performed.

Validation:

  • Updated red-light suite: 20 test groups pass; 13 groups fail against the original center-based implementation.
  • make -C tests/drive test: all C unit and environment smoke suites pass.
  • NO_TRAIN=1 python setup.py build_ext --inplace --force and importing the rebuilt pufferlib.ocean.drive.binding: pass in the existing Docker environment.
  • clang-format --dry-run --Werror (21.1.5) on both changed C files and git diff --check: pass.

This branch has not been deployed

No deployments
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