Skip to content

Commit

Permalink
use boost intersects
Browse files Browse the repository at this point in the history
Signed-off-by: kosuke55 <[email protected]>
  • Loading branch information
kosuke55 committed Oct 16, 2023
1 parent 72b63eb commit 8024d6d
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,11 @@ void NormalLaneChange::insertStopPoint(
}

// target_objects includes objects out of target lanes, so filter them out
const auto polygon =
tier4_autoware_utils::toPolygon2d(o.initial_pose.pose, o.shape).outer();
if (std::all_of(polygon.begin(), polygon.end(), [&](const auto & polygon_p) {
auto footprint_pose = o.initial_pose.pose;
footprint_pose.position = tier4_autoware_utils::createPoint(
polygon_p.x(), polygon_p.y(), footprint_pose.position.z);
return !utils::isInLanelets(footprint_pose, status_.target_lanes);
})) {
if (!boost::geometry::intersects(
tier4_autoware_utils::toPolygon2d(o.initial_pose.pose, o.shape).outer(),
lanelet::utils::combineLaneletsShape(status_.target_lanes)
.polygon2d()
.basicPolygon())) {
return false;
}

Expand Down

0 comments on commit 8024d6d

Please sign in to comment.