Skip to content

Commit

Permalink
fix(lane_change): filter out objects out of lane to fix stopping marg…
Browse files Browse the repository at this point in the history
…in chattering

Signed-off-by: kosuke55 <[email protected]>

use boost intersects

Signed-off-by: kosuke55 <[email protected]>
  • Loading branch information
kosuke55 committed Oct 16, 2023
1 parent b2a5c3f commit 29af126
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,16 @@ void NormalLaneChange::insertStopPoint(
if (v > lane_change_parameters_->stop_velocity_threshold) {
return false;
}

// target_objects includes objects out of target lanes, so filter them out
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;
}

const double distance_to_target_lane_obj = getDistanceAlongLanelet(o.initial_pose.pose);
return stopping_distance_for_obj < distance_to_target_lane_obj &&
distance_to_target_lane_obj < distance_to_ego_lane_obj;
Expand Down

0 comments on commit 29af126

Please sign in to comment.