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

fix(bpp): overwrite turn signal by latter module #7045

Merged

Conversation

satoshi-ota
Copy link
Contributor

@satoshi-ota satoshi-ota commented May 17, 2024

Description

Sometimes, bpp module outputs unnecessary turn signal during multiple module execution. When multiple modules are running in series, the latter module is dominant for the path followed by Ego, so if there is an overlap in the turn signal section, it is overwritten by the latter module's signal.

simplescreenrecorder-2024-06-03_10.55.45.mp4

Ticket: TIER IV INTERNAL LINK

Tests performed

Effects on system behavior

Fix turn signal inconsistency.

Interface changes

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.

@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label May 17, 2024
@satoshi-ota satoshi-ota force-pushed the fix/turn-signal-consistency branch from 6298906 to e46b708 Compare May 20, 2024 01:09
@satoshi-ota satoshi-ota force-pushed the fix/turn-signal-consistency branch from e46b708 to adb1c7f Compare June 3, 2024 01:48
@github-actions github-actions bot added type:documentation Creating or refining documentation. (auto-assigned) component:launch Launch files, scripts and initialization tools. (auto-assigned) component:evaluator Evaluation tools for planning, localization etc. (auto-assigned) labels Jun 3, 2024
@satoshi-ota satoshi-ota force-pushed the fix/turn-signal-consistency branch from adb1c7f to 3d57a61 Compare June 3, 2024 04:03
@satoshi-ota satoshi-ota marked this pull request as ready for review June 3, 2024 04:03
@github-actions github-actions bot removed type:documentation Creating or refining documentation. (auto-assigned) component:launch Launch files, scripts and initialization tools. (auto-assigned) component:evaluator Evaluation tools for planning, localization etc. (auto-assigned) labels Jun 3, 2024
@@ -669,14 +704,16 @@ std::pair<TurnSignalInfo, bool> TurnSignalDecider::getBehaviorTurnSignalInfo(

// If shift length is shorter than the threshold, it does not need to turn on blinkers
if (std::fabs(relative_shift_length) < p.turn_signal_shift_length_threshold) {
return std::make_pair(TurnSignalInfo{}, true);
return std::make_pair(
Copy link
Contributor

Choose a reason for hiding this comment

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

Since path.path.points.front() and path.path.points.back() are called so often to make a pose, would you consider making a variable for them?

const auto first_path_pose =getPose(path.path.points.front()) and const auto last_path_pose = getPose(path.path.points.back())

Copy link
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 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jun 3, 2024
@@ -915,11 +917,21 @@ BehaviorModuleOutput StaticObstacleAvoidanceModule::plan()
ignore_signal_ = is_ignore ? std::make_optional(uuid) : std::nullopt;
};

const auto is_large_deviation = [this](const auto & path) {
constexpr double THRESHOLD = 1.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

clang-tidy will trigger a readability warning due to the variable name being all upper case.
probably better to use lowercase to remove the warning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in ef6b54c

@@ -93,6 +104,11 @@ class TurnSignalDecider
const TurnSignalInfo & intersection_signal_info, const TurnSignalInfo & behavior_signal_info,
const double nearest_dist_threshold, const double nearest_yaw_threshold);

TurnSignalInfo overwrite_turn_signal(
Copy link
Contributor

Choose a reason for hiding this comment

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

the function can be const

Copy link
Contributor Author

Choose a reason for hiding this comment

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

// If shift length is shorter than the threshold, it does not need to turn on blinkers
if (std::fabs(relative_shift_length) < p.turn_signal_shift_length_threshold) {
return std::make_pair(TurnSignalInfo{}, true);
return std::make_pair(TurnSignalInfo(getPose(p_path_start), getPose(p_path_end)), true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Ota-san has already called getPose from the path points and assigned them to p_path_start and p_path_end.
Is there any reason why you called getPose again on these two variables?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

:tashikani:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines 418 to 420
const double dist_to_original_desired_end =
get_distance(original_desired_end_point) - base_link2front_;
const double dist_to_new_desired_start = get_distance(new_desired_start_point) - base_link2front_;
Copy link
Contributor

Choose a reason for hiding this comment

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

since both subtract base_link2front_ from the get_distance, I am curious why it is not substract from within the get_distance's lambda directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

:tashikani:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@satoshi-ota satoshi-ota added run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) and removed run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) labels Jun 3, 2024
@satoshi-ota satoshi-ota force-pushed the fix/turn-signal-consistency branch from 1959d3f to 2fc8362 Compare June 5, 2024 12:14
@satoshi-ota satoshi-ota enabled auto-merge (squash) June 5, 2024 12:15
@satoshi-ota satoshi-ota merged commit 4daa6a9 into autowarefoundation:main Jun 5, 2024
20 of 22 checks passed
@satoshi-ota satoshi-ota deleted the fix/turn-signal-consistency branch June 5, 2024 14:18
satoshi-ota added a commit to tier4/autoware.universe that referenced this pull request Jun 6, 2024
…7045)

* fix(bpp): overwrite turn signal by latter module

Signed-off-by: satoshi-ota <[email protected]>

* fix(avoidance): return previous module turn signal if it's in success state

Signed-off-by: satoshi-ota <[email protected]>

* fix(avoidance): don't output turn signal if there is huge lateral deveation

Signed-off-by: satoshi-ota <[email protected]>

* refactor: small update

Signed-off-by: satoshi-ota <[email protected]>

* chore: use lower case

Signed-off-by: satoshi-ota <[email protected]>

* refactor: remove redundant function call

Signed-off-by: satoshi-ota <[email protected]>

---------

Signed-off-by: satoshi-ota <[email protected]>
kminoda pushed a commit to kminoda/autoware.universe that referenced this pull request Jun 6, 2024
…7045)

* fix(bpp): overwrite turn signal by latter module

Signed-off-by: satoshi-ota <[email protected]>

* fix(avoidance): return previous module turn signal if it's in success state

Signed-off-by: satoshi-ota <[email protected]>

* fix(avoidance): don't output turn signal if there is huge lateral deveation

Signed-off-by: satoshi-ota <[email protected]>

* refactor: small update

Signed-off-by: satoshi-ota <[email protected]>

* chore: use lower case

Signed-off-by: satoshi-ota <[email protected]>

* refactor: remove redundant function call

Signed-off-by: satoshi-ota <[email protected]>

---------

Signed-off-by: satoshi-ota <[email protected]>
a-maumau pushed a commit to a-maumau/autoware.universe that referenced this pull request Jun 7, 2024
…7045)

* fix(bpp): overwrite turn signal by latter module

Signed-off-by: satoshi-ota <[email protected]>

* fix(avoidance): return previous module turn signal if it's in success state

Signed-off-by: satoshi-ota <[email protected]>

* fix(avoidance): don't output turn signal if there is huge lateral deveation

Signed-off-by: satoshi-ota <[email protected]>

* refactor: small update

Signed-off-by: satoshi-ota <[email protected]>

* chore: use lower case

Signed-off-by: satoshi-ota <[email protected]>

* refactor: remove redundant function call

Signed-off-by: satoshi-ota <[email protected]>

---------

Signed-off-by: satoshi-ota <[email protected]>
shmpwk pushed a commit to tier4/autoware.universe that referenced this pull request Jun 9, 2024
…7045)

* fix(bpp): overwrite turn signal by latter module

Signed-off-by: satoshi-ota <[email protected]>

* fix(avoidance): return previous module turn signal if it's in success state

Signed-off-by: satoshi-ota <[email protected]>

* fix(avoidance): don't output turn signal if there is huge lateral deveation

Signed-off-by: satoshi-ota <[email protected]>

* refactor: small update

Signed-off-by: satoshi-ota <[email protected]>

* chore: use lower case

Signed-off-by: satoshi-ota <[email protected]>

* refactor: remove redundant function call

Signed-off-by: satoshi-ota <[email protected]>

---------

Signed-off-by: satoshi-ota <[email protected]>
shmpwk pushed a commit to tier4/autoware.universe that referenced this pull request Jun 11, 2024
…7045)

* fix(bpp): overwrite turn signal by latter module

Signed-off-by: satoshi-ota <[email protected]>

* fix(avoidance): return previous module turn signal if it's in success state

Signed-off-by: satoshi-ota <[email protected]>

* fix(avoidance): don't output turn signal if there is huge lateral deveation

Signed-off-by: satoshi-ota <[email protected]>

* refactor: small update

Signed-off-by: satoshi-ota <[email protected]>

* chore: use lower case

Signed-off-by: satoshi-ota <[email protected]>

* refactor: remove redundant function call

Signed-off-by: satoshi-ota <[email protected]>

---------

Signed-off-by: satoshi-ota <[email protected]>
shmpwk added a commit to tier4/autoware.universe that referenced this pull request Jun 11, 2024
shmpwk pushed a commit to tier4/autoware.universe that referenced this pull request Jun 11, 2024
…7045)

* fix(bpp): overwrite turn signal by latter module

Signed-off-by: satoshi-ota <[email protected]>

* fix(avoidance): return previous module turn signal if it's in success state

Signed-off-by: satoshi-ota <[email protected]>

* fix(avoidance): don't output turn signal if there is huge lateral deveation

Signed-off-by: satoshi-ota <[email protected]>

* refactor: small update

Signed-off-by: satoshi-ota <[email protected]>

* chore: use lower case

Signed-off-by: satoshi-ota <[email protected]>

* refactor: remove redundant function call

Signed-off-by: satoshi-ota <[email protected]>

---------

Signed-off-by: satoshi-ota <[email protected]>
KhalilSelyan pushed a commit that referenced this pull request Jul 22, 2024
* fix(bpp): overwrite turn signal by latter module

Signed-off-by: satoshi-ota <[email protected]>

* fix(avoidance): return previous module turn signal if it's in success state

Signed-off-by: satoshi-ota <[email protected]>

* fix(avoidance): don't output turn signal if there is huge lateral deveation

Signed-off-by: satoshi-ota <[email protected]>

* refactor: small update

Signed-off-by: satoshi-ota <[email protected]>

* chore: use lower case

Signed-off-by: satoshi-ota <[email protected]>

* refactor: remove redundant function call

Signed-off-by: satoshi-ota <[email protected]>

---------

Signed-off-by: satoshi-ota <[email protected]>
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
None yet
Development

Successfully merging this pull request may close these issues.

4 participants