Skip to content
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

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

TomohitoAndo
Copy link

@TomohitoAndo TomohitoAndo commented Mar 6, 2024

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.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

Comment on lines +232 to +235
updateTrafficSignal();

const bool is_unknown_signal = isUnknownSignal(looking_tl_state_);
const bool is_signal_timed_out = isTrafficSignalTimedOut();
Copy link
Author

Choose a reason for hiding this comment

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

信号がunknownかどうかの判定とtimeoutしているかどうかの判定を前に持ってきた
これにより、信号がunknownだが残り時間から停止線を通過すると判断してしまうのを避ける

Comment on lines -237 to -251
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);
}
Copy link
Author

Choose a reason for hiding this comment

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

流れを見やすくするため、ここの処理はcanPassStopLineBeforeRed関数にまとめた

@TomohitoAndo TomohitoAndo marked this pull request as ready for review March 8, 2024 04:16
Copy link

@0x126 0x126 left a comment

Choose a reason for hiding this comment

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

LGTM

@TomohitoAndo TomohitoAndo merged commit 0a8cc23 into beta/v0.19.1 Mar 8, 2024
21 checks passed
@TomohitoAndo TomohitoAndo deleted the feat/stop-when-no-signal branch March 8, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants