Skip to content

Commit 3dd5f05

Browse files
authored
fix(obstacle_stop): use max_lat_margin_against_unknown only for predicted object (#10269)
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
1 parent 0d4b1ca commit 3dd5f05

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

planning/motion_velocity_planner/autoware_motion_velocity_obstacle_stop_module/config/obstacle_stop.param.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
obstacle_velocity_threshold_from_stop : 3.5 # stop planning is executed to the obstacle whose velocity is less than this value [m/s]
6868

6969
max_lat_margin: 0.3 # lateral margin between the obstacles except for unknown and ego's footprint
70-
max_lat_margin_against_unknown: 0.3 # lateral margin between the unknown obstacles and ego's footprint
70+
max_lat_margin_against_predicted_object_unknown: 0.3 # lateral margin between the predicted object unknown obstacles and ego's footprint
7171

7272
min_velocity_to_reach_collision_point: 2.0 # minimum velocity margin to calculate time to reach collision [m/s]
7373
stop_obstacle_hold_time_threshold : 1.0 # maximum time for holding closest stop obstacle

planning/motion_velocity_planner/autoware_motion_velocity_obstacle_stop_module/src/obstacle_stop_module.cpp

+12-13
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ std::vector<geometry_msgs::msg::Point> ObstacleStopModule::convert_point_cloud_t
303303
const auto min_lat_dist_to_traj_poly =
304304
std::abs(current_lat_dist_from_obstacle_to_traj) - vehicle_info.vehicle_width_m;
305305

306-
if (min_lat_dist_to_traj_poly >= p.max_lat_margin_against_unknown) {
306+
if (min_lat_dist_to_traj_poly >= p.max_lat_margin) {
307307
continue;
308308
}
309309
const auto current_ego_to_obstacle_distance =
@@ -343,18 +343,19 @@ StopObstacle ObstacleStopModule::create_stop_obstacle_for_point_cloud(
343343
autoware_perception_msgs::msg::Shape bounding_box_shape;
344344
bounding_box_shape.type = autoware_perception_msgs::msg::Shape::BOUNDING_BOX;
345345

346-
ObjectClassification unknown_object_classification;
347-
unknown_object_classification.label = ObjectClassification::UNKNOWN;
348-
unknown_object_classification.probability = 1.0;
346+
ObjectClassification unconfigured_object_classification;
349347

350348
const geometry_msgs::msg::Pose unconfigured_pose;
351349
const double unconfigured_lon_vel = 0.;
352350

353351
return StopObstacle{
354-
obj_uuid_str, stamp,
355-
unknown_object_classification, // Since the obstacle is obtained from the point-cloud, the type
356-
// is UNKNOWN
357-
unconfigured_pose, bounding_box_shape, unconfigured_lon_vel, stop_point,
352+
obj_uuid_str,
353+
stamp,
354+
unconfigured_object_classification,
355+
unconfigured_pose,
356+
bounding_box_shape,
357+
unconfigured_lon_vel,
358+
stop_point,
358359
dist_to_collide_on_traj};
359360
}
360361

@@ -486,7 +487,7 @@ std::vector<StopObstacle> ObstacleStopModule::filter_stop_obstacle_for_point_clo
486487
const auto min_lat_dist_to_traj_poly =
487488
std::abs(lat_dist_from_obstacle_to_traj) - vehicle_info.vehicle_width_m;
488489

489-
if (min_lat_dist_to_traj_poly < obstacle_filtering_param_.max_lat_margin_against_unknown) {
490+
if (min_lat_dist_to_traj_poly < obstacle_filtering_param_.max_lat_margin) {
490491
auto stop_obstacle = *itr;
491492
stop_obstacle.dist_to_collide_on_decimated_traj =
492493
autoware::motion_utils::calcSignedArcLength(
@@ -669,9 +670,7 @@ std::optional<StopObstacle> ObstacleStopModule::filter_outside_stop_obstacle_for
669670
}
670671

671672
// 2. filter by lateral distance
672-
const double max_lat_margin = obj_label == ObjectClassification::UNKNOWN
673-
? obstacle_filtering_param_.max_lat_margin_against_unknown
674-
: obstacle_filtering_param_.max_lat_margin;
673+
const double max_lat_margin = get_max_lat_margin(obj_label);
675674
if (dist_from_obj_poly_to_traj_poly < std::max(max_lat_margin, 1e-3)) {
676675
// Obstacle that is not inside of trajectory
677676
return std::nullopt;
@@ -1322,7 +1321,7 @@ std::vector<StopObstacle> ObstacleStopModule::get_closest_stop_obstacles(
13221321
double ObstacleStopModule::get_max_lat_margin(const uint8_t obj_label) const
13231322
{
13241323
if (obj_label == ObjectClassification::UNKNOWN) {
1325-
return obstacle_filtering_param_.max_lat_margin_against_unknown;
1324+
return obstacle_filtering_param_.max_lat_margin_against_predicted_object_unknown;
13261325
}
13271326
return obstacle_filtering_param_.max_lat_margin;
13281327
}

planning/motion_velocity_planner/autoware_motion_velocity_obstacle_stop_module/src/parameters.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ struct ObstacleFilteringParam
8686
double obstacle_velocity_threshold_from_stop{};
8787

8888
double max_lat_margin{};
89-
double max_lat_margin_against_unknown{};
89+
double max_lat_margin_against_predicted_object_unknown{};
9090

9191
double min_velocity_to_reach_collision_point{};
9292
double stop_obstacle_hold_time_threshold{};
@@ -128,8 +128,8 @@ struct ObstacleFilteringParam
128128

129129
max_lat_margin =
130130
get_or_declare_parameter<double>(node, "obstacle_stop.obstacle_filtering.max_lat_margin");
131-
max_lat_margin_against_unknown = get_or_declare_parameter<double>(
132-
node, "obstacle_stop.obstacle_filtering.max_lat_margin_against_unknown");
131+
max_lat_margin_against_predicted_object_unknown = get_or_declare_parameter<double>(
132+
node, "obstacle_stop.obstacle_filtering.max_lat_margin_against_predicted_object_unknown");
133133

134134
min_velocity_to_reach_collision_point = get_or_declare_parameter<double>(
135135
node, "obstacle_stop.obstacle_filtering.min_velocity_to_reach_collision_point");

0 commit comments

Comments
 (0)