Skip to content

Commit e1eea17

Browse files
committed
feat(avoidance): avoid pedestrian/bicycle near centerline
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent 787fbbd commit e1eea17

File tree

1 file changed

+12
-6
lines changed
  • planning/behavior_path_planner/src/utils/avoidance

1 file changed

+12
-6
lines changed

planning/behavior_path_planner/src/utils/avoidance/utils.cpp

+12-6
Original file line numberDiff line numberDiff line change
@@ -890,12 +890,6 @@ void filterTargetObjects(
890890
}
891891
}
892892

893-
if (!isVehicleTypeObject(o) && isWithinCrosswalk(o, rh->getOverallGraphPtr())) {
894-
o.reason = "CrosswalkUser";
895-
data.other_objects.push_back(o);
896-
continue;
897-
}
898-
899893
// calculate avoid_margin dynamically
900894
// NOTE: This calculation must be after calculating to_road_shoulder_distance.
901895
const double max_avoid_margin = object_parameter.safety_buffer_lateral * o.distance_factor +
@@ -927,6 +921,18 @@ void filterTargetObjects(
927921
}
928922
}
929923

924+
if (!isVehicleTypeObject(o)) {
925+
if (isWithinCrosswalk(o, rh->getOverallGraphPtr())) {
926+
o.reason = "CrosswalkUser";
927+
data.other_objects.push_back(o);
928+
} else {
929+
o.last_seen = now;
930+
o.avoid_margin = avoid_margin;
931+
data.target_objects.push_back(o);
932+
}
933+
continue;
934+
}
935+
930936
const auto stop_time_longer_than_threshold =
931937
o.stop_time > parameters->threshold_time_force_avoidance_for_stopped_vehicle;
932938

0 commit comments

Comments
 (0)