Skip to content

Commit 7887d8a

Browse files
satoshi-otaTomohitoAndo
authored andcommitted
fix(avoidance): update filtering logic for non-vehicle (autowarefoundation#6206)
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent c6047a7 commit 7887d8a

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

planning/behavior_path_avoidance_module/src/debug.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,7 @@ MarkerArray createDebugMarkerArray(
557557
addObjects(data.other_objects, std::string("TooNearToGoal"));
558558
addObjects(data.other_objects, std::string("ParallelToEgoLane"));
559559
addObjects(data.other_objects, std::string("MergingToEgoLane"));
560+
addObjects(data.other_objects, std::string("UnstableObject"));
560561
}
561562

562563
// shift line pre-process

planning/behavior_path_avoidance_module/src/utils.cpp

+25-4
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,15 @@ bool isSafetyCheckTargetObjectType(
369369
return parameters->object_parameters.at(object_type).is_safety_check_target;
370370
}
371371

372-
bool isVehicleTypeObject(const ObjectData & object)
372+
bool isUnknownTypeObject(const ObjectData & object)
373373
{
374374
const auto object_type = utils::getHighestProbLabel(object.object.classification);
375+
return object_type == ObjectClassification::UNKNOWN;
376+
}
375377

376-
if (object_type == ObjectClassification::UNKNOWN) {
377-
return false;
378-
}
378+
bool isVehicleTypeObject(const ObjectData & object)
379+
{
380+
const auto object_type = utils::getHighestProbLabel(object.object.classification);
379381

380382
if (object_type == ObjectClassification::PEDESTRIAN) {
381383
return false;
@@ -722,6 +724,15 @@ bool isSatisfiedWithNonVehicleCondition(
722724
return false;
723725
}
724726

727+
// Object is on center line -> ignore.
728+
const auto & object_pose = object.object.kinematics.initial_pose_with_covariance.pose;
729+
object.to_centerline =
730+
lanelet::utils::getArcCoordinates(data.current_lanelets, object_pose).distance;
731+
if (std::abs(object.to_centerline) < parameters->threshold_distance_object_is_on_center) {
732+
object.reason = AvoidanceDebugFactor::TOO_NEAR_TO_CENTERLINE;
733+
return false;
734+
}
735+
725736
return true;
726737
}
727738

@@ -1625,6 +1636,16 @@ void filterTargetObjects(
16251636
o.to_road_shoulder_distance = filtering_utils::getRoadShoulderDistance(o, data, planner_data);
16261637
o.avoid_margin = filtering_utils::getAvoidMargin(o, planner_data, parameters);
16271638

1639+
// TODO(Satoshi Ota) parametrize stop time threshold if need.
1640+
constexpr double STOP_TIME_THRESHOLD = 3.0; // [s]
1641+
if (filtering_utils::isUnknownTypeObject(o)) {
1642+
if (o.stop_time < STOP_TIME_THRESHOLD) {
1643+
o.reason = "UnstableObject";
1644+
data.other_objects.push_back(o);
1645+
continue;
1646+
}
1647+
}
1648+
16281649
if (filtering_utils::isNoNeedAvoidanceBehavior(o, parameters)) {
16291650
data.other_objects.push_back(o);
16301651
continue;

0 commit comments

Comments
 (0)