除了专门拉出小鱼教程里的特定分支映射;
另解:
<your ws>/src/cartographer_ros/cartographer_ros/src/node_main.cpp
开头部分修改为:
// DEFINE_bool(collect_metrics, false,
// "Activates the collection of runtime metrics. If activated, the "
// "metrics can be accessed via a ROS service.");
// DEFINE_string(configuration_directory, "",
// "First directory in which configuration files are searched, "
// "second is always the Cartographer installation to allow "
// "including files from there.");
DEFINE_string(configuration_basename, "",
"Basename, i.e. not containing any directory prefix, of the "
"configuration file.");
// DEFINE_string(load_state_filename, "",
// "If non-empty, filename of a .pbstream file to load, containing "
// "a saved SLAM state.");
// DEFINE_bool(load_frozen_state, true,
// "Load the saved state as frozen (non-optimized) trajectories.");
DEFINE_bool(
start_trajectory_with_default_topics, true,
"Enable to immediately start the first trajectory with default topics.");
// DEFINE_string(
// save_state_filename, "",
// "If non-empty, serialize state and write it to disk before shutting down.");
DECLARE_bool(collect_metrics);
DECLARE_string(configuration_directory);
DECLARE_string(load_state_filename);
DECLARE_bool(load_frozen_state);
DECLARE_string(save_state_filename);
主要是把和offline_node的重复定义给注释掉并改为纯声明。