-
Notifications
You must be signed in to change notification settings - Fork 682
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(behavior_path_planner): if ego leaves the current lane turn the signal on #4348
fix(behavior_path_planner): if ego leaves the current lane turn the signal on #4348
Conversation
2fbac43
to
90d20cb
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #4348 +/- ##
=======================================
Coverage 14.78% 14.78%
=======================================
Files 1636 1636
Lines 113602 113594 -8
Branches 34913 34913
=======================================
Hits 16793 16793
+ Misses 77968 77959 -9
- Partials 18841 18842 +1
*This pull request uses carry forward flags. Click here to find out more.
☔ View full report in Codecov by Sentry. |
@beyzanurkaya do we have issue related to this PR? If so please relate these two. Can you also give more detail about the PR as well such as with videos, screenshots, text etc |
for (const auto & cl : *debug_data_.current_lanelets) { | ||
const auto neigbor_lane = planner_data_->route_handler->getAllSharedLineStringLanelets(cl); | ||
for (const auto & lane : neigbor_lane) { | ||
LinearRing2d lane_points; | ||
for (const auto & p : lane.polygon2d().basicPolygon()) { | ||
lane_points.push_back(Point2d(p.x(), p.y())); | ||
} | ||
if (boost::geometry::intersects(path_points, lane_points)) { | ||
if (segment_shift_length > 0.0) { | ||
turn_signal_info.turn_signal.command = TurnIndicatorsCommand::ENABLE_LEFT; | ||
} else { | ||
turn_signal_info.turn_signal.command = TurnIndicatorsCommand::ENABLE_RIGHT; | ||
} | ||
} | ||
} | ||
} |
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.
- I think it better to use the points of shifted_path where in the range of shift segment instead of iterating all the path points.( only the path points between
front_shift_line.start_idx
andfront_shift_line.end_idx
should be enough )
- Instead of using lanelet polygon you can use current lane's right and left bound. (If
segment_shift_length > 0.0
then get left bound and ifsegment_shift_length < 0.0
get right bound ) ✔️
- It is not realistic to use path points for intersection because what matter in this scenario is that vehicle polygon is exceeding the current lane or not (means occupying any neighbor lane). So you should use vehicle dimensions and transform ego polygon to related path points
Edit: If you don't transform ego vehicle polygon onto related path points (related path points explained in the first item) which is what the current implementation does ego vehicle will turn on the signal just only when is actually out of lane. What we want is to signal before the vehicle is actually out of lane bounds.
- Please add some comment lines which explain your purpose ✔️
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.
Instead of using lanelet polygon you can use current lane's right and left bound. (If segment_shift_length > 0.0 then get left bound and if segment_shift_length < 0.0 get right bound )
I think this is simple and good solution to achieve what you want to do, too.
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.
@beyzanurkaya please make sure that you actually applied the necessary changes before you resolve the conversation. 😄 Please take a look at unresolved conversion above.
Hi @beyzanurkaya @mehmetdogru ✋ Sorry for late response, and thanks for you fixing. |
planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp
Outdated
Show resolved
Hide resolved
planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp
Outdated
Show resolved
Hide resolved
planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp
Outdated
Show resolved
Hide resolved
planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp
Outdated
Show resolved
Hide resolved
@satoshi-ota I changed to PR status to draft now since @beyzanurkaya will work on it. |
b7f15b7
to
f86ceea
Compare
208aeec
to
f309b07
Compare
cb3e542
to
72b2791
Compare
3009908
to
09df2cd
Compare
planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp
Outdated
Show resolved
Hide resolved
planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp
Outdated
Show resolved
Hide resolved
planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp
Outdated
Show resolved
Hide resolved
planning/behavior_path_planner/src/scene_module/avoidance/avoidance_module.cpp
Outdated
Show resolved
Hide resolved
539a774
to
f2e6ffa
Compare
Signed-off-by: beyza <[email protected]>
f2e6ffa
to
57d1b2d
Compare
Signed-off-by: beyza <[email protected]>
@satoshi-ota I made some changes could you review again? |
Sure! |
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
fixes: #4470
This PR provides when
turn_signal_on_swerving
param is set to false; if EGO has to leave its lane because of to avoid an obstacle it'll turn the signal onTests performed
Before this PR:
![Screenshot from 2023-08-07 01-17-48](https://private-user-images.githubusercontent.com/32412808/258668159-28f464e1-5c53-4dc1-9c3b-2d0304babaf0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODM4OTcsIm5iZiI6MTczOTI4MzU5NywicGF0aCI6Ii8zMjQxMjgwOC8yNTg2NjgxNTktMjhmNDY0ZTEtNWM1My00ZGMxLTljM2ItMmQwMzA0YmFiYWYwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE0MTk1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBjZWViNzhmNWQzNGE5ODY5Mjg1YmYxZDZjNTk5M2RmOGM2ZjZjZmQyZDk0YTA2ZGI0YThjZDQyZTA0ZTEyYWEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Skhuc2LtsUtz5nNzqhPoOXN-KwDBxf122oOloJKxVgk)
![Screenshot from 2023-08-07 01-17-14](https://private-user-images.githubusercontent.com/32412808/258668160-4e2e53b6-daa8-4e96-b49f-627c5b62fbfe.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyODM4OTcsIm5iZiI6MTczOTI4MzU5NywicGF0aCI6Ii8zMjQxMjgwOC8yNTg2NjgxNjAtNGUyZTUzYjYtZGFhOC00ZTk2LWI0OWYtNjI3YzViNjJmYmZlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDE0MTk1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA2MDk0ZDVkYThiNTFlMDk4NDk4MzA2NzI5YTllMzE4OTQ1OTk5MzMxODUwZTBlZjJlOTZiZjhmMDFhNmU3ZTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.YKCxSxFuQLQScUay-5eNm3-zmgp_YaubaHa-lzjUCGU)
After this PR:
Not applicable.
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.
Summary by CodeRabbit
Release Notes:
turn_signal_on_swerving
parameter in theAvoidanceModule
.IntersectionChecker
class.VehicleFootprint
class.AvoidanceTypes
namespace.AvoidanceModule
,IntersectionChecker
, andVehicleFootprint
classes.