-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(behavior_velocity_traffic_light): stop when the signal is unknown or timed out #1176
Conversation
…n or timed out Signed-off-by: Tomohito Ando <[email protected]>
6e5cf4e
to
10e063d
Compare
updateTrafficSignal(); | ||
|
||
const bool is_unknown_signal = isUnknownSignal(looking_tl_state_); | ||
const bool is_signal_timed_out = isTrafficSignalTimedOut(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
信号がunknownかどうかの判定とtimeoutしているかどうかの判定を前に持ってきた
これにより、信号がunknownだが残り時間から停止線を通過すると判断してしまうのを避ける
if ( | ||
planner_param_.v2i_use_rest_time && rest_time_to_red_signal && | ||
!isDataTimeout(rest_time_to_red_signal->stamp)) { | ||
const double rest_time_allowed_to_go_ahead = | ||
rest_time_to_red_signal->time_to_red - planner_param_.v2i_last_time_allowed_to_pass; | ||
|
||
const double ego_v = planner_data_->current_velocity->twist.linear.x; | ||
if (ego_v >= planner_param_.v2i_velocity_threshold) { | ||
if (ego_v * rest_time_allowed_to_go_ahead <= signed_arc_length_to_stop_point) { | ||
*path = insertStopPose(input_path, stop_line_point_idx, stop_line_point, stop_reason); | ||
} | ||
} else { | ||
if (rest_time_allowed_to_go_ahead < planner_param_.v2i_required_time_to_departure) { | ||
*path = insertStopPose(input_path, stop_line_point_idx, stop_line_point, stop_reason); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
流れを見やすくするため、ここの処理はcanPassStopLineBeforeRed
関数にまとめた
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
I fixed the issue that the ego vehicle doesn't stop even if the signal is UNKNOWN when using the V2I remaining time information.
Related links:
V2Iの残り時間情報を使う場合に、信号機がUNKNOWNでも停止線で停止しない問題を修正
※この問題はV2Iの残り時間情報を使うuniverse versionでのみ発生するため、beta/v0.19.1に変更を加えている
This PR should be merged after this PR
I will rebase after following PR has been merged.
-> DONE
Tests performed
Simple planning simulator.
Before
A stop line is not inserted even if the signal is UNKNOWN because the module only checks the remaining time to the RED.
before.mp4
After
A stop line is always inserted when the signal is unknown.
after.mp4
Effects on system behavior
Not applicable.
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.