-
Notifications
You must be signed in to change notification settings - Fork 683
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): boundary's nearest search #3716
fix(behavior_path_planner): boundary's nearest search #3716
Conversation
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
for (const bool is_object_right : {true, false}) { | ||
const auto & polygons = is_object_right ? right_polygons : left_polygons; |
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.
This is just a small refactoring
const double squared_segment_length = tier4_autoware_utils::calcSquaredDistance2d(a, b); | ||
if (0 <= dot_val && dot_val <= squared_segment_length) { | ||
const double numerator = std::abs((p.x - a.x) * (a.y - b.y) - (p.y - a.y) * (a.x - b.x)); | ||
const double denominator = std::sqrt(std::pow(a.x - b.x, 2) + std::pow(a.y - b.y, 2)); |
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.
Can we use the squared length of the segment?
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.
Yes, I implemented according to these articles
https://tjkendev.github.io/procon-library/python/geometry/segment_line_point_distance.html
https://qiita.com/kkdd/items/b3c5e06798e59fe2768e
In the first one, if condition uses squared segment length.
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #3716 +/- ##
==========================================
+ Coverage 14.55% 14.65% +0.10%
==========================================
Files 1409 1409
Lines 99298 100126 +828
Branches 29378 29987 +609
==========================================
+ Hits 14457 14678 +221
- Misses 69258 69708 +450
- Partials 15583 15740 +157
*This pull request uses carry forward flags. Click here to find out more.
☔ View full report in Codecov by Sentry. |
…tion#3716) * fix(behavior_path_planner): boundary's nearest search Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
…tion#3716) * fix(behavior_path_planner): boundary's nearest search Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
…tion#3716) * fix(behavior_path_planner): boundary's nearest search Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
…tion#3716) * fix(behavior_path_planner): boundary's nearest search Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
…tion#3716) * fix(behavior_path_planner): boundary's nearest search Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
* feat(dynamic_avoidance): apply LPF to shift length, and positive relative velocity (autowarefoundation#4047) Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * feat(dynamic_avoidance): suppress flickering of dynamic avoidance launching (autowarefoundation#4048) * feat(dynamic_avoidance): suppress flickering of dynamic avoidance launching Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * update config Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * feat(dynamic_avoidance): ignore cut-out vehicle Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * update cut out decision policy Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix(obstacle_avoidance_planner): smooth path connection after optimization (autowarefoundation#3754) * fix(obstacle_avoidance_planner): smooth path connection after optimization Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix(obstacle_avoidance_planner): fix optimization constraint for narrow-road driving (autowarefoundation#3701) Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix(lane_change): copy drivable area info (autowarefoundation#3738) Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> * feat(map_based_prediction): suppress lane change decision flickering (autowarefoundation#3788) Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * feat(map_based_prediction): disable time delay compensation (autowarefoundation#3806) * disable time delay compensation Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> * fix unused parameter Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> * fix lane change decision not working problem due to empty future_lanenet in unconnected lanelets Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> --------- Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> * fix(behavior_path_planner): boundary's nearest search (autowarefoundation#3716) * fix(behavior_path_planner): boundary's nearest search Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix(behavior_path_planner): extract backward obstacles correctly (autowarefoundation#3719) Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix(behavior_path_planner): extract obstacles from drivable area without intersection (autowarefoundation#3741) * fix(behavior_path_planner): extract obstacles from drivable area without intersection Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * update Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * update map_based_prediction method Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix(avoidance): fix invalid cherry pick Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com> Co-authored-by: Satoshi OTA <44889564+satoshi-ota@users.noreply.github.com> Co-authored-by: Yoshi Ri <yoshiyoshidetteiu@gmail.com> Co-authored-by: satoshi-ota <satoshi.ota928@gmail.com>
Description
In the following case, the boundary's nearest index search is calculated wrong.
![image](https://private-user-images.githubusercontent.com/20228327/238318994-0d238a23-c752-4d29-9005-0224f7da3098.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzNTU1MDMsIm5iZiI6MTczOTM1NTIwMywicGF0aCI6Ii8yMDIyODMyNy8yMzgzMTg5OTQtMGQyMzhhMjMtYzc1Mi00ZDI5LTkwMDUtMDIyNGY3ZGEzMDk4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDEwMTMyM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY4YTA3Yjk2ODAwMGEwMjY2NDgzNTZmYzEyNjc5ZDUxYWY2NTRiNDNhNjk2YjhlMjgxNmFkMjdiZDc2OGQ1N2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ruSXe_rCJLl0CmedZHAfPpbzW5W4Ty9Fq6NOXVZ2lVA)
I fixed this issue by calculating the minimum distance from each segment on bound and the target point (ego pose in this case).
This issue happens when avoiding objects with the motion planner by extracting objects from the drivable area.
Tests performed
planning simulator
Effects on system behavior
No change behavior
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.