Skip to content

Commit 461dbc1

Browse files
authored
feat(goal_planner): introduce bezier based pullover for bus stop area (#10027)
Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
1 parent 165be35 commit 461dbc1

File tree

11 files changed

+343
-122
lines changed

11 files changed

+343
-122
lines changed

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/config/goal_planner.param.yaml

+16-11
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
high_curvature_threshold: 0.1
2626
bus_stop_area:
2727
use_bus_stop_area: false
28-
goal_search_interval: 0.5
29-
lateral_offset_interval: 0.25
28+
goal_search_interval: 0.75
29+
lateral_offset_interval: 0.3
3030

3131
# occupancy grid map
3232
occupancy_grid:
@@ -52,14 +52,15 @@
5252
# pull over
5353
pull_over:
5454
minimum_request_length: 0.0
55+
pull_over_prepare_length: 100.0
5556
pull_over_velocity: 3.0
5657
pull_over_minimum_velocity: 1.38
5758
decide_path_distance: 10.0
5859
maximum_deceleration: 1.0
5960
maximum_jerk: 1.0
6061
path_priority: "efficient_path" # "efficient_path" or "close_goal"
6162
efficient_path_order: ["SHIFT", "ARC_FORWARD", "ARC_BACKWARD"] # only lane based pull over(exclude freespace parking)
62-
lane_departure_check_expansion_margin: 0.0
63+
lane_departure_check_expansion_margin: 0.2
6364

6465
# shift parking
6566
shift_parking:
@@ -73,21 +74,21 @@
7374
# parallel parking path
7475
parallel_parking:
7576
path_interval: 1.0
76-
max_steer_angle: 0.35 # 20deg
77+
max_steer_angle: 0.4 #22.9deg
7778
forward:
7879
enable_arc_forward_parking: true
7980
after_forward_parking_straight_distance: 2.0
8081
forward_parking_velocity: 1.38
8182
forward_parking_lane_departure_margin: 0.0
8283
forward_parking_path_interval: 1.0
83-
forward_parking_max_steer_angle: 0.35 # 20deg
84+
forward_parking_max_steer_angle: 0.4 # 22.9deg
8485
backward:
8586
enable_arc_backward_parking: true
8687
after_backward_parking_straight_distance: 2.0
8788
backward_parking_velocity: -1.38
8889
backward_parking_lane_departure_margin: 0.0
8990
backward_parking_path_interval: 1.0
90-
backward_parking_max_steer_angle: 0.35 # 20deg
91+
backward_parking_max_steer_angle: 0.4 # 22.9deg
9192

9293
# freespace parking
9394
freespace_parking:
@@ -130,6 +131,10 @@
130131
neighbor_radius: 8.0
131132
margin: 1.0
132133

134+
bezier_parking:
135+
pull_over_angle_threshold: 0.5
136+
after_shift_straight_distance: 1.5
137+
133138
stop_condition:
134139
maximum_deceleration_for_stop: 1.0
135140
maximum_jerk_for_stop: 1.0
@@ -139,13 +144,13 @@
139144
min_velocity: 1.0
140145
min_acceleration: 1.0
141146
max_velocity: 1.0
142-
time_horizon_for_front_object: 10.0
143-
time_horizon_for_rear_object: 10.0
147+
time_horizon_for_front_object: 5.0
148+
time_horizon_for_rear_object: 5.0
144149
time_resolution: 0.5
145150
delay_until_departure: 1.0
146151
# For target object filtering
147152
target_filtering:
148-
safety_check_time_horizon: 10.0
153+
safety_check_time_horizon: 5.0
149154
safety_check_time_resolution: 1.0
150155
# detection range
151156
object_check_forward_distance: 100.0
@@ -179,7 +184,7 @@
179184
# safety check configuration
180185
enable_safety_check: true
181186
method: "integral_predicted_polygon"
182-
keep_unsafe_time: 3.0
187+
keep_unsafe_time: 0.5
183188
# collision check parameters
184189
publish_debug_marker: false
185190
rss_params:
@@ -192,7 +197,7 @@
192197
forward_margin: 1.0
193198
backward_margin: 1.0
194199
lat_margin: 1.0
195-
time_horizon: 10.0
200+
time_horizon: 5.0
196201
# hysteresis factor to expand/shrink polygon with the value
197202
hysteresis_factor_expand_rate: 1.0
198203
collision_check_yaw_diff_threshold: 3.1416

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/include/autoware/behavior_path_goal_planner_module/goal_planner_module.hpp

+23-5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "autoware/behavior_path_goal_planner_module/decision_state.hpp"
1919
#include "autoware/behavior_path_goal_planner_module/fixed_goal_planner_base.hpp"
2020
#include "autoware/behavior_path_goal_planner_module/goal_planner_parameters.hpp"
21+
#include "autoware/behavior_path_goal_planner_module/pull_over_planner/bezier_pull_over.hpp"
2122
#include "autoware/behavior_path_goal_planner_module/pull_over_planner/freespace_pull_over.hpp"
2223
#include "autoware/behavior_path_goal_planner_module/thread_data.hpp"
2324
#include "autoware/behavior_path_planner_common/utils/parking_departure/common_module_data.hpp"
@@ -86,8 +87,8 @@ struct PullOverContextData
8687
explicit PullOverContextData(
8788
const bool is_stable_safe_path, const PredictedObjects & static_objects,
8889
const PredictedObjects & dynamic_objects, const PathDecisionState & prev_state,
89-
const bool is_stopped, const LaneParkingResponse & lane_parking_response,
90-
const FreespaceParkingResponse & freespace_parking_response)
90+
const bool is_stopped, LaneParkingResponse && lane_parking_response,
91+
FreespaceParkingResponse && freespace_parking_response)
9192
: is_stable_safe_path(is_stable_safe_path),
9293
static_target_objects(static_objects),
9394
dynamic_target_objects(dynamic_objects),
@@ -112,8 +113,8 @@ struct PullOverContextData
112113
void update(
113114
const bool is_stable_safe_path_, const PredictedObjects static_target_objects_,
114115
const PredictedObjects dynamic_target_objects_, const PathDecisionState prev_state_for_debug_,
115-
const bool is_stopped_, const LaneParkingResponse & lane_parking_response_,
116-
const FreespaceParkingResponse & freespace_parking_response_)
116+
const bool is_stopped_, LaneParkingResponse && lane_parking_response_,
117+
FreespaceParkingResponse && freespace_parking_response_)
117118
{
118119
is_stable_safe_path = is_stable_safe_path_;
119120
static_target_objects = static_target_objects_;
@@ -196,6 +197,21 @@ class LaneParkingPlanner
196197
original_upstream_module_output_; //<! upstream_module_output used for generating last
197198
// pull_over_path_candidates(only updated when new candidates
198199
// are generated)
200+
std::shared_ptr<BezierPullOver> bezier_pull_over_planner_;
201+
const double pull_over_angle_threshold;
202+
203+
bool switch_bezier_{false};
204+
void normal_pullover_planning_helper(
205+
const std::shared_ptr<PlannerData> planner_data, const GoalCandidates & goal_candidates,
206+
const BehaviorModuleOutput & upstream_module_output,
207+
const lanelet::ConstLanelets current_lanelets, std::optional<Pose> & closest_start_pose,
208+
std::vector<PullOverPath> & path_candidates);
209+
void bezier_planning_helper(
210+
const std::shared_ptr<PlannerData> planner_data, const GoalCandidates & goal_candidates,
211+
const BehaviorModuleOutput & upstream_module_output,
212+
const lanelet::ConstLanelets current_lanelets, std::optional<Pose> & closest_start_pose,
213+
std::vector<PullOverPath> & path_candidates,
214+
std::optional<std::vector<size_t>> & sorted_indices) const;
199215
};
200216

201217
class FreespaceParkingPlanner
@@ -302,6 +318,7 @@ class GoalPlannerModule : public SceneModuleInterface
302318
private:
303319
std::pair<LaneParkingResponse, FreespaceParkingResponse> syncWithThreads();
304320

321+
bool trigger_thread_on_approach_{false};
305322
// NOTE: never access to following variables except in updateData()!!!
306323
std::mutex lane_parking_mutex_;
307324
std::optional<LaneParkingRequest> lane_parking_request_;
@@ -433,7 +450,8 @@ class GoalPlannerModule : public SceneModuleInterface
433450
std::optional<PullOverPath> selectPullOverPath(
434451
const PullOverContextData & context_data,
435452
const std::vector<PullOverPath> & pull_over_path_candidates,
436-
const GoalCandidates & goal_candidates) const;
453+
const GoalCandidates & goal_candidates,
454+
const std::optional<std::vector<size_t>> sorted_bezier_indices_opt) const;
437455

438456
// lanes and drivable area
439457
std::vector<DrivableLanes> generateDrivableLanes() const;

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/include/autoware/behavior_path_goal_planner_module/goal_planner_parameters.hpp

+7
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ struct GoalPlannerParameters
8888

8989
// pull over general params
9090
double pull_over_minimum_request_length{0.0};
91+
double pull_over_prepare_length{0.0};
9192
double pull_over_velocity{0.0};
9293
double pull_over_minimum_velocity{0.0};
9394
double decide_path_distance{0.0};
@@ -119,6 +120,12 @@ struct GoalPlannerParameters
119120
AstarParam astar_parameters{};
120121
RRTStarParam rrt_star_parameters{};
121122

123+
struct BezierParking
124+
{
125+
double pull_over_angle_threshold;
126+
double after_shift_straight_distance;
127+
} bezier_parking;
128+
122129
// stop condition
123130
double maximum_deceleration_for_stop{0.0};
124131
double maximum_jerk_for_stop{0.0};

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/include/autoware/behavior_path_goal_planner_module/pull_over_planner/pull_over_planner_base.hpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ struct PullOverPath
6868
const std::vector<double> & parking_path_curvatures() const { return parking_path_curvatures_; }
6969
double full_path_max_curvature() const { return full_path_max_curvature_; }
7070
double parking_path_max_curvature() const { return parking_path_max_curvature_; }
71+
double parking_path_curvature_total_derivative() const
72+
{
73+
return parking_path_curvature_total_derivative_;
74+
}
7175
size_t path_idx() const { return path_idx_; }
7276

7377
bool incrementPathIndex();
@@ -94,7 +98,7 @@ struct PullOverPath
9498
const PathWithLaneId & full_path, const PathWithLaneId & parking_path,
9599
const std::vector<double> & full_path_curvatures,
96100
const std::vector<double> & parking_path_curvatures, const double full_path_max_curvature,
97-
const double parking_path_max_curvature,
101+
const double parking_path_max_curvature, const double parking_path_curvature_total_derivative,
98102
const std::vector<std::pair<double, double>> & pairs_terminal_velocity_and_accel);
99103

100104
PullOverPlannerType type_;
@@ -109,6 +113,7 @@ struct PullOverPath
109113
std::vector<double> parking_path_curvatures_;
110114
double full_path_max_curvature_;
111115
double parking_path_max_curvature_;
116+
double parking_path_curvature_total_derivative_;
112117

113118
// accelerate with constant acceleration to the target velocity
114119
size_t path_idx_;

planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/include/autoware/behavior_path_goal_planner_module/thread_data.hpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ class LaneParkingRequest
4343
void update(
4444
const PlannerData & planner_data, const ModuleStatus & current_status,
4545
const BehaviorModuleOutput & upstream_module_output,
46-
const std::optional<PullOverPath> & pull_over_path, const PathDecisionState & prev_data);
46+
const std::optional<PullOverPath> & pull_over_path, const PathDecisionState & prev_data,
47+
const bool trigger_thread_on_approach);
4748

4849
const autoware::universe_utils::LinearRing2d vehicle_footprint_;
4950
const GoalCandidates goal_candidates_;
@@ -56,19 +57,22 @@ class LaneParkingRequest
5657
}
5758
const std::optional<PullOverPath> & get_pull_over_path() const { return pull_over_path_; }
5859
const PathDecisionState & get_prev_data() const { return prev_data_; }
60+
bool trigger_thread_on_approach() const { return trigger_thread_on_approach_; }
5961

6062
private:
6163
std::shared_ptr<PlannerData> planner_data_;
6264
ModuleStatus current_status_;
6365
BehaviorModuleOutput upstream_module_output_;
6466
std::optional<PullOverPath> pull_over_path_; //<! pull over path selected by main thread
6567
PathDecisionState prev_data_;
68+
bool trigger_thread_on_approach_{false};
6669
};
6770

6871
struct LaneParkingResponse
6972
{
7073
std::vector<PullOverPath> pull_over_path_candidates;
7174
std::optional<Pose> closest_start_pose;
75+
std::optional<std::vector<size_t>> sorted_bezier_indices_opt;
7276
};
7377

7478
class FreespaceParkingRequest

0 commit comments

Comments
 (0)