Skip to content

Commit b630838

Browse files
authoredApr 30, 2024
fix(avoidance): don't avoid merging/deviating vehicle whose overhang distance is larger than threshold (#6808)
* fix(avoidance): add target filtering threshold for merging/deviating vehicle Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> * fix(avoidance): apply logic only for non-parked vehicle Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> * fix(avoidance): align logger namespace Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> --------- Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent 766b1b1 commit b630838

File tree

5 files changed

+61
-0
lines changed

5 files changed

+61
-0
lines changed
 

‎planning/behavior_path_avoidance_module/config/avoidance.param.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@
132132
th_shiftable_ratio: 0.8 # [-]
133133
min_road_shoulder_width: 0.5 # [m] FOR DEVELOPER
134134

135+
# for merging/deviating vehicle
136+
merging_vehicle:
137+
th_overhang_distance: 0.0 # [m]
138+
135139
# params for avoidance of vehicle type objects that are ambiguous as to whether they are parked.
136140
avoidance_for_ambiguous_vehicle:
137141
enable: true # [-]

‎planning/behavior_path_avoidance_module/include/behavior_path_avoidance_module/data_structs.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ struct AvoidanceParameters
189189
double time_threshold_for_ambiguous_vehicle{0.0};
190190
double distance_threshold_for_ambiguous_vehicle{0.0};
191191

192+
// for merging/deviating vehicle
193+
double th_overhang_distance{0.0};
194+
192195
// parameters for safety check area
193196
bool enable_safety_check{false};
194197
bool check_current_lane{false};

‎planning/behavior_path_avoidance_module/schema/avoidance.schema.json

+13
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,18 @@
681681
],
682682
"additionalProperties": false
683683
},
684+
"merging_vehicle": {
685+
"type": "object",
686+
"properties": {
687+
"th_overhang_distance": {
688+
"type": "number",
689+
"description": "Distance threshold between overhang point and ego lane's centerline. If the nearest overhang point of merging/deviating vehicle is less than this param, the module never avoid it. (Basically, the ego stops behind of it.)",
690+
"default": 0.5
691+
}
692+
},
693+
"required": ["th_overhang_distance"],
694+
"additionalProperties": false
695+
},
684696
"parked_vehicle": {
685697
"type": "object",
686698
"properties": {
@@ -803,6 +815,7 @@
803815
"object_check_return_pose_distance",
804816
"max_compensation_time",
805817
"detection_area",
818+
"merging_vehicle",
806819
"parked_vehicle",
807820
"avoidance_for_ambiguous_vehicle",
808821
"intersection"

‎planning/behavior_path_avoidance_module/src/debug.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ MarkerArray createDebugMarkerArray(
578578
addObjects(data.other_objects, std::string("TooNearToGoal"));
579579
addObjects(data.other_objects, std::string("ParallelToEgoLane"));
580580
addObjects(data.other_objects, std::string("MergingToEgoLane"));
581+
addObjects(data.other_objects, std::string("DeviatingFromEgoLane"));
581582
addObjects(data.other_objects, std::string("UnstableObject"));
582583
addObjects(data.other_objects, std::string("AmbiguousStoppedVehicle"));
583584
addObjects(data.other_objects, std::string("AmbiguousStoppedVehicle(wait-and-see)"));

‎planning/behavior_path_avoidance_module/src/utils.cpp

+40
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,46 @@ bool isNeverAvoidanceTarget(
583583
}
584584
}
585585

586+
if (object.behavior == ObjectData::Behavior::MERGING) {
587+
object.reason = "MergingToEgoLane";
588+
if (
589+
isOnRight(object) && !object.is_parked &&
590+
object.overhang_points.front().first > parameters->th_overhang_distance) {
591+
RCLCPP_DEBUG(
592+
rclcpp::get_logger(logger_namespace),
593+
"merging vehicle. but overhang distance is larger than threshold.");
594+
return true;
595+
}
596+
if (
597+
!isOnRight(object) && !object.is_parked &&
598+
object.overhang_points.front().first < -1.0 * parameters->th_overhang_distance) {
599+
RCLCPP_DEBUG(
600+
rclcpp::get_logger(logger_namespace),
601+
"merging vehicle. but overhang distance is larger than threshold.");
602+
return true;
603+
}
604+
}
605+
606+
if (object.behavior == ObjectData::Behavior::DEVIATING) {
607+
object.reason = "DeviatingFromEgoLane";
608+
if (
609+
isOnRight(object) && !object.is_parked &&
610+
object.overhang_points.front().first > parameters->th_overhang_distance) {
611+
RCLCPP_DEBUG(
612+
rclcpp::get_logger(logger_namespace),
613+
"deviating vehicle. but overhang distance is larger than threshold.");
614+
return true;
615+
}
616+
if (
617+
!isOnRight(object) && !object.is_parked &&
618+
object.overhang_points.front().first < -1.0 * parameters->th_overhang_distance) {
619+
RCLCPP_DEBUG(
620+
rclcpp::get_logger(logger_namespace),
621+
"deviating vehicle. but overhang distance is larger than threshold.");
622+
return true;
623+
}
624+
}
625+
586626
if (object.is_on_ego_lane) {
587627
const auto right_lane =
588628
planner_data->route_handler->getRightLanelet(object.overhang_lanelet, true, false);

0 commit comments

Comments
 (0)