Skip to content

Commit

Permalink
fix(behavior_path_planner_common): use boost intersects instead of ov…
Browse files Browse the repository at this point in the history
…erlaps (#9289)

* fix(behavior_path_planner_common): use boost intersects instead of overlaps

Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>

* Update planning/behavior_path_planner/autoware_behavior_path_planner_common/src/utils/path_safety_checker/safety_check.cpp

Co-authored-by: Go Sakayori <go-sakayori@users.noreply.github.com>

---------

Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
Co-authored-by: Go Sakayori <go-sakayori@users.noreply.github.com>
  • Loading branch information
kosuke55 and go-sakayori authored Nov 11, 2024
1 parent f5463c0 commit 70b6f19
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ bool checkSafetyWithIntegralPredictedPolygon(
CollisionCheckDebugPair debug_pair = createObjectDebug(object);
for (const auto & path : object.predicted_paths) {
for (const auto & pose_with_poly : path.path) {
if (boost::geometry::overlaps(ego_integral_polygon, pose_with_poly.poly)) {
if (boost::geometry::intersects(ego_integral_polygon, pose_with_poly.poly)) {
debug_pair.second.ego_predicted_path = ego_predicted_path; // raw path
debug_pair.second.obj_predicted_path = path.path; // raw path
debug_pair.second.extended_obj_polygon = pose_with_poly.poly;
Expand Down Expand Up @@ -604,8 +604,8 @@ std::vector<Polygon2d> get_collided_polygons(
const double yaw_difference = autoware::universe_utils::normalizeRadian(ego_yaw - object_yaw);
if (std::abs(yaw_difference) > yaw_difference_th) continue;

// check overlap
if (boost::geometry::overlaps(ego_polygon, obj_polygon)) {
// check intersects
if (boost::geometry::intersects(ego_polygon, obj_polygon)) {
debug.unsafe_reason = "overlap_polygon";
collided_polygons.push_back(obj_polygon);

Expand Down Expand Up @@ -658,8 +658,8 @@ std::vector<Polygon2d> get_collided_polygons(
: createExtendedPolygon(
obj_pose_with_poly, lon_offset, lat_margin, is_stopped_object, debug);

// check overlap with extended polygon
if (boost::geometry::overlaps(extended_ego_polygon, extended_obj_polygon)) {
// check intersects with extended polygon
if (boost::geometry::intersects(extended_ego_polygon, extended_obj_polygon)) {
debug.unsafe_reason = "overlap_extended_polygon";
collided_polygons.push_back(obj_polygon);

Expand Down

0 comments on commit 70b6f19

Please sign in to comment.