Skip to content

Commit d0af96e

Browse files
committed
fix(avoidance): add flag to identify ambiguous vehicle
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent 7f460ab commit d0af96e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

planning/behavior_path_avoidance_module/include/behavior_path_avoidance_module/data_structs.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,9 @@ struct ObjectData // avoidance target
423423
// is driving on ego current lane
424424
bool is_on_ego_lane{false};
425425

426+
// is ambiguou stopped vehicle.
427+
bool is_ambiguous{false};
428+
426429
// object direction.
427430
Direction direction{Direction::NONE};
428431

planning/behavior_path_avoidance_module/src/utils.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -625,15 +625,11 @@ bool isParkedVehicle(
625625
return is_left_side_parked_vehicle || is_right_side_parked_vehicle;
626626
}
627627

628-
bool isForceAvoidanceTarget(
628+
bool isAmbiguousStoppedVehicle(
629629
ObjectData & object, const AvoidancePlanningData & data,
630630
const std::shared_ptr<const PlannerData> & planner_data,
631631
const std::shared_ptr<AvoidanceParameters> & parameters)
632632
{
633-
if (!parameters->enable_force_avoidance_for_stopped_vehicle) {
634-
return false;
635-
}
636-
637633
const auto stop_time_longer_than_threshold =
638634
object.stop_time > parameters->threshold_time_force_avoidance_for_stopped_vehicle;
639635

@@ -796,9 +792,10 @@ bool isSatisfiedWithVehicleCondition(
796792
{
797793
object.behavior = getObjectBehavior(object, parameters);
798794
object.is_on_ego_lane = isOnEgoLane(object);
795+
object.is_ambiguous = isAmbiguousStoppedVehicle(object, data, planner_data, parameters);
799796

800797
// from here condition check for vehicle type objects.
801-
if (isForceAvoidanceTarget(object, data, planner_data, parameters)) {
798+
if (object.is_ambiguous && parameters->enable_force_avoidance_for_stopped_vehicle) {
802799
return true;
803800
}
804801

0 commit comments

Comments
 (0)