Skip to content

Commit

Permalink
fix(lane_change): output lane change path even if the start point is …
Browse files Browse the repository at this point in the history
…in target lane (autowarefoundation#4707)

Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota authored Aug 22, 2023
1 parent 8efd31c commit df6bfb4
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,16 @@ bool NormalLaneChange::getLaneChangePaths(
const lanelet::BasicPoint2d lc_start_point(
prepare_segment.points.back().point.pose.position.x,
prepare_segment.points.back().point.pose.position.y);
if (!boost::geometry::covered_by(lc_start_point, target_neighbor_preferred_lane_poly_2d)) {

const auto target_lane_polygon = lanelet::utils::getPolygonFromArcLength(
target_lanes, 0, std::numeric_limits<double>::max());
const auto target_lane_poly_2d = lanelet::utils::to2D(target_lane_polygon).basicPolygon();

const auto is_valid_start_point =
boost::geometry::covered_by(lc_start_point, target_neighbor_preferred_lane_poly_2d) ||
boost::geometry::covered_by(lc_start_point, target_lane_poly_2d);

if (!is_valid_start_point) {
// lane changing points are not inside of the target preferred lanes or its neighbors
continue;
}
Expand Down

0 comments on commit df6bfb4

Please sign in to comment.