-
Notifications
You must be signed in to change notification settings - Fork 661
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
fix(bpp): overwrite turn signal by latter module #7045
Conversation
6298906
to
e46b708
Compare
e46b708
to
adb1c7f
Compare
adb1c7f
to
3d57a61
Compare
@@ -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( |
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.
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())
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
@@ -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; |
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.
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.
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.
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( |
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.
the function can be const
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.
// 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); |
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.
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?
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.
:tashikani:
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.
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_; |
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.
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?
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.
:tashikani:
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.
Signed-off-by: satoshi-ota <[email protected]>
… state Signed-off-by: satoshi-ota <[email protected]>
…eation Signed-off-by: satoshi-ota <[email protected]>
Signed-off-by: satoshi-ota <[email protected]>
Signed-off-by: satoshi-ota <[email protected]>
Signed-off-by: satoshi-ota <[email protected]>
1959d3f
to
2fc8362
Compare
…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]>
…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]>
…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]>
…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]>
…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]>
…ndation#7045)" This reverts commit bf0e56f.
…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]>
* 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]>
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.
After all checkboxes are checked, anyone who has write access can merge the PR.