Skip to content

Commit 57279db

Browse files
authored
feat(out_of_lane): ignore objects coming from behind ego (autowarefoundation#7891) (#1437)
Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp>
1 parent 73ed8b8 commit 57279db

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

planning/motion_velocity_planner/autoware_motion_velocity_out_of_lane_module/config/out_of_lane.param.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
predicted_path_min_confidence : 0.1 # when using predicted paths, ignore the ones whose confidence is lower than this value.
2020
distance_buffer: 1.0 # [m] distance buffer used to determine if a collision will occur in the other lane
2121
cut_predicted_paths_beyond_red_lights: true # if true, predicted paths are cut beyond the stop line of red traffic lights
22+
ignore_behind_ego: true # if true, objects behind the ego vehicle are ignored
2223

2324
overlap:
2425
minimum_distance: 0.0 # [m] minimum distance inside a lanelet for an overlap to be considered

planning/motion_velocity_planner/autoware_motion_velocity_out_of_lane_module/src/filter_predicted_objects.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ autoware_perception_msgs::msg::PredictedObjects filter_predicted_objects(
111111
}) != object.classification.end();
112112
if (is_pedestrian) continue;
113113

114+
const auto is_coming_from_behind =
115+
motion_utils::calcSignedArcLength(
116+
ego_data.trajectory_points, ego_data.first_trajectory_idx,
117+
object.kinematics.initial_pose_with_covariance.pose.position) < 0.0;
118+
if (params.objects_ignore_behind_ego && is_coming_from_behind) {
119+
continue;
120+
}
121+
114122
auto filtered_object = object;
115123
const auto is_invalid_predicted_path = [&](const auto & predicted_path) {
116124
const auto is_low_confidence = predicted_path.confidence < params.objects_min_confidence;

planning/motion_velocity_planner/autoware_motion_velocity_out_of_lane_module/src/out_of_lane_module.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include <map>
3737
#include <memory>
3838
#include <string>
39-
#include <utility>
4039
#include <vector>
4140

4241
namespace autoware::motion_velocity_planner
@@ -85,6 +84,8 @@ void OutOfLaneModule::init_parameters(rclcpp::Node & node)
8584
pp.objects_dist_buffer = getOrDeclareParameter<double>(node, ns_ + ".objects.distance_buffer");
8685
pp.objects_cut_predicted_paths_beyond_red_lights =
8786
getOrDeclareParameter<bool>(node, ns_ + ".objects.cut_predicted_paths_beyond_red_lights");
87+
pp.objects_ignore_behind_ego =
88+
getOrDeclareParameter<bool>(node, ns_ + ".objects.ignore_behind_ego");
8889

8990
pp.overlap_min_dist = getOrDeclareParameter<double>(node, ns_ + ".overlap.minimum_distance");
9091
pp.overlap_extra_length = getOrDeclareParameter<double>(node, ns_ + ".overlap.extra_length");
@@ -132,7 +133,7 @@ void OutOfLaneModule::update_parameters(const std::vector<rclcpp::Parameter> & p
132133
updateParam(
133134
parameters, ns_ + ".objects.cut_predicted_paths_beyond_red_lights",
134135
pp.objects_cut_predicted_paths_beyond_red_lights);
135-
136+
updateParam(parameters, ns_ + ".objects.ignore_behind_ego", pp.objects_ignore_behind_ego);
136137
updateParam(parameters, ns_ + ".overlap.minimum_distance", pp.overlap_min_dist);
137138
updateParam(parameters, ns_ + ".overlap.extra_length", pp.overlap_extra_length);
138139

planning/motion_velocity_planner/autoware_motion_velocity_out_of_lane_module/src/types.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ struct PlannerParam
5656
double objects_min_confidence; // minimum confidence to consider a predicted path
5757
double objects_dist_buffer; // [m] distance buffer used to determine if a collision will occur in
5858
// the other lane
59+
bool objects_ignore_behind_ego; // if true, objects behind the ego vehicle are ignored
5960

6061
double overlap_extra_length; // [m] extra length to add around an overlap range
6162
double overlap_min_dist; // [m] min distance inside another lane to consider an overlap

planning/motion_velocity_planner/autoware_motion_velocity_planner_node/src/node.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ rcl_interfaces::msg::SetParametersResult MotionVelocityPlannerNode::on_set_param
418418
updateParam(parameters, "ego_nearest_dist_threshold", planner_data_.ego_nearest_dist_threshold);
419419
updateParam(parameters, "ego_nearest_yaw_threshold", planner_data_.ego_nearest_yaw_threshold);
420420

421-
set_velocity_smoother_params();
421+
// set_velocity_smoother_params(); TODO(Maxime): fix update parameters of the velocity smoother
422422

423423
rcl_interfaces::msg::SetParametersResult result;
424424
result.successful = true;

0 commit comments

Comments
 (0)