Skip to content

fix(traffic_light_stop): floor scan length with min_lookahead_distance and wire stop time step - #3232

Merged
Owen-Liuyuxuan merged 2 commits into
feat/v0.64/e2efrom
fix/traffic-light-stop-full-horizon-and-stop-traj
Jul 28, 2026
Merged

Owen-Liuyuxuan merged 2 commits into
feat/v0.64/e2efrom
fix/traffic-light-stop-full-horizon-and-stop-traj

Conversation

@Owen-Liuyuxuan

@Owen-Liuyuxuan Owen-Liuyuxuan commented Jul 22, 2026 •

Copy link
Copy Markdown

Summary

  • Floor the traffic-light scan length at min_lookahead_distance (default 20 m) so red/amber stop lines further ahead are still checked at low ego speed (creeping ~0.5–1 m/s previously limited the scan to ~0.5 m via comfortable-stop distance alone).
  • Keep the comfortable-stop + stop_overshoot_margin cap so far lights are not over-checked (important for traffic_light_filter, which rejects trajectories).
  • Assign trajectory_time_step_ in TrafficLightStop init/update so the existing 3-point replace_trajectory_with_stop_point fallback uses the configured step.
  • Wire the same min_lookahead_distance through trajectory modifier (TrafficLightStop) and trajectory validator (TrafficLightFilter).

Test plan

  • Logging sim: red light + creeping ego; previously trunc_by_len / max_scan_len≈0.5 with red_stop_lines=1 and violations=0; after fix expect violations and stop insertion
  • Logging sim: arrived / near-stop fallback path produces a Control-usable stop trajectory
  • CI on this PR
recording_20260722_161600.mp4

Notes for reviewers

  • After merge, pilot-auto.x2 autoware.repos pin for autoware/universe on feat/v0.64/e2e should be bumped in a follow-up monorepo PR.
  • Launch-side param mirror (modifier + validator): tier4/autoware_launch.x2#2757 (feat/v4.4/e2e).

Related links

Made with Cursor

At low ego speed the compliance checker capped the scan by comfortable
stopping distance (~0.5 m), missing red stop lines ahead. Also assign
trajectory_time_step_ so the existing 3-point stop fallback uses the
configured step.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

@Owen-Liuyuxuan Thank you for contributing to TIER IV E2E branch! Edit the checklist below and check the boxes as you complete the items.

Things to check before merging

Please check the following points before merging:

  • Write a brief description of this PR that can be understood by coding-agents.
  • Contact the branch manager on when the PR will be tested on vehicle.
  • Recommend to use Squash and Merge to merge the PR.
  • Report in #team-product-dev channel on the contents of the PR. @ branch manager.

After merging

Please check the following points after merging:

  • Wait for the automatic hash synchronization, which will automatically create a PR to update the hash, you should check the PR and merge it.

@tier4-autoware-public-bot tier4-autoware-public-bot Bot added beta/v0.64 Base branch: beta/v0.64 diffusion_planner Product: diffusion_planner labels Jul 22, 2026
@Owen-Liuyuxuan
Owen-Liuyuxuan requested a review from mkquda July 22, 2026 07:34
Restore the comfortable-stop scan cap but floor it at 20 m so creeping
ego still sees nearby stop lines, without rejecting far lights in the
shared traffic_light_filter path.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

Copy link
Copy Markdown

@Owen-Liuyuxuan Owen-Liuyuxuan changed the title fix(traffic_light_stop): check full traj horizon and wire stop time step fix(traffic_light_stop): floor scan length with min_lookahead_distance and wire stop time step Jul 23, 2026

@mkquda mkquda left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@mergify

mergify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@Owen-Liuyuxuan
Owen-Liuyuxuan merged commit 4e4b062 into feat/v0.64/e2e Jul 28, 2026
39 of 44 checks passed
@Owen-Liuyuxuan
Owen-Liuyuxuan deleted the fix/traffic-light-stop-full-horizon-and-stop-traj branch July 28, 2026 02:17
tier4-autoware-public-bot Bot pushed a commit to tier4/pilot_auto_common that referenced this pull request Jul 28, 2026
…e and wire stop time step (tier4/autoware_universe#3232)

* fix(traffic_light_stop): check full traj horizon and wire stop time step

At low ego speed the compliance checker capped the scan by comfortable
stopping distance (~0.5 m), missing red stop lines ahead. Also assign
trajectory_time_step_ so the existing 3-point stop fallback uses the
configured step.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(traffic_light): floor scan length with min_lookahead_distance

Restore the comfortable-stop scan cap but floor it at 20 m so creeping
ego still sees nearby stop lines, without rejecting far lights in the
shared traffic_light_filter path.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
tier4-autoware-public-bot Bot pushed a commit to tier4/pilot_auto_planning that referenced this pull request Jul 28, 2026
…e and wire stop time step (tier4/autoware_universe#3232)

* fix(traffic_light_stop): check full traj horizon and wire stop time step

At low ego speed the compliance checker capped the scan by comfortable
stopping distance (~0.5 m), missing red stop lines ahead. Also assign
trajectory_time_step_ so the existing 3-point stop fallback uses the
configured step.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(traffic_light): floor scan length with min_lookahead_distance

Restore the comfortable-stop scan cap but floor it at 20 m so creeping
ego still sees nearby stop lines, without rejecting far lights in the
shared traffic_light_filter path.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
shmpwk pushed a commit that referenced this pull request Aug 28, 2026
…lity (#3339)

* feat(traffic_light_compliance_checker): allow when close and cannot stop (#3222)

feat(traffic_light_compliance_checker): allow when close and cannot stop (autowarefoundation#13028)

Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp>

* fix(traffic_light_compliance_checker): improve stop point detection (#3203)

Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp>

* fix(traffic_light_stop): floor scan length with min_lookahead_distance and wire stop time step (#3232)

* fix(traffic_light_stop): check full traj horizon and wire stop time step

At low ego speed the compliance checker capped the scan by comfortable
stopping distance (~0.5 m), missing red stop lines ahead. Also assign
trajectory_time_step_ so the existing 3-point stop fallback uses the
configured step.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(traffic_light): floor scan length with min_lookahead_distance

Restore the comfortable-stop scan cap but floor it at 20 m so creeping
ego still sees nearby stop lines, without rejecting far lights in the
shared traffic_light_filter path.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* modify tl compliance checker to detect stop attempts at amber light and (optionally) add tl id to force rejection buffer

- update traffic_light_stop params in modifier
- update traffic_light filter params in validator
- update modifier and validator parameter structs
- implement logic to detect stops at ember light and optionally add to force rejection buffer
- update & refactor traffic_light filter tests

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* refactor tl compliance checker

- update amber rejection hystory while checking for violations instead of post process
- apply allow_if_cannot stop check while checking for violations instead of post process

Signed-off-by: Mohammad Alqudah <alqudah.mohammad@tier4.jp>

* improve crossig time limit logic

compute dynamic time limit for amber light based on tracked tl duration instead of using fixed value param

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* check the flag reject_if_stop_detected before adding tl to amber_rejection_history_

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* add test cases to traffic_light_stop and traffic_light_filter

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* minor refactor

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

---------

Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp>
Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>
Signed-off-by: Mohammad Alqudah <alqudah.mohammad@tier4.jp>
Co-authored-by: Maxime CLEMENT <78338830+maxime-clem@users.noreply.github.com>
Co-authored-by: Yuxuan Liu <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Mohammad <alqudah.mohammad@tier4.jp>
Owen-Liuyuxuan added a commit that referenced this pull request Sep 8, 2026
…3369)

* feat(trajectory_modifier): adapt TrafficLightStop from X2 processor

Extend InputData with map/route/TL and register a modifier plugin using
modify_trajectory (not processor process()).
Source: #3017 (0bc9698), AWF#12875 (502d264),

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
#3091 (9fc3824), #3232 (f5f933e).

* fix(trajectory_modifier): emit three-point temporal-safe stop trajectory

Immediate-stop replacement used two identical zero-time points, which
temporal PID/MPC reject. Match X2: three points at 0/dt/2dt with 1 mm
offsets, and pass trajectory_time_step from all stop plugins.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(planning_validator): add uncrossable-boundary departure plugin (#3370)

* feat(planning_validator): add uncrossable-boundary departure plugin

Reject the single planned trajectory on CRITICAL road-border departure
and publish diagnostic boundary_departure for MRM.
Source: X2 autoware_trajectory_validator uncrossable_boundary_departure
d1ae5d0 (#3358), mapped onto planning_validator PluginInterface.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>

* feat(trajectory_modifier): port velocity modifier from X2 (#3379)

feat(trajectory_modifier): enable velocity modifier

* feat(control): port temporal trajectory follower and follow-ups from X2 (#3371)

* feat(control): port temporal trajectory_reference_mode from X2

Use timestamps for nearest-point selection in MPC and PID when
trajectory_reference_mode is temporal. Default remains spatial in C++
so existing tests without time_from_start still run.
Source: #2957 (d287a8e), AWF#12886 (58433ba),
#3138 (44d891d), #3072 (7831873). Skipped Taubin (#3041) and
trajectory-steer feedforward (#3268) due to XX1 MPCTrajectory API drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>

* fix(control): keep follower package default spatial

E2E opts into temporal via autoware_launch.xx1. Leave the Universe
package YAML at spatial so standalone/non-E2E users are unchanged.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(control): port temporal MPC/PID follow-ups from X2

Temporal mode needs look-ahead PID, Taubin short-horizon curvature,
confidence steer hold, and trajectory-steer feedforward. These land
with the temporal controller, not as isolated extras.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: iemura <iemura-n1207@keio.jp>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: iemura <iemura-n1207@keio.jp>
Owen-Liuyuxuan added a commit that referenced this pull request Sep 8, 2026
* feat(traffic_light_compliance_checker): copy package from X2 e2e

Port the checker library so TrafficLightStop can run on XX1 modifier.
Source: #3009 (5d7ab5b), #3232 (f5f933e), copied tree #3346 (cd44e12).

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>

* feat(trajectory_modifier): adapt TrafficLightStop from X2 processor (#3369)

* feat(trajectory_modifier): adapt TrafficLightStop from X2 processor

Extend InputData with map/route/TL and register a modifier plugin using
modify_trajectory (not processor process()).
Source: #3017 (0bc9698), AWF#12875 (502d264),

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
#3091 (9fc3824), #3232 (f5f933e).

* fix(trajectory_modifier): emit three-point temporal-safe stop trajectory

Immediate-stop replacement used two identical zero-time points, which
temporal PID/MPC reject. Match X2: three points at 0/dt/2dt with 1 mm
offsets, and pass trajectory_time_step from all stop plugins.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(planning_validator): add uncrossable-boundary departure plugin (#3370)

* feat(planning_validator): add uncrossable-boundary departure plugin

Reject the single planned trajectory on CRITICAL road-border departure
and publish diagnostic boundary_departure for MRM.
Source: X2 autoware_trajectory_validator uncrossable_boundary_departure
d1ae5d0 (#3358), mapped onto planning_validator PluginInterface.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>

* feat(trajectory_modifier): port velocity modifier from X2 (#3379)

feat(trajectory_modifier): enable velocity modifier

* feat(control): port temporal trajectory follower and follow-ups from X2 (#3371)

* feat(control): port temporal trajectory_reference_mode from X2

Use timestamps for nearest-point selection in MPC and PID when
trajectory_reference_mode is temporal. Default remains spatial in C++
so existing tests without time_from_start still run.
Source: #2957 (d287a8e), AWF#12886 (58433ba),
#3138 (44d891d), #3072 (7831873). Skipped Taubin (#3041) and
trajectory-steer feedforward (#3268) due to XX1 MPCTrajectory API drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>

* fix(control): keep follower package default spatial

E2E opts into temporal via autoware_launch.xx1. Leave the Universe
package YAML at spatial so standalone/non-E2E users are unchanged.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(control): port temporal MPC/PID follow-ups from X2

Temporal mode needs look-ahead PID, Taubin short-horizon curvature,
confidence steer hold, and trajectory-steer feedforward. These land
with the temporal controller, not as isolated extras.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: iemura <iemura-n1207@keio.jp>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: iemura <iemura-n1207@keio.jp>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: iemura <iemura-n1207@keio.jp>
shmpwkcipractice Bot pushed a commit to tier4/pilot_auto_planning that referenced this pull request Sep 9, 2026
…e and wire stop time step (tier4/autoware_universe#3232)

* fix(traffic_light_stop): check full traj horizon and wire stop time step

At low ego speed the compliance checker capped the scan by comfortable
stopping distance (~0.5 m), missing red stop lines ahead. Also assign
trajectory_time_step_ so the existing 3-point stop fallback uses the
configured step.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(traffic_light): floor scan length with min_lookahead_distance

Restore the comfortable-stop scan cap but floor it at 20 m so creeping
ego still sees nearby stop lines, without rejecting far lights in the
shared traffic_light_filter path.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
kalfazed pushed a commit that referenced this pull request Sep 10, 2026
* feat(traffic_light_compliance_checker): copy package from X2 e2e

Port the checker library so TrafficLightStop can run on XX1 modifier.
Source: #3009 (5d7ab5b), #3232 (f5f933e), copied tree #3346 (cd44e12).

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>

* feat(trajectory_modifier): adapt TrafficLightStop from X2 processor (#3369)

* feat(trajectory_modifier): adapt TrafficLightStop from X2 processor

Extend InputData with map/route/TL and register a modifier plugin using
modify_trajectory (not processor process()).
Source: #3017 (0bc9698), AWF#12875 (502d264),

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
#3091 (9fc3824), #3232 (f5f933e).

* fix(trajectory_modifier): emit three-point temporal-safe stop trajectory

Immediate-stop replacement used two identical zero-time points, which
temporal PID/MPC reject. Match X2: three points at 0/dt/2dt with 1 mm
offsets, and pass trajectory_time_step from all stop plugins.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(planning_validator): add uncrossable-boundary departure plugin (#3370)

* feat(planning_validator): add uncrossable-boundary departure plugin

Reject the single planned trajectory on CRITICAL road-border departure
and publish diagnostic boundary_departure for MRM.
Source: X2 autoware_trajectory_validator uncrossable_boundary_departure
d1ae5d0 (#3358), mapped onto planning_validator PluginInterface.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>

* feat(trajectory_modifier): port velocity modifier from X2 (#3379)

feat(trajectory_modifier): enable velocity modifier

* feat(control): port temporal trajectory follower and follow-ups from X2 (#3371)

* feat(control): port temporal trajectory_reference_mode from X2

Use timestamps for nearest-point selection in MPC and PID when
trajectory_reference_mode is temporal. Default remains spatial in C++
so existing tests without time_from_start still run.
Source: #2957 (d287a8e), AWF#12886 (58433ba),
#3138 (44d891d), #3072 (7831873). Skipped Taubin (#3041) and
trajectory-steer feedforward (#3268) due to XX1 MPCTrajectory API drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>

* fix(control): keep follower package default spatial

E2E opts into temporal via autoware_launch.xx1. Leave the Universe
package YAML at spatial so standalone/non-E2E users are unchanged.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(control): port temporal MPC/PID follow-ups from X2

Temporal mode needs look-ahead PID, Taubin short-horizon curvature,
confidence steer hold, and trajectory-steer feedforward. These land
with the temporal controller, not as isolated extras.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: iemura <iemura-n1207@keio.jp>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: iemura <iemura-n1207@keio.jp>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: iemura <iemura-n1207@keio.jp>
(cherry picked from commit 145e799)
mkquda pushed a commit to mkquda/autoware_universe that referenced this pull request Sep 10, 2026
…e and wire stop time step (tier4#3232)

* fix(traffic_light_stop): check full traj horizon and wire stop time step

At low ego speed the compliance checker capped the scan by comfortable
stopping distance (~0.5 m), missing red stop lines ahead. Also assign
trajectory_time_step_ so the existing 3-point stop fallback uses the
configured step.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(traffic_light): floor scan length with min_lookahead_distance

Restore the comfortable-stop scan cap but floor it at 20 m so creeping
ego still sees nearby stop lines, without rejecting far lights in the
shared traffic_light_filter path.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
mkquda pushed a commit to mkquda/autoware_universe that referenced this pull request Sep 11, 2026
…e and wire stop time step (tier4#3232)

* fix(traffic_light_stop): check full traj horizon and wire stop time step

At low ego speed the compliance checker capped the scan by comfortable
stopping distance (~0.5 m), missing red stop lines ahead. Also assign
trajectory_time_step_ so the existing 3-point stop fallback uses the
configured step.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(traffic_light): floor scan length with min_lookahead_distance

Restore the comfortable-stop scan cap but floor it at 20 m so creeping
ego still sees nearby stop lines, without rejecting far lights in the
shared traffic_light_filter path.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
mkquda added a commit to mkquda/autoware_universe that referenced this pull request Sep 11, 2026
…ability and amber handling (autowarefoundation#13371)

* modify tl compliance checker to detect stop attempts at amber light and (optionally) add tl id to force rejection buffer

- update traffic_light_stop params in modifier
- update traffic_light filter params in validator
- update modifier and validator parameter structs
- implement logic to detect stops at ember light and optionally add to force rejection buffer
- update & refactor traffic_light filter tests

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* refactor tl compliance checker

- update amber rejection hystory while checking for violations instead of post process
- apply allow_if_cannot stop check while checking for violations instead of post process

Signed-off-by: Mohammad Alqudah <alqudah.mohammad@tier4.jp>

* improve crossig time limit logic

compute dynamic time limit for amber light based on tracked tl duration instead of using fixed value param

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* check the flag reject_if_stop_detected before adding tl to amber_rejection_history_

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* add test cases to traffic_light_stop and traffic_light_filter

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* minor refactor

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* fix(traffic_light_stop): floor scan length with min_lookahead_distance and wire stop time step (tier4#3232)

* fix(traffic_light_stop): check full traj horizon and wire stop time step

At low ego speed the compliance checker capped the scan by comfortable
stopping distance (~0.5 m), missing red stop lines ahead. Also assign
trajectory_time_step_ so the existing 3-point stop fallback uses the
configured step.

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(traffic_light): floor scan length with min_lookahead_distance

Restore the comfortable-stop scan cap but floor it at 20 m so creeping
ego still sees nearby stop lines, without rejecting far lights in the
shared traffic_light_filter path.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* fix cherry-pick errors

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* implement arrow aware amber tl compliance check

- Track YellowState (kNotYellow / kFromGreen / kFromNonGreen) in TrafficLightStatusTracker from raw Green Circle → Amber transitions
- Skip stop-line collection for arrow-aware amber when enable_arrow_aware_yellow_passing, turn lane, mapped static arrow, and kFromGreen all hold
- Keep Red→Amber / unknown-origin amber as stop (no override)
- Add shared utils (is_equal, has_*_circle, has_static_arrow, is_arrow_aware_amber_pass) used by tracker and checker
- Add enable_arrow_aware_yellow_passing (default true) and wire it through trajectory_modifier traffic_light_stop and trajectory_validator traffic_light_filter (params, schema, config)
- Document arrow-aware amber behavior in the compliance checker README
- Add unit tests for yellow-transition tracking and end-to-end arrow-aware amber cases

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* hold last stable TL status while gated states settle

- Track current candidate and last stable signal separately in TrafficLightStatusTracker
- Emit the last stable status while red/amber/unknown are below their stable-duration thresholds instead of clearing elements
- Update YellowState only when the accepted stable status changes, avoiding single-frame false detections
- Pass through raw signals when ego is stopped for responsiveness, while still updating stable history
- Accept candidate states with duration >= threshold (including immediate green)

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* replace yellow usage by amber

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* fix test

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* rename test file and extend test cases for compliance checker

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* improve TL compliance checker to prevent chattering behavior

- refactor TrafficLightStatusTracker::filter_signals to emit all stable statuses in the history, not only the ones in this frame
- keep a history of violation arc lengths per id
- use previous violation arc lengths to floor current frame lookahead distance
- use current frame collected stop lines to cleanup the history of violation arc lengths

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* Update common/autoware_traffic_light_compliance_checker/include/autoware/traffic_light_compliance_checker/utils.hpp

Co-authored-by: Maxime CLEMENT <78338830+maxime-clem@users.noreply.github.com>

* feat(traffic_light_stop, traffic_light_compliance_checker): fix inconsistent amber rejection behavior (tier4#3380)

* update modifier traffic_light_stop parameters

- modify traffic_light_stop config to be consistent with traffic_light_filter
- update parameter_struct.yaml and schema
- update integration tests
- add delay_response_time param

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* ensure distance to stop line and crossing time are measured with respect to ego front

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* update default trajectory_processor config

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

---------

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* fix format

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* remove duplicated set of params

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

* fix test

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>

---------

Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>
Signed-off-by: Mohammad Alqudah <alqudah.mohammad@tier4.jp>
Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com>
Co-authored-by: Yuxuan Liu <619684051@qq.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Maxime CLEMENT <78338830+maxime-clem@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta/v0.64 Base branch: beta/v0.64 diffusion_planner Product: diffusion_planner run:build-and-test-differential After beta/v0.41 type:documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants