planning_gflags.cc 16.0 KB
Newer Older
D
Dong Li 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/******************************************************************************
 * 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
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *****************************************************************************/

#include "modules/planning/common/planning_gflags.h"

DEFINE_int32(planning_loop_rate, 5, "Loop rate for planning node");

DEFINE_string(rtk_trajectory_filename, "modules/planning/data/garage.csv",
              "Loop rate for planning node");
23
DEFINE_string(map_filename, "modules/map/data/base_map.txt", "map data file");
D
Dong Li 已提交
24

25 26
DEFINE_uint64(backward_trajectory_point_num, 10,
              "The number of points to be included in planning trajectory "
D
Dong Li 已提交
27 28 29 30 31 32 33 34 35 36
              "before the matched point");

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

DEFINE_double(replanning_threshold, 2.0,
              "The threshold of position deviation "
              "that triggers the planner replanning");

D
Dong Li 已提交
37 38
DEFINE_double(trajectory_resolution, 0.01,
              "The time resolution of "
D
Dong Li 已提交
39
              "output trajectory.");
40

41 42 43 44
DEFINE_string(reference_line_smoother_config_file,
              "modules/planning/conf/reference_line_smoother_config.pb.txt",
              "The reference line smoother config file");

45 46 47 48 49 50 51 52
DEFINE_double(
    look_backward_distance, 10,
    "look backward this distance when creating reference line from routing");

DEFINE_double(
    look_forward_distance, 70,
    "look forward this distance when creating reference line from routing");

53 54 55
DEFINE_double(cycle_duration_in_sec, 0.002, "# of seconds per planning cycle.");
DEFINE_double(maximal_delay_sec, 0.005, "# of seconds for delay.");

C
Calvin Miao 已提交
56 57
DEFINE_int32(max_history_result, 10,
             "The maximal number of result in history.");
58 59 60

DEFINE_int32(max_frame_size, 30, "max size for prediction window");

C
Calvin Miao 已提交
61 62
DEFINE_int32(state_fail_threshold, 5,
             "This is continuous fail threshold for FSM change to fail state.");
63 64

DEFINE_bool(use_stitch, true, "Use trajectory stitch if possible.");
C
Calvin Miao 已提交
65 66 67 68 69 70 71 72
DEFINE_double(forward_predict_time, 0.2,
              "The forward predict time in each planning cycle.");
DEFINE_double(replan_distance_threshold, 5.0,
              "The distance threshold of replan");
DEFINE_double(replan_s_threshold, 5.0,
              "The s difference to real position threshold of replan");
DEFINE_double(replan_l_threshold, 2.5,
              "The l difference to real position threshold of replan");
73

74 75 76
DEFINE_double(default_reference_line_width, 4.0,
              "Default reference line width");

77 78 79
DEFINE_double(planning_distance, 100, "Planning distance");

DEFINE_double(trajectory_time_length, 8.0, "Trajectory time length");
C
Calvin Miao 已提交
80 81 82 83
DEFINE_double(trajectory_time_resolution, 0.1,
              "Trajectory time resolution in planning");
DEFINE_double(output_trajectory_time_resolution, 0.05,
              "Trajectory time resolution when publish");
84

85
DEFINE_double(speed_lower_bound, 0.0, "The lowest speed allowed.");
86 87 88
DEFINE_double(speed_upper_bound, 40.0, "The highest speed allowed.");

DEFINE_double(longitudinal_acceleration_lower_bound, -4.5,
C
Calvin Miao 已提交
89
              "The lowest longitudinal acceleration allowed.");
90
DEFINE_double(longitudinal_acceleration_upper_bound, 4.0,
C
Calvin Miao 已提交
91
              "The highest longitudinal acceleration allowed.");
92

C
Calvin Miao 已提交
93 94 95 96
DEFINE_double(lateral_acceleration_bound, 4.5,
              "Bound of lateral acceleration; symmetric for left and right");
DEFINE_double(lateral_jerk_bound, 4.0,
              "Bound of lateral jerk; symmetric for left and right");
97

C
Calvin Miao 已提交
98 99 100 101
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.");
102

103 104
DEFINE_double(kappa_bound, 0.23, "The bound for vehicle curvature");

C
Calvin Miao 已提交
105 106
DEFINE_double(stgraph_default_point_cost, 1e10,
              "The default stgraph point cost.");
107
DEFINE_double(stgraph_max_acceleration_divide_factor_level_1, 2.0,
C
Calvin Miao 已提交
108
              "The divide factor for max acceleration at level 1.");
109
DEFINE_double(stgraph_max_deceleration_divide_factor_level_1, 3.0,
C
Calvin Miao 已提交
110
              "The divide factor for max deceleration at level 1.");
111
DEFINE_double(stgraph_max_deceleration_divide_factor_level_2, 2.0,
C
Calvin Miao 已提交
112
              "The divide factor for max deceleration at level 2.");
113

L
liyun 已提交
114 115
// Decision Part
DEFINE_double(static_decision_ignore_range, 3.0,
L
luoqi06 已提交
116 117 118
              "threshold for judging nudge in dp path computing decision");
DEFINE_double(
    static_decision_stop_buffer, 0.5,
L
liyun 已提交
119
    "added distance to vehicle width for static decision collision judgement");
L
luoqi06 已提交
120 121
DEFINE_double(dp_path_decision_buffer, 0.65,
              "buffer in decision while dp path computing decision");
L
liyun 已提交
122

123 124 125 126
// Prediction Part

DEFINE_int32(adc_id, -1, "Obstacle id for the global adc");
DEFINE_bool(local_debug, false, "enabling local debug will disabling xlogging");
S
siyangy 已提交
127 128
DEFINE_string(new_pobs_dump_file, "/data/new_pobs_dump.bag",
              "bag file for newly merged pobs");
129 130 131 132
DEFINE_double(pcd_merge_thred, 0.25, "iou threshold for pcd merge");
DEFINE_double(vehicle_min_l, 3.5, "vehicle min l");
DEFINE_double(vehicle_min_w, 2.2, "vehicle min w");
DEFINE_double(vehicle_min_h, 1.5, "vehicle min h");
S
siyangy 已提交
133 134 135 136
DEFINE_int32(good_pcd_size, 50,
             "at least these many points to make a reasonable pcd");
DEFINE_int32(good_pcd_labeling_size, 500,
             "at least these many points for labeling");
137 138 139 140 141
DEFINE_double(front_sector_angle, 0.5236, "40 degree front sector");
DEFINE_double(max_reasonable_l, 15.0, "max reasonable l");
DEFINE_double(min_reasonable_l, 1.5, "min reasonable l");
DEFINE_double(max_reasonable_w, 3.5, "max reasonable w");
DEFINE_double(min_reasonable_w, 1.2, "min reasonable w");
S
siyangy 已提交
142 143 144 145 146 147 148 149 150
DEFINE_double(
    merge_range, 30.0,
    "Radius of range for considering obstacle-merge centering at ADC");
DEFINE_double(pcd_labeling_range, 30.0,
              "Radius of range for labeling pcd centering at ADC");
DEFINE_bool(enable_merge_obstacle, true,
            "enabling local debug will disabling xlogging");
DEFINE_bool(enable_new_pobs_dump, true,
            "dump merged perception obstacles to a bag file");
151
DEFINE_bool(enable_pcd_labeling, false, "enabling generate pcd labeling image");
S
siyangy 已提交
152 153
DEFINE_string(pcd_image_file_prefix, "/home/liyun/pcd_data/prediction_pcd_",
              "prefix for prediction generated pcd files");
154 155

DEFINE_double(prediction_total_time, 5.0, "Total prediction time");
S
siyangy 已提交
156 157
DEFINE_double(prediction_pedestrian_total_time, 10.0,
              "Total prediction time for pedestrians");
158 159 160 161 162 163 164 165 166 167 168
DEFINE_double(prediction_model_time, 3.0, "Total prediction modeling time");
DEFINE_double(prediction_freq, 0.1, "Prediction frequency.");

// The following gflags are for internal use
DEFINE_bool(enable_unknown_obstacle, true, "Disable unknown obstacle.");
DEFINE_bool(enable_output_to_screen, false, "Enable output to screen");
DEFINE_bool(enable_EKF_tracking, false, "Enable tracking based on EKF");
DEFINE_bool(enable_acc, true, "Enable calculating speed by acc");
DEFINE_bool(enable_pedestrian_acc, false, "Enable calculating speed by acc");

// Cyclist UKF
S
siyangy 已提交
169 170 171
DEFINE_double(
    road_heading_impact, 0.5,
    "Influence of the road heading (when available) in the state update");
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
DEFINE_double(process_noise_diag, 0.01,
              "Diagonal for process noise of cyclist UKF");
DEFINE_double(measurement_noise_diag, 0.01,
              "Diagonal for measurement noise of cyclist UKF");
DEFINE_double(state_covariance_diag_init, 0.01,
              "Diagonal for initial state noise of cyclist UKF");
DEFINE_double(ukf_alpha, 0.001, "Alpha parameter in cyclist UKF model.");
DEFINE_double(ukf_beta, 2.0, "Beta parameter in cyclist UKF model.");
DEFINE_double(ukf_kappa, 0.0, "Kappa parameter in cyclist UKF model.");

DEFINE_int32(stored_frames, 1, "The stored frames before predicting");
DEFINE_double(min_acc, -4.0, "Minimum acceleration");
DEFINE_double(max_acc, 2.0, "Maximum acceleration");
DEFINE_double(min_pedestrian_acc, -4.0, "minimum pedestrian acceleration");
DEFINE_double(max_pedestrian_acc, 2.0, "maximum pedestrian acceleration");
DEFINE_double(default_heading, 6.2831, "Defalut heading");
DEFINE_int32(max_obstacle_size, 1000, "Maximum number of obstacles");
S
siyangy 已提交
189 190 191 192 193 194 195 196
DEFINE_double(max_prediction_length, 100.0,
              "Maximum trajectory length for any obstacle");
DEFINE_double(lane_search_radius, 3.0,
              "The radius for searching candidate lanes");
DEFINE_double(junction_search_radius, 10.0,
              "The radius for searching candidate junctions.");
DEFINE_double(min_lane_change_distance, 20.0,
              "The shortest distance for lane change.");
197
DEFINE_double(proto_double_precision, 1e-6, "Precision of proto double fields");
S
siyangy 已提交
198 199 200 201
DEFINE_double(nearby_obstacle_range, 60,
              "Search range for considering nearby obstacles as feature");
DEFINE_int32(nearby_obstacle_num, 1,
             "Maximal number of nearby obstacles to search.");
202 203 204 205 206 207 208

// Kalman Filter
DEFINE_double(beta, 0.99, "l coefficient for state transferring of (s,l)");
DEFINE_double(cut_in_beta, 0.98, "l coefficient for cut in state transition.");
DEFINE_double(q_var, 0.01, "Q variance for processing");
DEFINE_double(r_var, 0.01, "R variance for measurement");
DEFINE_double(p_var, 0.1, "p variance for prediction");
S
siyangy 已提交
209 210
DEFINE_double(kf_endl, 0.1,
              "Minimum L close enough with lane central reference line");
211 212

// Trajectory
S
siyangy 已提交
213 214
DEFINE_bool(enable_rule_layer, true,
            "enable rule for trajectory before model computation");
215
DEFINE_double(car_length, 4.0, "Length of car");
S
siyangy 已提交
216 217 218 219
DEFINE_int32(trajectory_num_frame, 50,
             "Maximum number of frames in trajectory");
DEFINE_double(trajectory_stretch, 0.5,
              "Percent of extra stretch of trajectory");
220
DEFINE_double(coeff_mul_sigma, 2.0, "coefficient multiply standard deviation");
S
siyangy 已提交
221 222 223 224
DEFINE_bool(enable_velocity_from_history, false,
            "whether to ge speed from feature history");
DEFINE_int32(num_trajectory_still_pedestrian, 6,
             "number of trajectories for static pedestrian");
225 226 227 228 229 230 231 232

// Offline model
DEFINE_bool(running_middle_mode, false, "Running middle mode");
DEFINE_string(feature_middle_file, "/data/example_features.label.bin",
              "Feature middle file with lane seq labels");
DEFINE_string(hdf5_file, "/data/final_feature_label.h5",
              "Final hdf5 file for neural network training");
DEFINE_bool(enable_labelling, false, "Enable labelling data and output result");
S
siyangy 已提交
233 234
DEFINE_bool(enable_feature_to_file, false,
            "Enable to output the extracted feature to txt files");
235
DEFINE_bool(enable_evaluation, false, "Enable dumping evaluational features");
S
siyangy 已提交
236 237 238 239 240 241
DEFINE_int32(num_evaluation_frame, 30,
             "Number of frames for evaluation network");
DEFINE_string(feature_file_path, "/data/features.bin",
              "Path for feature files");
DEFINE_string(feature_file_format, "binary",
              "format of the output feature file [binary / json]");
242 243 244 245 246 247
DEFINE_double(close_time, 0.1, "close in terms of time");
DEFINE_double(close_dist, 0.1, "close in terms of dist");

// Online model
DEFINE_double(target_lane_gap, 5.0, "target lane gap length");
DEFINE_double(model_prob_cutoff, 0.5, "Model probability cutoff");
S
siyangy 已提交
248 249 250 251 252 253 254 255 256 257
DEFINE_double(prediction_feature_timeframe, 3.0,
              "Timeframe for generating features in modeling");
DEFINE_double(threshold_label_time_delta, 2.0,
              "Time threshold to select the labelled feature");
DEFINE_double(prediction_label_timeframe, 3.0,
              "Timeframe for generating label in modeling");
DEFINE_double(prediction_buffer_timeframe, 1.0,
              "Buffer Timeframe in case of message gets late");
DEFINE_int32(pedestrian_static_length, 30,
             "min # of frames to check that a pedestrian is still");
258
DEFINE_double(still_speed, 0.01, "speed considered to be still for pedestrian");
S
siyangy 已提交
259 260
DEFINE_string(default_vehicle_model_file_path,
              "/prediction/parameters/default_model.bin",
261 262
              "default model file path");
DEFINE_string(user_vehicle_model_name, "MlpPlugin", "user model for vehicle");
S
siyangy 已提交
263 264
DEFINE_string(user_vehicle_model_file_path,
              "/prediction/parameters/mlp_model.bin", "user model file path");
265 266
DEFINE_double(kf_max_speed, 20.0, "Maximum speed for tracking");
DEFINE_double(kf_min_speed, 0.5, "Minumum speed for tracking");
S
siyangy 已提交
267 268
DEFINE_double(kf_still_position_diff, 0.5,
              "Default position difference for still obstacle");
269 270 271
DEFINE_double(max_angle_diff, 1.57, "Maximum angle diff is Pi/3");
DEFINE_double(pedestrian_max_speed, 10.0, "speed upper bound for pedestrian");
DEFINE_double(pedestrian_min_speed, 0.1, "min speed for still pedestrian");
S
siyangy 已提交
272 273 274 275
DEFINE_int32(obstacle_static_length, 20,
             "stored frames to judge if a obstacle is static");
DEFINE_double(static_speed_threshold, 1.0,
              "speed threshold to judge if a obstacle is static");
276 277

// Setting
S
siyangy 已提交
278 279 280 281
DEFINE_bool(enable_p_speed_override, false,
            "Override p_speed with tracked prediction speed");
DEFINE_double(threshold_timestamp_diff, 0.50,
              "Maximum timestamp gap between perception and prediction.");
282 283 284 285 286 287 288
DEFINE_double(pc_pob_tolerance, 0.15, "Time diff tolerance for pcd and pobs");

// Traffic law
DEFINE_bool(enable_traffic_light_law, true, "enable traffic light law.");
DEFINE_bool(enable_crosswalk_law, true, "enable crosswalk law.");
DEFINE_bool(enable_clear_zone_law, true, "enable clear zone law.");
DEFINE_double(polygon_length_box_length_max_diff, 2.0,
S
siyangy 已提交
289 290
              "max length diff of polygon and box for checking sl point is "
              "right in uturn");
291 292

// Traffic light law
S
siyangy 已提交
293 294
DEFINE_double(length_of_passing_stop_line_buffer, 4,
              "passing stop line buffer length");
295
DEFINE_double(master_min_speed, 0.1, "min speed when compute deacceleration");
S
siyangy 已提交
296 297 298 299 300 301 302 303
DEFINE_double(
    max_deacceleration_for_red_light_stop, 6.0,
    "treat red light as red when deceleration (abstract value in m/s^2)"
    " is less than this threshold, otherwise treated as green light");
DEFINE_double(
    max_deacceleration_for_yellow_light_stop, 2.0,
    "treat yellow light as red when deceleration (abstract value in m/s^2)"
    " is less than this threshold; otherwise treated as green light");
304

D
Dong Li 已提交
305 306 307 308 309 310 311 312 313 314
DEFINE_string(planning_config_file,
              "modules/planning/conf/planning_config.pb.txt",
              "planning config file");

DEFINE_string(qp_spline_path_config_file,
              "modules/planning/conf/qp_spline_path_config.pb.txt",
              "Qp spline path config file");
DEFINE_string(dp_poly_path_config_file,
              "modules/planning/conf/dp_poly_path_config.pb.txt",
              "Dp poly path config file");
315 316 317
DEFINE_string(dp_st_speed_config_file,
              "modules/planning/conf/dp_st_speed_config.pb.txt",
              "Dp st speed config file");
318 319 320 321 322 323 324
DEFINE_string(st_boundary_config_file,
              "modules/planning/conf/st_boundary_config_file.pb.txt",
              "The config file for st_boundary_config.");
DEFINE_string(qp_spline_st_speed_config_file,
              "modules/planning/conf/qp_spline_st_speed_config_file.pb.txt",
              "The config file for qp_spline_st_speed_config_file.");

325 326
DEFINE_int32(trajectory_point_num_for_debug, 10,
             "number of output trajectory points for debugging");
D
Dong Li 已提交
327 328 329

DEFINE_string(offline_routing_file, "modules/map/data/garage_routing.pb.txt",
              "offline routing file");
330 331 332 333
DEFINE_double(backward_routing_distance, 100.0,
              "The backward routing distance.");
DEFINE_double(decision_valid_stop_range, 0.5,
              "The valid stop range in decision.");
334 335
DEFINE_bool(enable_record_debug, true,
            "True to enable record debug into debug protobuf.");
Z
Zhang Liangliang 已提交
336
DEFINE_bool(enable_prediction, true, "True to enable prediction input.");