Skip to content

Commit 9710828

Browse files
authored
feat(intersection): use different expected deceleration for bike/car (#6328)
Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
1 parent 7e53f30 commit 9710828

File tree

4 files changed

+25
-9
lines changed

4 files changed

+25
-9
lines changed

planning/behavior_velocity_intersection_module/config/intersection.param.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@
5656
duration: 3.0
5757
object_dist_to_stopline: 10.0
5858
ignore_on_amber_traffic_light:
59-
object_expected_deceleration: 2.0
59+
object_expected_deceleration:
60+
car: 2.0
61+
bike: 5.0
6062
ignore_on_red_traffic_light:
6163
object_margin_to_path: 2.0
6264
avoid_collision_by_acceleration:

planning/behavior_velocity_intersection_module/src/manager.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,14 @@ IntersectionModuleManager::IntersectionModuleManager(rclcpp::Node & node)
127127
ip.collision_detection.yield_on_green_traffic_light.object_dist_to_stopline =
128128
getOrDeclareParameter<double>(
129129
node, ns + ".collision_detection.yield_on_green_traffic_light.object_dist_to_stopline");
130-
ip.collision_detection.ignore_on_amber_traffic_light.object_expected_deceleration =
130+
ip.collision_detection.ignore_on_amber_traffic_light.object_expected_deceleration.car =
131131
getOrDeclareParameter<double>(
132-
node, ns + ".collision_detection.ignore_on_amber_traffic_light.object_expected_deceleration");
132+
node,
133+
ns + ".collision_detection.ignore_on_amber_traffic_light.object_expected_deceleration.car");
134+
ip.collision_detection.ignore_on_amber_traffic_light.object_expected_deceleration.bike =
135+
getOrDeclareParameter<double>(
136+
node,
137+
ns + ".collision_detection.ignore_on_amber_traffic_light.object_expected_deceleration.bike");
133138
ip.collision_detection.ignore_on_red_traffic_light.object_margin_to_path =
134139
getOrDeclareParameter<double>(
135140
node, ns + ".collision_detection.ignore_on_red_traffic_light.object_margin_to_path");

planning/behavior_velocity_intersection_module/src/scene_intersection.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ class IntersectionModule : public SceneModuleInterface
123123
} yield_on_green_traffic_light;
124124
struct IgnoreOnAmberTrafficLight
125125
{
126-
double object_expected_deceleration;
126+
struct ObjectExpectedDeceleration
127+
{
128+
double car;
129+
double bike;
130+
} object_expected_deceleration;
127131
} ignore_on_amber_traffic_light;
128132
struct IgnoreOnRedTrafficLight
129133
{

planning/behavior_velocity_intersection_module/src/scene_intersection_collision.cpp

+10-5
Original file line numberDiff line numberDiff line change
@@ -176,18 +176,23 @@ void IntersectionModule::updateObjectInfoManagerCollision(
176176
for (auto & object_info : object_info_manager_.attentionObjects()) {
177177
const auto & predicted_object = object_info->predicted_object();
178178
bool safe_under_traffic_control = false;
179+
const auto label = predicted_object.classification.at(0).label;
180+
const auto expected_deceleration =
181+
(label == autoware_auto_perception_msgs::msg::ObjectClassification::MOTORCYCLE ||
182+
label == autoware_auto_perception_msgs::msg::ObjectClassification::BICYCLE)
183+
? planner_param_.collision_detection.ignore_on_amber_traffic_light
184+
.object_expected_deceleration.bike
185+
: planner_param_.collision_detection.ignore_on_amber_traffic_light
186+
.object_expected_deceleration.car;
179187
if (
180188
traffic_prioritized_level == TrafficPrioritizedLevel::PARTIALLY_PRIORITIZED &&
181-
object_info->can_stop_before_stopline(
182-
planner_param_.collision_detection.ignore_on_amber_traffic_light
183-
.object_expected_deceleration)) {
189+
object_info->can_stop_before_stopline(expected_deceleration)) {
184190
safe_under_traffic_control = true;
185191
}
186192
if (
187193
traffic_prioritized_level == TrafficPrioritizedLevel::FULLY_PRIORITIZED &&
188194
object_info->can_stop_before_ego_lane(
189-
planner_param_.collision_detection.ignore_on_amber_traffic_light
190-
.object_expected_deceleration,
195+
expected_deceleration,
191196
planner_param_.collision_detection.ignore_on_red_traffic_light.object_margin_to_path,
192197
ego_lane)) {
193198
safe_under_traffic_control = true;

0 commit comments

Comments
 (0)