planning_gflags.cc 13.6 KB
Newer Older
D
Dong Li 已提交
1 2 3 4 5 6 7 8 9 10
/******************************************************************************
 * Copyright 2017 The Apollo Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
11 12
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
D
Dong Li 已提交
13 14 15 16 17
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *****************************************************************************/

#include "modules/planning/common/planning_gflags.h"
A
Aaron Xiao 已提交
18

19 20
DEFINE_bool(planning_test_mode, false, "Enable planning test mode.");

21
DEFINE_int32(planning_loop_rate, 10, "Loop rate for planning node");
D
Dong Li 已提交
22

S
siyangy 已提交
23 24
DEFINE_string(planning_adapter_config_filename,
              "modules/planning/conf/adapter.conf",
25 26
              "The adapter configuration file");

D
Dong Li 已提交
27 28 29 30 31 32 33
DEFINE_string(rtk_trajectory_filename, "modules/planning/data/garage.csv",
              "Loop rate for planning node");

DEFINE_uint64(rtk_trajectory_forward, 800,
              "The number of points to be included in RTK trajectory "
              "after the matched point");

34 35
DEFINE_double(rtk_trajectory_resolution, 0.01,
              "The time resolution of output trajectory for rtk planner.");
36

37
DEFINE_bool(publish_estop, false, "publish estop decision in planning");
38
DEFINE_bool(enable_trajectory_stitcher, true, "enable stitching trajectory");
39

40
DEFINE_double(
41
    look_backward_distance, 30,
42 43
    "look backward this distance when creating reference line from routing");

44
DEFINE_double(look_forward_short_distance, 150,
45 46
              "short look forward this distance when creating reference line "
              "from routing when ADC is slow");
47
DEFINE_double(
48
    look_forward_long_distance, 250,
49
    "look forward this distance when creating reference line from routing");
50
DEFINE_double(look_forward_time_sec, 8.0,
51 52
              "look forward time times adc speed to calculate this distance "
              "when creating reference line from routing");
D
Dong Li 已提交
53 54 55
DEFINE_bool(enable_reference_line_stitching, true,
            "Enable stitching reference line, which can reducing computing "
            "time and improve stabilty");
56
DEFINE_double(look_forward_extend_distance, 50,
D
Dong Li 已提交
57 58 59 60
              "The step size when extending reference line.");
DEFINE_double(reference_line_stitch_overlap_distance, 20,
              "The overlap distance with the existing reference line when "
              "stitching the existing reference line");
61 62 63
DEFINE_double(reference_line_lateral_buffer, 1.0,
              "When creating reference line, the minimum distance with road "
              "curb for a vehicle driving on this line.");
64 65 66 67 68 69 70 71
DEFINE_double(prepare_rerouting_time, 2.0,
              "If there are this amount of seconds left to finish driving on "
              "current route, and there is no routing, do rerouting");

DEFINE_double(rerouting_cooldown_time, 0.6,
              "Wait for at least this amount of seconds before send another "
              "rerouting request");

72 73
DEFINE_bool(enable_smooth_reference_line, true,
            "enable smooth the map reference line");
74

L
liyunADU 已提交
75 76
DEFINE_bool(enable_spiral_reference_line, false,
            "enable new spiral based reference line");
77
DEFINE_double(spiral_smoother_max_deviation, 0.1,
78
              "The max deviation of spiral reference line smoother.");
79
DEFINE_int32(spiral_smoother_num_iteration, 1000,
80
             "The iteration num of spiral reference line smoother.");
81
DEFINE_double(spiral_smoother_piecewise_length, 10.0,
82
              "The piecewise length of spiral smoother.");
83
DEFINE_double(spiral_reference_line_resolution, 0.02,
84
              "The output resolution for reference line.");
D
Dong Li 已提交
85 86 87
DEFINE_bool(prioritize_change_lane, false,
            "change lane strategy has higher priority, always use a valid "
            "change lane path if such path exists");
88 89 90
DEFINE_bool(reckless_change_lane, false,
            "Alway allow the vehicle change lane. The vehicle may contineous "
            "change lane. This is mainly test purpose");
91 92 93 94
DEFINE_double(change_lane_fail_freeze_time, 3.0,
              "seconds. Not allowed to change lane this amount of time "
              "if it just finished change lane or failed to change lane");
DEFINE_double(change_lane_success_freeze_time, 3.0,
D
Dong Li 已提交
95 96
              "seconds. Not allowed to change lane this amount of time "
              "if it just finished change lane or failed to change lane");
97 98 99
DEFINE_double(change_lane_min_length, 30.0,
              "meters. If the change lane target has longer length than this "
              "threshold, it can shortcut the default lane.");
100 101
DEFINE_bool(enable_change_lane_decider, false,
            "True to use change lane state machine decider.");
L
liyunADU 已提交
102

103
DEFINE_int32(max_history_frame_num, 1, "The maximum history frame number");
104

105 106 107 108
DEFINE_double(max_collision_distance, 0.1,
              "considered as collision if distance (meters) is smaller than or "
              "equal to this (meters)");

109
DEFINE_double(replan_lateral_distance_threshold, 5.0,
110
              "The distance threshold of replan");
111
DEFINE_double(replan_longitudinal_distance_threshold, 5.0,
C
Calvin Miao 已提交
112
              "The distance threshold of replan");
113 114
DEFINE_bool(estimate_current_vehicle_state, true,
            "Estimate current vehicle state.");
115

116
DEFINE_bool(enable_reference_line_provider_thread, true,
117 118
            "Enable reference line provider thread.");

119 120 121
DEFINE_double(default_reference_line_width, 4.0,
              "Default reference line width");

122
DEFINE_double(smoothed_reference_line_max_diff, 5.0,
123 124 125
              "Maximum position difference between the smoothed and the raw "
              "reference lines.");

126
DEFINE_double(planning_upper_speed_limit, 31.3,
127
              "Maximum speed (m/s) in planning.");
128

129
DEFINE_double(trajectory_time_length, 8.0, "Trajectory time length");
130 131 132 133 134 135 136 137 138 139 140

// planning trajectory output time density control
DEFINE_double(
    trajectory_time_min_interval, 0.02,
    "(seconds) Trajectory time interval when publish. The is the min value.");
DEFINE_double(
    trajectory_time_max_interval, 0.1,
    "(seconds) Trajectory time interval when publish. The is the max value.");
DEFINE_double(
    trajectory_time_high_density_period, 1.0,
    "(seconds) Keep high density in the next this amount of seconds. ");
141

142
DEFINE_bool(enable_trajectory_check, false,
143 144
            "Enable sanity check for planning trajectory.");

145
DEFINE_double(speed_lower_bound, -0.02, "The lowest speed allowed.");
146 147 148
DEFINE_double(speed_upper_bound, 40.0, "The highest speed allowed.");

DEFINE_double(longitudinal_acceleration_lower_bound, -4.5,
C
Calvin Miao 已提交
149
              "The lowest longitudinal acceleration allowed.");
150
DEFINE_double(longitudinal_acceleration_upper_bound, 4.0,
C
Calvin Miao 已提交
151
              "The highest longitudinal acceleration allowed.");
152

C
Calvin Miao 已提交
153 154
DEFINE_double(lateral_jerk_bound, 4.0,
              "Bound of lateral jerk; symmetric for left and right");
155

C
Calvin Miao 已提交
156 157 158 159
DEFINE_double(longitudinal_jerk_lower_bound, -4.0,
              "The lower bound of longitudinal jerk.");
DEFINE_double(longitudinal_jerk_upper_bound, 4.0,
              "The upper bound of longitudinal jerk.");
160

161
DEFINE_double(dl_bound, 0.10,
162
              "The bound for derivative l in s-l coordinate system.");
163 164
DEFINE_double(kappa_bound, 0.20, "The bound for vehicle curvature");
DEFINE_double(dkappa_bound, 0.02,
165
              "The bound for vehicle curvature change rate");
166

167
// ST Boundary
168 169
DEFINE_double(st_max_s, 100, "the maximum s of st boundary");
DEFINE_double(st_max_t, 8, "the maximum t of st boundary");
170

L
liyun 已提交
171
// Decision Part
172
DEFINE_double(static_obstacle_speed_threshold, 0.5,
D
Dong Li 已提交
173 174
              "obstacles are considered as static obstacle if its speed is "
              "less than this value (m/s)");
175
DEFINE_bool(enable_nudge_decision, true, "enable nudge decision");
176 177 178
DEFINE_bool(enable_nudge_slowdown, true,
            "True to slow down when nudge obstacles.");

179
DEFINE_double(static_decision_nudge_l_buffer, 0.3, "l buffer for nudge");
180 181 182 183
DEFINE_double(longitudinal_ignore_buffer, 10.0,
              "If an obstacle's longitudinal distance is further away "
              "than this distance, ignore it");
DEFINE_double(lateral_ignore_buffer, 3.0,
D
Dong Li 已提交
184 185
              "If an obstacle's lateral distance is further away than this "
              "distance, ignore it");
186 187 188 189 190
DEFINE_double(max_stop_distance_obstacle, 10.0,
              "max stop distance from in-lane obstacle (meters)");
DEFINE_double(min_stop_distance_obstacle, 3.0,
              "min stop distance from in-lane obstacle (meters)");
DEFINE_double(stop_distance_destination, 0.5,
191
              "stop distance from destination line");
192
DEFINE_double(stop_distance_traffic_light, 3.0,
193
              "stop distance from traffic light line");
194 195 196
DEFINE_double(destination_check_distance, 5.0,
              "if the distance between destination and ADC is less than this,"
              " it is considered to reach destination");
T
Tao Jiaming 已提交
197 198
DEFINE_double(nudge_distance_obstacle, 0.3,
              "minimum distance to nudge a obstacle (meters)");
199
DEFINE_double(follow_min_distance, 2.0,
T
Tao Jiaming 已提交
200
              "min follow distance for vehicles/bicycles/moving objects");
201
DEFINE_double(
202
    follow_time_buffer, 2.0,
203
    "follow time buffer (in second) to calculate the following distance.");
204 205 206
DEFINE_double(
    follow_min_time_sec, 3.0,
    "min following time in st region before considering a valid follow");
207

T
Tao Jiaming 已提交
208 209
DEFINE_string(destination_obstacle_id, "DEST",
              "obstacle id for converting destination to an obstacle");
A
Aaron Xiao 已提交
210 211 212 213
DEFINE_double(virtual_stop_wall_length, 0.1,
              "virtual stop wall length (meters)");
DEFINE_double(virtual_stop_wall_height, 2.0,
              "virtual stop wall height (meters)");
214 215
DEFINE_string(reference_line_end_obstacle_id, "REF_END",
              "Obstacle id for the end of reference line obstacle");
216 217 218
DEFINE_double(signal_expire_time_sec, 5.0,
              "consider the signal msg is expired if its timestamp over "
              "this threshold (second)");
L
liyun 已提交
219

220 221 222 223 224 225 226
// Speed Decider
DEFINE_double(low_speed_obstacle_threshold, 2.0,
              "speed lower than this value is considered as low speed");
DEFINE_double(
    decelerating_obstacle_threshold, -0.25,
    "acceleration lower than this value is considered as decelerating");

227 228
// Prediction Part
DEFINE_double(prediction_total_time, 5.0, "Total prediction time");
229
DEFINE_bool(align_prediction_time, false,
230
            "enable align prediction data based planning time");
231 232

// Trajectory
S
siyangy 已提交
233 234
DEFINE_bool(enable_rule_layer, true,
            "enable rule for trajectory before model computation");
235

236
// Traffic decision
J
jmtao 已提交
237 238 239
/// common
DEFINE_double(stop_max_distance_buffer, 4.0,
              "distance buffer of passing stop line");
240 241
DEFINE_double(stop_min_speed, 0.1, "min speed for computing stop");
DEFINE_double(stop_max_deceleration, 6.0, "max deceleration");
D
Dong Li 已提交
242 243 244
/// Clear Zone
DEFINE_string(clear_zone_virtual_object_id_prefix, "CZ_",
              "prefix for converting clear zone id to virtual object id");
J
jmtao 已提交
245 246
/// traffic light
DEFINE_string(signal_light_virtual_object_id_prefix, "SL_",
247
              "prefix for converting signal id to virtual object id");
248 249
DEFINE_double(max_deacceleration_for_yellow_light_stop, 2.0,
              "treat yellow light as red when deceleration (abstract value"
250 251
              " in m/s^2) is less than this threshold; otherwise treated"
              " as green light");
J
jmtao 已提交
252 253 254 255 256 257 258
/// crosswalk
DEFINE_bool(enable_crosswalk, false, "enable crosswalk");
DEFINE_string(crosswalk_virtual_object_id_prefix, "CW_",
              "prefix for converting crosswalk id to virtual object id");
DEFINE_double(crosswalk_expand_distance, 2.0,
              "crosswalk expand distance(meter) "
              "for pedestrian/bicycle detection");
J
jmtao 已提交
259 260 261 262
DEFINE_double(crosswalk_strick_l_distance, 4.0,
              "strick stop rule within this l_distance");
DEFINE_double(crosswalk_loose_l_distance, 5.0,
              "loose stop rule beyond this l_distance");
263

264 265
// according to DMV's rule, turn signal should be on within 200 ft from
// intersection.
266
DEFINE_double(
267 268
    turn_signal_distance, 60.96,
    "In meters. If there is a turn within this distance, use turn signal");
269

270
// planning config file
D
Dong Li 已提交
271 272 273 274
DEFINE_string(planning_config_file,
              "modules/planning/conf/planning_config.pb.txt",
              "planning config file");

275 276
DEFINE_int32(trajectory_point_num_for_debug, 10,
             "number of output trajectory points for debugging");
D
Dong Li 已提交
277

278 279
DEFINE_double(decision_valid_stop_range, 0.5,
              "The valid stop range in decision.");
280 281
DEFINE_bool(enable_record_debug, true,
            "True to enable record debug into debug protobuf.");
Z
Zhang Liangliang 已提交
282
DEFINE_bool(enable_prediction, true, "True to enable prediction input.");
283 284 285 286 287 288 289 290 291

DEFINE_bool(enable_lag_prediction, true,
            "Enable lagged prediction, which is more tolerant to obstacles "
            "that appear and disappear dequeickly");
DEFINE_int32(lag_prediction_min_appear_num, 5,
             "The minimum of appearance of the obstacle for lagged prediction");
DEFINE_double(lag_prediction_max_disappear_num, 3,
              "In lagged prediction, ingnore obstacle disappeared for more "
              "than this value");
D
Dong Li 已提交
292
DEFINE_bool(enable_traffic_light, true, "True to enable traffic light input.");
293 294 295 296

// QpSt optimizer
DEFINE_bool(enable_slowdown_profile_generator, true,
            "True to enable slowdown speed profile generator.");
297
DEFINE_double(slowdown_profile_deceleration, -1.0,
298
              "The deceleration to generate slowdown profile. unit: m/s^2.");
299 300
DEFINE_bool(enable_follow_accel_constraint, true,
            "Enable follow acceleration constraint.");
301 302 303

// SQP solver
DEFINE_bool(enable_sqp_solver, true, "True to enable SQP solver.");