Skip to content

Commit 58ece82

Browse files
feat(behavior_velocity_run_out_module): exclude obstacle crossing ego back line (autowarefoundation#6680)
* add method to ignore target obstacles that cross ego cut lane Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * WIP add debug support Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * add params and finish debug marker Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * change lane to line Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * use autoware utils to get the cut line Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * simplify code wit calcOffsetPose Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * Update readme and eliminate unused code Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * update readme Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * eliminate unused function Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * readme Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * comments and readme Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * eliminate unused include Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * typo Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * rename param for consistency Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * change lane to line for consistency Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * rename for clarity, add brief Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * fix indentation Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * update description Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * lane ->line Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> * lane -> line Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com> --------- Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
1 parent 5e7f763 commit 58ece82

File tree

10 files changed

+235
-6
lines changed

10 files changed

+235
-6
lines changed

planning/behavior_velocity_run_out_module/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ You can choose whether to use this feature by parameter of `use_partition_lanele
108108

109109
![brief](./docs/exclude_obstacles_by_partition.svg)
110110

111+
##### Exclude obstacles that cross the ego vehicle's "cut line"
112+
113+
This module can exclude obstacles that have predicted paths that will cross the back side of the ego vehicle. It excludes obstacles if their predicted path crosses the ego's "cut line". The "cut line" is a virtual line segment that is perpendicular to the ego vehicle and that passes through the ego's base link.
114+
115+
You can choose whether to use this feature by setting the parameter `use_ego_cut_line` to `true` or `false`. The width of the line can be tuned with the parameter `ego_cut_line_length`.
116+
117+
![brief](./docs/ego_cut_line.svg)
118+
111119
#### Collision detection
112120

113121
##### Detect collision with dynamic obstacles

planning/behavior_velocity_run_out_module/config/run_out.param.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
use_partition_lanelet: true # [-] whether to use partition lanelet map data
66
suppress_on_crosswalk: true # [-] whether to suppress on crosswalk lanelet:
77
specify_decel_jerk: false # [-] whether to specify jerk when ego decelerates
8+
use_ego_cut_line: true # [-] filter obstacles that pass the backside of ego: if a dynamic obstacle's predicted path intersects this line, it is ignored
89
stop_margin: 2.5 # [m] the vehicle decelerates to be able to stop with this margin
910
passing_margin: 1.1 # [m] the vehicle begins to accelerate if the vehicle's front in predicted position is ahead of the obstacle + this margin
1011
deceleration_jerk: -0.3 # [m/s^3] ego decelerates with this jerk when stopping for obstacles
1112
detection_distance: 45.0 # [m] ahead distance from ego to detect the obstacles
1213
detection_span: 1.0 # [m] calculate collision with this span to reduce calculation time
1314
min_vel_ego_kmph: 3.6 # [km/h] min velocity to calculate time to collision
15+
ego_cut_line_length: 3.0 # The width of the ego's cut line
1416

1517
detection_area:
1618
margin_behind: 0.5 # [m] ahead margin for detection area length
Lines changed: 129 additions & 0 deletions
Loading

planning/behavior_velocity_run_out_module/src/debug.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ void RunOutDebug::pushCollisionPoints(const geometry_msgs::msg::Point & point)
8686
collision_points_.push_back(point_with_height);
8787
}
8888

89+
void RunOutDebug::pushEgoCutLine(const std::vector<geometry_msgs::msg::Point> & line)
90+
{
91+
for (const auto & point : line) {
92+
const auto point_with_height = createPoint(point.x, point.y, height_);
93+
ego_cut_line_.push_back(point_with_height);
94+
}
95+
}
96+
8997
void RunOutDebug::pushCollisionPoints(const std::vector<geometry_msgs::msg::Point> & points)
9098
{
9199
for (const auto & p : points) {
@@ -160,6 +168,7 @@ void RunOutDebug::clearDebugMarker()
160168
predicted_obstacle_polygons_.clear();
161169
collision_obstacle_polygons_.clear();
162170
travel_time_texts_.clear();
171+
ego_cut_line_.clear();
163172
}
164173

165174
visualization_msgs::msg::MarkerArray RunOutDebug::createVisualizationMarkerArray()
@@ -265,6 +274,16 @@ visualization_msgs::msg::MarkerArray RunOutDebug::createVisualizationMarkerArray
265274
&msg);
266275
}
267276

277+
if (!ego_cut_line_.empty()) {
278+
auto marker = createDefaultMarker(
279+
"map", current_time, "ego_cut_line", 0, visualization_msgs::msg::Marker::LINE_LIST,
280+
createMarkerScale(0.2, 0.2, 0.2), createMarkerColor(0.7, 0.0, 0.7, 0.999));
281+
for (const auto & p : ego_cut_line_) {
282+
marker.points.push_back(p);
283+
}
284+
msg.markers.push_back(marker);
285+
}
286+
268287
if (!travel_time_texts_.empty()) {
269288
auto marker = createDefaultMarker(
270289
"map", current_time, "travel_time_texts", 0,

planning/behavior_velocity_run_out_module/src/debug.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ class RunOutDebug
109109
void pushPredictedVehiclePolygons(const std::vector<geometry_msgs::msg::Point> & polygon);
110110
void pushPredictedObstaclePolygons(const std::vector<geometry_msgs::msg::Point> & polygon);
111111
void pushCollisionObstaclePolygons(const std::vector<geometry_msgs::msg::Point> & polygon);
112+
void pushEgoCutLine(const std::vector<geometry_msgs::msg::Point> & line);
112113
void pushDetectionAreaPolygons(const Polygon2d & debug_polygon);
113114
void pushMandatoryDetectionAreaPolygons(const Polygon2d & debug_polygon);
114115
void pushTravelTimeTexts(
@@ -134,6 +135,7 @@ class RunOutDebug
134135
rclcpp::Publisher<PointCloud2>::SharedPtr pub_debug_pointcloud_;
135136
std::vector<geometry_msgs::msg::Point> collision_points_;
136137
std::vector<geometry_msgs::msg::Point> nearest_collision_point_;
138+
std::vector<geometry_msgs::msg::Point> ego_cut_line_;
137139
std::vector<geometry_msgs::msg::Pose> stop_pose_;
138140
std::vector<std::vector<geometry_msgs::msg::Point>> predicted_vehicle_polygons_;
139141
std::vector<std::vector<geometry_msgs::msg::Point>> predicted_obstacle_polygons_;

planning/behavior_velocity_run_out_module/src/manager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ RunOutModuleManager::RunOutModuleManager(rclcpp::Node & node)
5858
auto & p = planner_param_.run_out;
5959
p.detection_method = getOrDeclareParameter<std::string>(node, ns + ".detection_method");
6060
p.use_partition_lanelet = getOrDeclareParameter<bool>(node, ns + ".use_partition_lanelet");
61+
p.use_ego_cut_line = getOrDeclareParameter<bool>(node, ns + ".use_ego_cut_line");
6162
p.suppress_on_crosswalk = getOrDeclareParameter<bool>(node, ns + ".suppress_on_crosswalk");
6263
p.specify_decel_jerk = getOrDeclareParameter<bool>(node, ns + ".specify_decel_jerk");
6364
p.stop_margin = getOrDeclareParameter<double>(node, ns + ".stop_margin");
@@ -66,6 +67,7 @@ RunOutModuleManager::RunOutModuleManager(rclcpp::Node & node)
6667
p.detection_distance = getOrDeclareParameter<double>(node, ns + ".detection_distance");
6768
p.detection_span = getOrDeclareParameter<double>(node, ns + ".detection_span");
6869
p.min_vel_ego_kmph = getOrDeclareParameter<double>(node, ns + ".min_vel_ego_kmph");
70+
p.ego_cut_line_length = getOrDeclareParameter<double>(node, ns + ".ego_cut_line_length");
6971
}
7072

7173
{

0 commit comments

Comments
 (0)