From 3b35fbc7c7ce09e03db93f697a80ca93ab87b4fb Mon Sep 17 00:00:00 2001 From: Satoshi OTA <44889564+satoshi-ota@users.noreply.github.com> Date: Tue, 13 Aug 2024 20:19:44 +0900 Subject: [PATCH] fix(static_obstacle_avoidance): change avoidance condition (#8433) Signed-off-by: satoshi-ota --- .../src/utils.cpp | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/planning/behavior_path_planner/autoware_behavior_path_static_obstacle_avoidance_module/src/utils.cpp b/planning/behavior_path_planner/autoware_behavior_path_static_obstacle_avoidance_module/src/utils.cpp index f7bda56150b49..4e2a6fc7d2633 100644 --- a/planning/behavior_path_planner/autoware_behavior_path_static_obstacle_avoidance_module/src/utils.cpp +++ b/planning/behavior_path_planner/autoware_behavior_path_static_obstacle_avoidance_module/src/utils.cpp @@ -754,6 +754,46 @@ bool isObviousAvoidanceTarget( } } + if (object.behavior == ObjectData::Behavior::MERGING) { + object.info = ObjectInfo::MERGING_TO_EGO_LANE; + if ( + isOnRight(object) && !object.is_on_ego_lane && + object.overhang_points.front().first < parameters->th_overhang_distance) { + RCLCPP_DEBUG( + rclcpp::get_logger(logger_namespace), + "merging vehicle. but overhang distance is less than threshold."); + return true; + } + if ( + !isOnRight(object) && !object.is_on_ego_lane && + object.overhang_points.front().first > -1.0 * parameters->th_overhang_distance) { + RCLCPP_DEBUG( + rclcpp::get_logger(logger_namespace), + "merging vehicle. but overhang distance is less than threshold."); + return true; + } + } + + if (object.behavior == ObjectData::Behavior::DEVIATING) { + object.info = ObjectInfo::DEVIATING_FROM_EGO_LANE; + if ( + isOnRight(object) && !object.is_on_ego_lane && + object.overhang_points.front().first < parameters->th_overhang_distance) { + RCLCPP_DEBUG( + rclcpp::get_logger(logger_namespace), + "deviating vehicle. but overhang distance is less than threshold."); + return true; + } + if ( + !isOnRight(object) && !object.is_on_ego_lane && + object.overhang_points.front().first > -1.0 * parameters->th_overhang_distance) { + RCLCPP_DEBUG( + rclcpp::get_logger(logger_namespace), + "deviating vehicle. but overhang distance is less than threshold."); + return true; + } + } + if (!object.is_parked) { object.info = ObjectInfo::IS_NOT_PARKING_OBJECT; }