File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 //
1515 // --- TF config ---
1616 // GLIM publishes TF subtrees "map -> odom -> base_frame" and "imu -> lidar".
17- // imu_frame_id : IMU frame ID
18- // lidar_frame_id : LiDAR frame ID
17+ // imu_frame_id : IMU frame ID (If blank, auto-detected from IMU topic)
18+ // lidar_frame_id : LiDAR frame ID (If blank, auto-detected from points topic)
1919 // base_frame_id : Base frame ID. If blank, IMU frame ID is used.
2020 // odom_frame_id : Odometry frame ID
2121 // map_frame_id : Map frame ID
5252 // IMU config
5353 "imu_time_offset" : 0.0 ,
5454 "points_time_offset" : 0.0 ,
55- "acc_scale" : 1 .0 ,
55+ "acc_scale" : 0 .0 , // Auto-detect if zero
5656 // TF config
57- "imu_frame_id" : " imu " ,
58- "lidar_frame_id" : " lidar " ,
59- "base_frame_id" : " " ,
57+ "imu_frame_id" : " " , // Auto-detect if blank
58+ "lidar_frame_id" : " " , // Auto-detect if blank
59+ "base_frame_id" : " " , // If blank, IMU frame ID is used
6060 "odom_frame_id" : " odom" ,
6161 "map_frame_id" : " map" ,
6262 "publish_imu2lidar" : true ,
Original file line number Diff line number Diff line change @@ -19,6 +19,14 @@ class Config {
1919 Config (const std::string& config_filename);
2020 virtual ~Config ();
2121
22+ /* *
23+ * @brief Check if a parameter exists
24+ * @param module_name Module name
25+ * @param param_name Parameter name
26+ * @return True if the parameter exists, otherwise false
27+ */
28+ bool has_param (const std::string& module_name, const std::string& param_name) const ;
29+
2230 /* *
2331 * @brief Get a parameter
2432 * @param module_name Module name
Original file line number Diff line number Diff line change @@ -26,6 +26,16 @@ Config::Config(const std::string& config_filename) {
2626
2727Config::~Config () {}
2828
29+ bool Config::has_param (const std::string& module_name, const std::string& param_name) const {
30+ const auto & json = std::any_cast<const nlohmann::json&>(config);
31+ auto module = json.find (module_name);
32+ if (module == json.end ()) {
33+ return false ;
34+ }
35+
36+ return module ->find (param_name) != module ->end ();
37+ }
38+
2939void Config::save (const std::string& path) const {
3040 const auto & json = std::any_cast<const nlohmann::json&>(config);
3141
You can’t perform that action at this time.
0 commit comments