Skip to content

Commit 3f1a584

Browse files
committed
fix
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
1 parent 04565d0 commit 3f1a584

File tree

4 files changed

+91
-68
lines changed

4 files changed

+91
-68
lines changed

Diff for: planning/autoware_obstacle_cruise_planner/README.md

+13-14
Original file line numberDiff line numberDiff line change
@@ -77,26 +77,14 @@ start
7777
7878
partition filter_stop_obstacle_for_predicted_object {
7979
:is_stop_obstacle_type;
80-
note right
81-
- reference pose
82-
- reference path:
83-
generated by spline interpolation of centerline path
84-
with dense interval
85-
- current lanelets
86-
- drivable bounds
87-
- avoidance start point
88-
calculate the point where the ego should start avoidance maneuver
89-
depending on traffic signal.
90-
- avoidance return point
91-
calculate the point where the ego should return original lane
92-
depending on traffic signal and goal position.
93-
end note
9480
9581
partition filter_inside_stop_obstacle_for_predicted_object {
9682
:filter by lateral distance;
9783
9884
:filter by label;
9985
86+
:is_stop_obstacle_velocity;
87+
10088
:check if the obstacle really collides with the trajectory;
10189
10290
:is_crossing_transient_obstacle;
@@ -106,17 +94,28 @@ partition filter_outside_stop_obstacle_for_predicted_object {
10694
}
10795
10896
:checkConsistency;
97+
note right
98+
consistent
99+
end note
109100
}
110101
111102
partition filter_stop_obstacle_for_point_cloud {
112103
}
113104
114105
:concat stop obstacles;
106+
note right
107+
concat stop obstacles by predicted objects and point cloud
108+
end note
115109
116110
partition generate_stop_trajectory {
117111
:calculate dist to collide;
118112
119113
:calc_desired_stop_margin;
114+
note right
115+
- whether the ego is cloes to the goal
116+
- whether the ego is on the curve
117+
- whether there is stop point by behavior's stop point
118+
end note
120119
121120
:calc_candidate_zero_vel_dist;
122121

Diff for: planning/autoware_obstacle_cruise_planner/config/stop.param.yaml

+23-23
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@
1818
min_safe_distance_margin: 3.0 # [m]
1919
suppress_sudden_obstacle_stop: false
2020

21-
obstacle_type:
22-
pointcloud: false
23-
inside:
24-
unknown: true
25-
car: true
26-
truck: true
27-
bus: true
28-
trailer: true
29-
motorcycle: true
30-
bicycle: true
31-
pedestrian: true
21+
obstacle_filtering:
22+
obstacle_type:
23+
pointcloud: false
24+
inside:
25+
unknown: true
26+
car: true
27+
truck: true
28+
bus: true
29+
trailer: true
30+
motorcycle: true
31+
bicycle: true
32+
pedestrian: true
3233

33-
outside:
34-
unknown: false
35-
car: true
36-
truck: true
37-
bus: true
38-
trailer: true
39-
motorcycle: true
40-
bicycle: true
41-
pedestrian: true
34+
outside:
35+
unknown: false
36+
car: true
37+
truck: true
38+
bus: true
39+
trailer: true
40+
motorcycle: true
41+
bicycle: true
42+
pedestrian: true
4243

43-
behavior_determination:
4444
max_lat_margin: 0.3 # lateral margin between the obstacles except for unknown and ego's footprint
4545
max_lat_margin_against_unknown: 0.3 # lateral margin between the unknown obstacles and ego's footprint
4646
min_velocity_to_reach_collision_point: 2.0 # minimum velocity margin to calculate time to reach collision [m/s]
@@ -55,8 +55,8 @@
5555
stop_obstacle_hold_time_threshold : 1.0 # maximum time for holding closest stop obstacle
5656

5757
# hysteresis for cruise and stop
58-
obstacle_velocity_threshold_from_cruise_to_stop : 3.0 # stop planning is executed to the obstacle whose velocity is less than this value [m/s]
59-
obstacle_velocity_threshold_from_stop_to_cruise : 3.5 # stop planning is executed to the obstacle whose velocity is less than this value [m/s]
58+
obstacle_velocity_threshold_to_stop : 3.0 # stop planning is executed to the obstacle whose velocity is less than this value [m/s]
59+
obstacle_velocity_threshold_from_stop : 3.5 # stop planning is executed to the obstacle whose velocity is less than this value [m/s]
6060

6161
type_specified_params:
6262
labels: # For the listed types, the node try to read the following type specified values

Diff for: planning/autoware_obstacle_cruise_planner/include/autoware/obstacle_cruise_planner/stop/obstacle_stop_module.hpp

+30-6
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,12 @@ class ObstacleStopModule
139139
ignore_crossing_obstacle_ =
140140
getOrDeclareParameter<bool>(node, "stop.common.ignore_crossing_obstacle");
141141

142-
inside_stop_obstacle_types_ =
143-
obstacle_cruise_utils::getTargetObjectType(node, "stop.obstacle_type.inside.");
144-
outside_stop_obstacle_types_ =
145-
obstacle_cruise_utils::getTargetObjectType(node, "stop.obstacle_type.outside.");
146-
use_pointcloud_for_stop_ = getOrDeclareParameter<bool>(node, "stop.obstacle_type.pointcloud");
142+
inside_stop_obstacle_types_ = obstacle_cruise_utils::getTargetObjectType(
143+
node, "stop.obstacle_filtering.obstacle_type.inside.");
144+
outside_stop_obstacle_types_ = obstacle_cruise_utils::getTargetObjectType(
145+
node, "stop.obstacle_filtering.obstacle_type.outside.");
146+
use_pointcloud_for_stop_ =
147+
getOrDeclareParameter<bool>(node, "stop.obstacle_filtering.obstacle_type.pointcloud");
147148

148149
velocity_factors_pub_ = node.create_publisher<VelocityFactorArray>(
149150
"/planning/velocity_factors/obstacle_cruise/stop", 1);
@@ -696,6 +697,10 @@ class ObstacleStopModule
696697
return std::nullopt;
697698
}
698699

700+
if (!is_stop_obstacle_velocity(obstacle)) {
701+
return std::nullopt;
702+
}
703+
699704
// calculate collision points with trajectory with lateral stop margin
700705
const auto traj_polys_with_lat_margin = obstacle_cruise_utils::createOneStepPolygons(
701706
traj_points, vehicle_info, odometry.pose.pose, max_lat_margin_for_stop,
@@ -722,6 +727,25 @@ class ObstacleStopModule
722727
collision_point->first, collision_point->second};
723728
}
724729

730+
bool is_stop_obstacle_velocity(const Obstacle & obstacle) const
731+
{
732+
const bool is_prev_obstacle_stop =
733+
obstacle_cruise_utils::getObstacleFromUuid(prev_stop_object_obstacles_, obstacle.uuid)
734+
.has_value();
735+
736+
if (is_prev_obstacle_stop) {
737+
if (stop_param_.obstacle_velocity_threshold_from_stop < obstacle.longitudinal_velocity) {
738+
return false;
739+
}
740+
return true;
741+
}
742+
743+
if (obstacle.longitudinal_velocity < stop_param_.obstacle_velocity_threshold_to_stop) {
744+
return true;
745+
}
746+
return false;
747+
}
748+
725749
bool is_crossing_transient_obstacle(
726750
const Odometry & odometry, const std::vector<TrajectoryPoint> & traj_points,
727751
const Obstacle & obstacle, const double dist_to_bumper,
@@ -812,7 +836,7 @@ class ObstacleStopModule
812836
const double elapsed_time = (current_time - prev_closest_stop_obstacle.stamp).seconds();
813837
if (
814838
predicted_object_itr->kinematics.initial_twist_with_covariance.twist.linear.x <
815-
stop_param_.obstacle_velocity_threshold_from_stop_to_cruise &&
839+
stop_param_.obstacle_velocity_threshold_from_stop &&
816840
elapsed_time < stop_param_.stop_obstacle_hold_time_threshold) {
817841
stop_obstacles.push_back(prev_closest_stop_obstacle);
818842
}

Diff for: planning/autoware_obstacle_cruise_planner/include/autoware/obstacle_cruise_planner/stop/types.hpp

+25-25
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ struct StopParam
144144
double pedestrian_deceleration_rate;
145145
double bicycle_deceleration_rate;
146146
double stop_obstacle_hold_time_threshold;
147-
double obstacle_velocity_threshold_from_cruise_to_stop;
148-
double obstacle_velocity_threshold_from_stop_to_cruise;
147+
double obstacle_velocity_threshold_to_stop;
148+
double obstacle_velocity_threshold_from_stop;
149149

150150
struct ObstacleSpecificParams
151151
{
@@ -170,27 +170,27 @@ struct StopParam
170170

171171
// behavior determination
172172
collision_time_margin = getOrDeclareParameter<double>(
173-
node, "stop.behavior_determination.crossing_obstacle.collision_time_margin");
173+
node, "stop.obstacle_filtering.crossing_obstacle.collision_time_margin");
174174
max_lat_margin_for_stop =
175-
getOrDeclareParameter<double>(node, "stop.behavior_determination.max_lat_margin");
176-
max_lat_margin_for_stop_against_unknown = getOrDeclareParameter<double>(
177-
node, "stop.behavior_determination.max_lat_margin_against_unknown");
175+
getOrDeclareParameter<double>(node, "stop.obstacle_filtering.max_lat_margin");
176+
max_lat_margin_for_stop_against_unknown =
177+
getOrDeclareParameter<double>(node, "stop.obstacle_filtering.max_lat_margin_against_unknown");
178178
min_velocity_to_reach_collision_point = getOrDeclareParameter<double>(
179-
node, "stop.behavior_determination.min_velocity_to_reach_collision_point");
179+
node, "stop.obstacle_filtering.min_velocity_to_reach_collision_point");
180180
max_lat_time_margin_for_stop = getOrDeclareParameter<double>(
181-
node, "stop.behavior_determination.outside_obstacle.max_lateral_time_margin");
181+
node, "stop.obstacle_filtering.outside_obstacle.max_lateral_time_margin");
182182
num_of_predicted_paths_for_outside_stop_obstacle = getOrDeclareParameter<int>(
183-
node, "stop.behavior_determination.outside_obstacle.num_of_predicted_paths");
183+
node, "stop.obstacle_filtering.outside_obstacle.num_of_predicted_paths");
184184
pedestrian_deceleration_rate = getOrDeclareParameter<double>(
185-
node, "stop.behavior_determination.outside_obstacle.pedestrian_deceleration_rate");
185+
node, "stop.obstacle_filtering.outside_obstacle.pedestrian_deceleration_rate");
186186
bicycle_deceleration_rate = getOrDeclareParameter<double>(
187-
node, "stop.behavior_determination.outside_obstacle.bicycle_deceleration_rate");
187+
node, "stop.obstacle_filtering.outside_obstacle.bicycle_deceleration_rate");
188188
stop_obstacle_hold_time_threshold = getOrDeclareParameter<double>(
189-
node, "stop.behavior_determination.stop_obstacle_hold_time_threshold");
190-
obstacle_velocity_threshold_from_cruise_to_stop = getOrDeclareParameter<double>(
191-
node, "stop.behavior_determination.obstacle_velocity_threshold_from_cruise_to_stop");
192-
obstacle_velocity_threshold_from_stop_to_cruise = getOrDeclareParameter<double>(
193-
node, "stop.behavior_determination.obstacle_velocity_threshold_from_stop_to_cruise");
189+
node, "stop.obstacle_filtering.stop_obstacle_hold_time_threshold");
190+
obstacle_velocity_threshold_to_stop = getOrDeclareParameter<double>(
191+
node, "stop.obstacle_filtering.obstacle_velocity_threshold_to_stop");
192+
obstacle_velocity_threshold_from_stop = getOrDeclareParameter<double>(
193+
node, "stop.obstacle_filtering.obstacle_velocity_threshold_from_stop");
194194

195195
const std::string param_prefix = "stop.type_specified_params.";
196196
std::vector<std::string> obstacle_labels{"default"};
@@ -226,30 +226,30 @@ struct StopParam
226226
parameters, "stop.hold_stop_distance_threshold", hold_stop_distance_threshold);
227227

228228
autoware::universe_utils::updateParam<double>(
229-
parameters, "stop.behavior_determination.crossing_obstacle.collision_time_margin",
229+
parameters, "stop.obstacle_filtering.crossing_obstacle.collision_time_margin",
230230
collision_time_margin);
231231
autoware::universe_utils::updateParam<double>(
232-
parameters, "stop.behavior_determination.max_lat_margin", max_lat_margin_for_stop);
232+
parameters, "stop.obstacle_filtering.max_lat_margin", max_lat_margin_for_stop);
233233
autoware::universe_utils::updateParam<double>(
234-
parameters, "stop.behavior_determination.max_lat_margin_against_unknown",
234+
parameters, "stop.obstacle_filtering.max_lat_margin_against_unknown",
235235
max_lat_margin_for_stop_against_unknown);
236236
autoware::universe_utils::updateParam<double>(
237-
parameters, "stop.behavior_determination.min_velocity_to_reach_collision_point",
237+
parameters, "stop.obstacle_filtering.min_velocity_to_reach_collision_point",
238238
min_velocity_to_reach_collision_point);
239239
autoware::universe_utils::updateParam<double>(
240-
parameters, "stop.behavior_determination.outside_obstacle.max_lateral_time_margin",
240+
parameters, "stop.obstacle_filtering.outside_obstacle.max_lateral_time_margin",
241241
max_lat_time_margin_for_stop);
242242
autoware::universe_utils::updateParam<int>(
243-
parameters, "stop.behavior_determination.outside_obstacle.num_of_predicted_paths",
243+
parameters, "stop.obstacle_filtering.outside_obstacle.num_of_predicted_paths",
244244
num_of_predicted_paths_for_outside_stop_obstacle);
245245
autoware::universe_utils::updateParam<double>(
246-
parameters, "stop.behavior_determination.outside_obstacle.pedestrian_deceleration_rate",
246+
parameters, "stop.obstacle_filtering.outside_obstacle.pedestrian_deceleration_rate",
247247
pedestrian_deceleration_rate);
248248
autoware::universe_utils::updateParam<double>(
249-
parameters, "stop.behavior_determination.outside_obstacle.bicycle_deceleration_rate",
249+
parameters, "stop.obstacle_filtering.outside_obstacle.bicycle_deceleration_rate",
250250
bicycle_deceleration_rate);
251251
autoware::universe_utils::updateParam<double>(
252-
parameters, "stop.behavior_determination_obstacle_hold_time_threshold",
252+
parameters, "stop.obstacle_filtering_obstacle_hold_time_threshold",
253253
stop_obstacle_hold_time_threshold);
254254

255255
const std::string param_prefix = "stop.type_specified_params.";

0 commit comments

Comments
 (0)