Skip to content

Commit 572b9f6

Browse files
committed
fix(avoidance): avoid merging vehicle if it's NOT on ego lane.
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent b8c9701 commit 572b9f6

File tree

1 file changed

+10
-0
lines changed
  • planning/behavior_path_avoidance_module/src

1 file changed

+10
-0
lines changed

planning/behavior_path_avoidance_module/src/utils.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,10 @@ bool isForceAvoidanceTarget(
618618
const std::shared_ptr<const PlannerData> & planner_data,
619619
const std::shared_ptr<AvoidanceParameters> & parameters)
620620
{
621+
using boost::geometry::within;
622+
using lanelet::utils::to2D;
623+
using lanelet::utils::conversion::toLaneletPoint;
624+
621625
if (!parameters->enable_force_avoidance_for_stopped_vehicle) {
622626
return false;
623627
}
@@ -653,6 +657,12 @@ bool isForceAvoidanceTarget(
653657
}
654658

655659
const auto & ego_pose = planner_data->self_odometry->pose.pose;
660+
const auto on_ego_driving_lane = within(
661+
to2D(toLaneletPoint(object_pose.position)).basicPoint(),
662+
object.overhang_lanelet.polygon2d().basicPolygon());
663+
if (!on_ego_driving_lane) {
664+
return true;
665+
}
656666

657667
// force avoidance for stopped vehicle
658668
bool not_parked_object = true;

0 commit comments

Comments
 (0)