Apollo 11.0
自动驾驶开放平台
localization_gflags.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
18
19DEFINE_string(localization_module_name, "localization",
20 "localization module name");
21
22DEFINE_double(localization_publish_freq, 100,
23 "localization publishing frequency.");
24
25DEFINE_string(localization_config_file,
26 "/apollo/modules/localization/conf/localization_config.pb.txt",
27 "localization config file");
28
29// features
30DEFINE_bool(enable_gps_imu_interprolate, true, "enable GPU/IMU interprolate");
31
32DEFINE_bool(enable_gps_imu_compensate, false,
33 "enable compensate of GPU/IMU timestamp");
34
35DEFINE_int32(gps_imu_compensate_ns_tolerance, 10000000,
36 "tolerance of GPU/IMU timestamp compensator");
37
38DEFINE_bool(enable_watchdog, true, "enable watchdog");
39
40DEFINE_double(gps_time_delay_tolerance, 1.0,
41 "gps message time delay tolerance (sec)");
42
43DEFINE_double(gps_imu_timestamp_sec_diff_tolerance, 20e-3,
44 "gps/imu timestamp diff tolerance (sec)");
45
46DEFINE_double(timestamp_sec_tolerance, 10e-7, "timestamp second tolerance");
47// map offset
48DEFINE_double(map_offset_x, 0.0, "map_offsite: x");
49DEFINE_double(map_offset_y, 0.0, "map_offsite: y");
50DEFINE_double(map_offset_z, 0.0, "map_offsite: z");
51
52DEFINE_int32(report_threshold_err_num, 10, "report threshold error num");
53DEFINE_double(report_gps_imu_time_diff_threshold, 0.02,
54 "report threshold of timestamp diff between gps and imu(sec)");
55
56DEFINE_bool(enable_gps_timestamp, false,
57 "True to set gps timestamp as localization header timestamp");
58
59// msf parame
60DEFINE_string(local_map_name, "local_map", "The path of localization map.");
61DEFINE_string(lidar_extrinsics_file,
62 "/apollo/modules/localization/msf/params/velodyne_params/"
63 "velodyne64_novatel_extrinsics_example.yaml",
64 "Lidar extrinsics parameter file.");
65DEFINE_string(lidar_height_file,
66 "/apollo/modules/localization/msf/params/velodyne_params/"
67 "velodyne64_height.yaml",
68 "Velodyne extrinsic path for the vehicle in use, "
69 "where <ros> is the placeholder of ROS root.");
70DEFINE_double(lidar_height_default, 1.80,
71 "The height from the center of velodyne to ground.");
73 lidar_localization_mode, 2,
74 "Localization mode, 0 for intensity, 1 for altitude, 2 for fusion.");
75DEFINE_int32(lidar_yaw_align_mode, 2,
76 "image yaw align mode, 0 for align off, "
77 "1 for fusion, 2 for fusion with multithread.");
78DEFINE_int32(lidar_filter_size, 17, "Lidar filter size");
79DEFINE_double(lidar_imu_max_delay_time, 0.4,
80 "Lidar msg and imu msg max delay time");
81DEFINE_double(lidar_map_coverage_theshold, 0.9,
82 "Threshold to detect whether vehicle is out of map");
83DEFINE_bool(lidar_debug_log_flag, false, "Lidar Debug switch.");
84DEFINE_int32(point_cloud_step, 2, "Point cloud step");
85DEFINE_bool(if_use_avx, false,
86 "if use avx to accelerate lidar localization, "
87 "need cpu to support AVX intel instrinsics");
88
89// integ module
90DEFINE_bool(integ_ins_can_self_align, false, "");
91DEFINE_bool(integ_sins_align_with_vel, true, "");
92DEFINE_bool(integ_sins_state_check, false, "");
93DEFINE_double(integ_sins_state_span_time, 60.0, "");
94DEFINE_double(integ_sins_state_pos_std, 1.0, "");
95DEFINE_double(vel_threshold_get_yaw, 5.0, "");
96
97// gnss module
98DEFINE_bool(enable_ins_aid_rtk, false, "");
99DEFINE_string(eph_buffer_path, "", "");
101 ant_imu_leverarm_file,
102 "/apollo/modules/localization/msf/params/gnss_params/ant_imu_leverarm.yaml",
103 "Ant to imu leferarm.");
104DEFINE_bool(gnss_debug_log_flag, false, "Gnss Debug switch.");
105DEFINE_bool(if_imuant_from_file, true, "Use imu ant from gnss configure file.");
106DEFINE_double(imu_to_ant_offset_x, 0.0, "Imu ant offset x");
107DEFINE_double(imu_to_ant_offset_y, 0.0, "Imu ant offset y");
108DEFINE_double(imu_to_ant_offset_z, 0.0, "Imu ant offset z");
109DEFINE_double(imu_to_ant_offset_ux, 0.0, "Imu ant offset x uncertainty");
110DEFINE_double(imu_to_ant_offset_uy, 0.0, "Imu ant offset y uncertainty");
111DEFINE_double(imu_to_ant_offset_uz, 0.0, "Imu ant offset z uncertainty");
112
113// common
114DEFINE_double(imu_rate, 1.0, "");
115DEFINE_bool(if_utm_zone_id_from_folder, true,
116 "load utm zone id from local map folder");
117DEFINE_bool(trans_gpstime_to_utctime, false, "");
118DEFINE_int32(gnss_mode, 0, "GNSS Mode, 0 for bestgnss pose, 1 for self gnss.");
119DEFINE_bool(imu_coord_rfu, true, "Right/forward/up");
120DEFINE_bool(gnss_only_init, false,
121 "Whether use bestgnsspose as measure after initializaiton.");
122DEFINE_bool(enable_lidar_localization, true,
123 "Enable lidar-based localization.");
124
125DEFINE_string(lidar_topic, "/apollo/sensor/lidar128/compensator/PointCloud2",
126 "lidar pointcloud topic");
127DEFINE_string(broadcast_tf_frame_id, "world", "world frame id in tf");
128DEFINE_string(broadcast_tf_child_frame_id, "localization",
129 "localization frame id in tf");
130// imu vehicle extrinsic
131DEFINE_string(vehicle_imu_file,
132 "/apollo/modules/localization/msf/params"
133 "/vehicle_params/vehicle_imu_extrinsics.yaml",
134 "Vehicle coord to imu coord.");
135DEFINE_bool(if_vehicle_imu_from_file, true,
136 "Whether load vehicle imu extrinsic from yaml file");
137DEFINE_double(imu_vehicle_qx, 0.0, "Vehicle imu quaternion qx");
138DEFINE_double(imu_vehicle_qy, 0.0, "Vehicle imu quaternion qy");
139DEFINE_double(imu_vehicle_qz, 0.0, "Vehicle imu quaternion qz");
140DEFINE_double(imu_vehicle_qw, 1.0, "Vehicle imu quaternion qw");
141
142// visualization
143DEFINE_string(map_visual_dir, "data/map_visual",
144 "The path of map_visual folder.");
145
146// Status
147DEFINE_double(imu_delay_time_threshold_1, 0.1,
148 "imu delay time is larger than 0.1s");
149DEFINE_double(imu_delay_time_threshold_2, 0.05,
150 "imu delay time is larger than 0.05s");
151DEFINE_double(imu_delay_time_threshold_3, 0.02,
152 "imu delay time is larger than 0.02s");
153
154DEFINE_double(imu_missing_time_threshold_1, 0.1,
155 "imu missing time is larger than 0.1s");
156DEFINE_double(imu_missing_time_threshold_2, 0.05,
157 "imu missing time is larger than 0.05s");
158DEFINE_double(imu_missing_time_threshold_3, 0.01,
159 "imu missing time is larger than 0.01s");
160
161DEFINE_double(bestgnsspose_loss_time_threshold, 2.0,
162 "threshold for time gap between imu and bestgnsspose time");
163DEFINE_double(lidar_loss_time_threshold, 2.0,
164 "threshold for time gap between imu and lidar pose time");
165
166DEFINE_double(localization_std_x_threshold_1, 0.15,
167 "threshold for lateral std of localization result");
168DEFINE_double(localization_std_y_threshold_1, 0.15,
169 "threshold for longitudinal std of localization result");
170
171DEFINE_double(localization_std_x_threshold_2, 0.3,
172 "threshold for lateral std of localization result");
173DEFINE_double(localization_std_y_threshold_2, 0.3,
174 "threshold for longitudinal std of localization result");
175
176// ndt localization
177DEFINE_string(ndt_map_dir, "ndt_map", "subdirectory for ndt map");
178DEFINE_bool(ndt_debug_log_flag, false, "NDT Localization log switch");
179DEFINE_double(online_resolution, 2.0, "NDT online pointcloud resolution");
180DEFINE_int32(ndt_max_iterations, 10, "maximum iterations for NDT matching");
181DEFINE_double(ndt_target_resolution, 1.0,
182 "target resolution for ndt localization");
183DEFINE_double(ndt_line_search_step_size, 0.1,
184 "line search step size for ndt matching");
185DEFINE_double(ndt_transformation_epsilon, 0.01,
186 "iteration convergence condition on transformation");
187DEFINE_int32(ndt_filter_size_x, 48, "x size for ndt searching area");
188DEFINE_int32(ndt_filter_size_y, 48, "y size for ndt searching area");
189DEFINE_int32(ndt_bad_score_count_threshold, 10,
190 "count for continuous bad ndt fitness score");
191DEFINE_double(ndt_warnning_ndt_score, 1.0,
192 "warnning ndt fitness score threshold");
193DEFINE_double(ndt_error_ndt_score, 2.0, "error ndt fitness score threshold");
DEFINE_int32(gps_imu_compensate_ns_tolerance, 10000000, "tolerance of GPU/IMU timestamp compensator")
DEFINE_double(localization_publish_freq, 100, "localization publishing frequency.")
DEFINE_bool(enable_gps_imu_interprolate, true, "enable GPU/IMU interprolate")
DEFINE_string(localization_module_name, "localization", "localization module name")
The gflags used by localization module