Skip to content

feat(crosswalk): forcibly stop for pedestrians that are on crosswalk poylgon#12015

Open
TakahikoHasegawa97 wants to merge 5 commits intoautowarefoundation:mainfrom
TakahikoHasegawa97:feat/force-stop-for-pedestrian-on-crosswalk
Open

feat(crosswalk): forcibly stop for pedestrians that are on crosswalk poylgon#12015
TakahikoHasegawa97 wants to merge 5 commits intoautowarefoundation:mainfrom
TakahikoHasegawa97:feat/force-stop-for-pedestrian-on-crosswalk

Conversation

@TakahikoHasegawa97
Copy link
Copy Markdown

Description

The feature is implemented to stop for any pedestrians on crosswalk. Ego will continue to stop until they leave the crosswalk polygon; Ego will stop as long as pedestrians are inside the crosswalk polygon.

  • Enabled/Disabled by stop_for_pedestrian_on_crosswalk parameter

❗ Should be merged after autowarefoundation/autoware_launch#1744 is merged

Results

Pedestrian stopping inside crosswalk (stationary)

Before

A_Before.mp4

After

A_After.mp4

Pedestrian crossing

Before

B_before.mp4

After

B_after.mp4

Pedestrian crossing but stops midway and moves around inside crosswalk

Before

C_before.mp4

After

C_after.mp4

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 2, 2026

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements a feature to forcibly stop the ego vehicle for any pedestrians present on the crosswalk polygon, regardless of their velocity, trajectory, or other conditions. The feature is controlled by the stop_for_pedestrian_on_crosswalk parameter (default: false) and ensures the ego vehicle remains stopped until pedestrians leave the crosswalk polygon.

Changes:

  • Added new parameter stop_for_pedestrian_on_crosswalk to control the feature
  • Modified collision detection logic to create virtual collision points for pedestrians on crosswalk
  • Updated object state transition logic to force YIELD state for pedestrians on crosswalk when feature is enabled

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
planning/behavior_velocity_planner/autoware_behavior_velocity_crosswalk_module/src/scene_crosswalk.hpp Added new parameter to struct, updated function signatures to accept is_object_on_crosswalk flag, and implemented force-stop logic in transitState
planning/behavior_velocity_planner/autoware_behavior_velocity_crosswalk_module/src/scene_crosswalk.cpp Refactored is_object_on_crosswalk calculation, added collision point creation for pedestrians on crosswalk, and updated function calls with new parameter
planning/behavior_velocity_planner/autoware_behavior_velocity_crosswalk_module/src/manager.cpp Added parameter loading for stop_for_pedestrian_on_crosswalk
planning/behavior_velocity_planner/autoware_behavior_velocity_crosswalk_module/config/crosswalk.param.yaml Added new parameter with default value false and documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +317 to +320
const unique_identifier_msgs::msg::UUID & uuid, const geometry_msgs::msg::Point & position, const double vel,
const rclcpp::Time & now, const bool is_ego_yielding, const bool has_traffic_light,
const std::optional<CollisionPoint> & collision_point, const uint8_t classification,
const PlannerParam & planner_param, const lanelet::BasicPolygon2d & crosswalk_polygon,
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

The function signature formatting was changed to place multiple parameters on the same line, which is inconsistent with the formatting style used for the transitState function above (lines 212-218). Consider keeping the existing style of one parameter per line for better readability and consistency with the rest of the codebase.

Suggested change
const unique_identifier_msgs::msg::UUID & uuid, const geometry_msgs::msg::Point & position, const double vel,
const rclcpp::Time & now, const bool is_ego_yielding, const bool has_traffic_light,
const std::optional<CollisionPoint> & collision_point, const uint8_t classification,
const PlannerParam & planner_param, const lanelet::BasicPolygon2d & crosswalk_polygon,
const unique_identifier_msgs::msg::UUID & uuid,
const geometry_msgs::msg::Point & position,
const double vel,
const rclcpp::Time & now,
const bool is_ego_yielding,
const bool has_traffic_light,
const std::optional<CollisionPoint> & collision_point,
const uint8_t classification,
const PlannerParam & planner_param,
const lanelet::BasicPolygon2d & crosswalk_polygon,

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@shmpwk shmpwk left a comment

Choose a reason for hiding this comment

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

LGTM

@shmpwk shmpwk changed the title feature to forcibly stop for pedestrians that are on crosswalk poylgon feat(crosswalk): forcibly stop for pedestrians that are on crosswalk poylgon Apr 4, 2026
@shmpwk shmpwk added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Apr 4, 2026
TakahikoHasegawa97 and others added 4 commits April 4, 2026 15:39
…dless of any other conditions

Signed-off-by: TakahikoHasegawa97 <takahiko.hasegawa@tier4.jp>
Signed-off-by: TakahikoHasegawa97 <takahiko.hasegawa@tier4.jp>
…crosswalk_module/src/scene_crosswalk.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@shmpwk shmpwk force-pushed the feat/force-stop-for-pedestrian-on-crosswalk branch from f8629de to 2d3f580 Compare April 4, 2026 06:39
@shmpwk shmpwk requested a review from Kotakku as a code owner April 4, 2026 06:39
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

❌ Patch coverage is 22.22222% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.50%. Comparing base (b4593ce) to head (f926d7a).

Files with missing lines Patch % Lines
..._velocity_crosswalk_module/src/scene_crosswalk.cpp 18.18% 7 Missing and 2 partials ⚠️
..._velocity_crosswalk_module/src/scene_crosswalk.hpp 0.00% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12015      +/-   ##
==========================================
+ Coverage   19.20%   19.50%   +0.30%     
==========================================
  Files        1895     1895              
  Lines      130246   130502     +256     
  Branches    46613    46660      +47     
==========================================
+ Hits        25010    25459     +449     
- Misses      85652    85811     +159     
+ Partials    19584    19232     -352     
Flag Coverage Δ *Carryforward flag
daily 21.00% <ø> (+<0.01%) ⬆️ Carriedforward from b4593ce
daily-cuda 18.57% <ø> (+<0.01%) ⬆️ Carriedforward from b4593ce
daily-humble-amd64-cuda 18.53% <ø> (+<0.01%) ⬆️ Carriedforward from b4593ce
daily-humble-amd64-nocuda 21.07% <ø> (+<0.01%) ⬆️ Carriedforward from b4593ce
daily-humble-arm64-cuda 18.90% <ø> (+<0.01%) ⬆️ Carriedforward from b4593ce
daily-humble-arm64-nocuda 21.53% <ø> (+<0.01%) ⬆️ Carriedforward from b4593ce
daily-jazzy-amd64-nocuda 0.27% <ø> (ø) Carriedforward from b4593ce
differential 21.10% <22.22%> (?)
total-cuda 18.57% <ø> (+<0.01%) ⬆️ Carriedforward from b4593ce
total-humble-cuda 18.53% <ø> (+<0.01%) ⬆️ Carriedforward from b4593ce

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shmpwk
Copy link
Copy Markdown
Contributor

shmpwk commented Apr 6, 2026

@Kotakku @yuki-takagi-66 @satoshi-ota
Could you review this as a codeowner?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:planning Route planning, decision-making, and navigation. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

3 participants