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 (#5321)

* fix(lane_change): filter out objects out of lane to fix stopping margin chattering

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

* use boost intersects

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

---------

Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
  • Loading branch information
kosuke55 authored Oct 17, 2023
1 parent fb35f62 commit 738c376
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,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 738c376

Please sign in to comment.