-
Notifications
You must be signed in to change notification settings - Fork 678
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(avoidance): turn off blinker when the ego return original lane #6300
fix(avoidance): turn off blinker when the ego return original lane #6300
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6300 +/- ##
==========================================
- Coverage 14.64% 14.64% -0.01%
==========================================
Files 1899 1899
Lines 130283 130303 +20
Branches 38311 38324 +13
==========================================
+ Hits 19082 19083 +1
- Misses 89785 89802 +17
- Partials 21416 21418 +2
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. |
337e87e
to
4f6e857
Compare
4f6e857
to
47f7d3e
Compare
@@ -250,16 +250,37 @@ void pushUniqueVector(T & base_vector, const T & additional_vector) | |||
base_vector.insert(base_vector.end(), additional_vector.begin(), additional_vector.end()); | |||
} | |||
|
|||
bool isAvoidShift(const double start_shift_length, const double end_shift_length) | |||
{ | |||
constexpr double THRESHOLD = 0.1; |
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.
bool isAvoidShift(const double start_shift_length, const double end_shift_length, const double THRESHOLD = 0.1)
{
return std::abs(start_shift_length) < THRESHOLD && std::abs(end_shift_length) > THRESHOLD;
}
Personally, I would wonder if it is helpful to make threshold a "default" argument for these functions?
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.
@Owen-Liuyuxuan Thanks for your comment.
I found sutable params for this threshold. So, I'll fix implementation to use it.
https://github.com/satoshi-ota/autoware_launch/blob/0cd5d891a36ac34a32a417205905c109f2bafe7b/autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/behavior_path_planner/behavior_path_planner.param.yaml#L22
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 e677db4.
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.
Thank you. I have no further questions now.
@@ -2286,7 +2324,7 @@ double calcDistanceToReturnDeadLine( | |||
return distance_to_return_dead_line; | |||
} | |||
|
|||
TurnSignalInfo calcTurnSignalInfo( | |||
std::pair<TurnSignalInfo, bool> calcTurnSignalInfo( |
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.
Thanks for the refactoring.
Personally, with the current change, I would suggest renaming this THRESHOLD
into something like current_shift_threshold
because it is no longer a "general" threshold in this calcTurnSignalInfo
function.
(I am not familiar with the extra influences of renaming this parameter, so it is just a small idea on readability)
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 e677db4.
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.
Aside from Liu-san comments, LGTM
for (const auto & lane : original_lanes) { | ||
if (within(to2D(toLaneletPoint(ego_pos)), lane.polygon2d().basicPolygon())) { | ||
return true; | ||
} | ||
} | ||
|
||
return false; |
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.
personally I would suggest std::any_of
for this part.
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 a52553a.
47f7d3e
to
a52553a
Compare
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]>
a52553a
to
2114b0e
Compare
…utowarefoundation#6300) * refactor(path_shifter): add id to ShiftLine Signed-off-by: satoshi-ota <[email protected]> * fix(avoidance): turn off blinker when the ego return original lane Signed-off-by: satoshi-ota <[email protected]> * fix(avoidance): use threshold param Signed-off-by: satoshi-ota <[email protected]> * fix(avoidance): use lambda Signed-off-by: satoshi-ota <[email protected]> --------- Signed-off-by: satoshi-ota <[email protected]>
…6300) * refactor(path_shifter): add id to ShiftLine Signed-off-by: satoshi-ota <[email protected]> * fix(avoidance): turn off blinker when the ego return original lane Signed-off-by: satoshi-ota <[email protected]> * fix(avoidance): use threshold param Signed-off-by: satoshi-ota <[email protected]> * fix(avoidance): use lambda Signed-off-by: satoshi-ota <[email protected]> --------- Signed-off-by: satoshi-ota <[email protected]> Signed-off-by: Kotaro Yoshimoto <[email protected]>
…utowarefoundation#6300) * refactor(path_shifter): add id to ShiftLine Signed-off-by: satoshi-ota <[email protected]> * fix(avoidance): turn off blinker when the ego return original lane Signed-off-by: satoshi-ota <[email protected]> * fix(avoidance): use threshold param Signed-off-by: satoshi-ota <[email protected]> * fix(avoidance): use lambda Signed-off-by: satoshi-ota <[email protected]> --------- Signed-off-by: satoshi-ota <[email protected]>
…utowarefoundation#6300) * refactor(path_shifter): add id to ShiftLine Signed-off-by: satoshi-ota <[email protected]> * fix(avoidance): turn off blinker when the ego return original lane Signed-off-by: satoshi-ota <[email protected]> * fix(avoidance): use threshold param Signed-off-by: satoshi-ota <[email protected]> * fix(avoidance): use lambda Signed-off-by: satoshi-ota <[email protected]> --------- Signed-off-by: satoshi-ota <[email protected]>
Description
Previously, avoidance module continued to turn on blinker until the ego returned original path completely. Sometimes, the module keeped turn signal even when the ego stopped in front of intersection due to red traffic light. However, the signal maybe causes misunderstanding that the ego is going to turn left or right at the intersection.
In this PR, I fixed turn signal calculation logic in order to disable turn signal if the ego stopped in original lane.
simplescreenrecorder-2024-02-05_10.59.41.mp4
Tests performed
Effects on system behavior
Nothing.
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.