-
Notifications
You must be signed in to change notification settings - Fork 673
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): add distance to returned point in avoidance module #915
fix(behavior_path_planner): add distance to returned point in avoidance module #915
Conversation
Codecov Report
@@ Coverage Diff @@
## main #915 +/- ##
========================================
- Coverage 9.55% 9.43% -0.12%
========================================
Files 935 935
Lines 57795 58663 +868
Branches 10430 10609 +179
========================================
+ Hits 5522 5537 +15
- Misses 47734 48558 +824
- Partials 4539 4568 +29
*This pull request uses carry forward flags. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: jack.song <jack.song@autocore.ai>
Signed-off-by: jack.song <jack.song@autocore.ai>
@zulfaqar-azmi-t4 @TakaHoribe ,can you review this pr ? I add distance by considering the length of obstacle and the lane to the returned point in the avoidance module of behavior_path_planner. |
Signed-off-by: jack.song <jack.song@autocore.ai>
Signed-off-by: jack.song <jack.song@autocore.ai>
@shulanbushangshu |
const auto dx = check_point.x() - object_pose.position.x; | ||
const auto dy = check_point.y() - object_pose.position.y; | ||
const Eigen::Vector3d diff_vec{dx, dy, 0}; | ||
const Eigen::Vector3d cross_vec = base_unit_vec.cross(diff_vec); |
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.
@shulanbushangshu
Thank you for description can you also add how long is "distance_add_to_returnpoint" ?
and I suggest these changes (please give me opinion if I'm wrong.)
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.
@taikitanaka3
Yes,you are right.In the changes,the "distance_add_to_returnpoint" is calculated according to the check points (including the intersections of the obstacle and the lane boundary, and the contour point of the obstacle within the lane).
The "distance_add_to_returnpoint" can be as longitudinal_collision_margin.
The schematic of the "distance_add_to_returnpoint" is shown below:
In the code,I use the check points to calculate the maximum distance in the "object_closest_pose" point direction.The maximum distance is the "distance_add_to_returnpoint"
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.
@shulanbushangshu
can you add better name for check point or add description to readme?
@zulfaqar-azmi-t4
can you share figures with @shulanbushangshu used in readme?
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.
@taikitanaka3
Yes, this is the drawio file.
@shulanbushangshu end_of_line.mp4 |
ap_return.start_longitudinal = o.longitudinal; | ||
ap_return.end_longitudinal = | ||
o.longitudinal + std::min(nominal_return_distance, return_remaining_distance); | ||
ap_return.start_longitudinal = o.longitudinal + o.distance_add_to_returnpoint; |
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.
@shulanbushangshu
why do you add longitudinal distance to start _longitudinal?
ap_return.start_longitudinal = o.longitudinal; | ||
ap_return.end_longitudinal = | ||
o.longitudinal + std::min(nominal_return_distance, return_remaining_distance); | ||
ap_return.start_longitudinal = o.longitudinal + o.distance_add_to_returnpoint; |
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.
@shulanbushangshu
why do you add longitudinal margin to start _longitudinal?
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.
@taikitanaka3
I want to separate the longitudinal end of the starting point from the longitudinal start of the return point so that "BC" can maintain the maximum offset.
.
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.
@shulanbushangshu
My apologies, I might misunderstood your intention. Assuming I take this image as the example, it essentially mean you're shifting the start_longitudinal pose from point B to point C.
Is it possible if you can provide some sketch (simple is also fine) regarding maintaining the maximum offset for "BC so that we can better understand the situation?
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.
@zulfaqar-azmi-t4 @taikitanaka3
Thank you for your review.Let me briefly describe the process of issue#833:
In the process of obstacle avoidance simulation, I found that the default lateral safety margin was a little large. When the intersection between obstacle and lane was very small, there would be an offset of about 1.5m, as shown in the figure below.
Therefore, I changed the default lateral safety margin and conducted simulation on this basis.There are two variables :''lateral_collision_margin" and "lateral_collision_safety_buffer".I set "lateral_collision_safety_buffer" to 0.0.
In the following simulation, issue#833 occurs, as shown below:
Of course, if the lateral safety distance margin is enlarged, there may be no collision. But I think it is possible to reduce the risk of parameter adjustment by calculating the compensation amount of a longitudinal distance.According to the above situation, I calculated the compensation amount of the longitudinal distance according to the obstacles and lanes.I want to separate the longitudinal end of the starting point from the longitudinal start of the return point so that "BC" can maintain the maximum offset.
The distance is calculated as follows:
In this example,the 'distance_add_to_returnpoint'='d2'+'d4'.
Calculation principle: calculate the minimum distance and maximum distance from the contour point and intersection point to the reference point. The maximum distance minus the minimum distance is used as the compensation distance.
Please consider whether my idea is necessary and correct.
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.
@shulanbushangshu
About this image, the result indeed seems weird. it is possible for you to reproduce them with the debug marker publish_debug_marker=true
in the avoidance.param.yaml
, add the marker to rviz
via planning
> lane_driving
> scenario_planning
> behavior_planning
>
behavior_path_planner
> debug
> marker
> MarkerArray
and share the image with us? And if it's okay, avoidance.param.yaml
file as well.
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.
@shulanbushangshu
I've tested your code but it looks like something wrong, I set lateral collision safety margin to zero as you tested
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.
In your algorithm I think you also need to add margin for start longitudinal too according to collision of foot print and lanelet.
I added relatively light way to make collision margin.
#1041
And please be careful for computation cost for many object case
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.
@zulfaqar-azmi-t4 @taikitanaka3
Thank you for reviewing.
This is the debug marker:
@taikitanaka3 ,you are right.I forgot to change the vertical distance of the starting point.I will fix it.
The two issues((#833,#934)) I raised are aimed at different problems.
The first is to solve the problem of early return (there will be problems if there are long obstacles).
The second is to solve the offset distance (there may be problems in calculating the offset distance in some cases) We also consider the points on the contour of the obstacle and the distance to the boundary. I think it is necessary to modify the calculation method of lateral offset distance.
To sum up, the first issue can be solved by longitudinal distance compensation; The second issue can be solved by lateral distance compensation.
Of course, the above two problems will lead to the risk of collision. In this PR, only the first issue is solved.
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.
@shulanbushangshu
Good, but at first I want to merge fix PR for considering vehicle size in frenet-coordinate is it ok?
your PR looks like new feature that we haven't tested yet.(for the reason you change first avoid point and second return point according to the collision of lanelet and collision edge case is not fully defined or tested yet)
#1041 (comment)
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.
@taikitanaka3.No problem
… with crosswalk (autowarefoundation#915) fix(behavior_velocity_crosswalk_module): stop at stop line associated with crosswalk (autowarefoundation#5231) don't consider margin when stop line is found Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
…params (autowarefoundation#915) * chore: separate param files Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp> * chore: fix launch Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp> * chore: rearrange param Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp> * style(pre-commit): autofix * refactor: rearrange param file Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp> * chore: move densification_params Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp> * style(pre-commit): autofix * fix(centerpoint): align param namespace with pointpainting Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp> * fix: param Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp> * fix: remove build_only from yaml Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp> --------- Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Description
To solve #833
We can calculate the maximum longitudinal distance in the direction of the lane according to the part of the obstacle in the lane. Append the calculated maximum longitudinal distance to the longitudinal starting distance of the return point.
The schematic of the change is shown below:
Related links
#833
Tests performed
1.Run planning_simulator.
2.place ego position and goal
3. Set a obstacle near lanes
4. result -- the path will maintain the calculated offset for the horizontal distance where obstacle is present
Notes for reviewers
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.