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.");
CHECK(!FLAGS_configuration_directory.empty()) << "-configuration_directory is missing."; CHECK(!FLAGS_configuration_basename.empty()) << "-configuration_basename is missing.";
case ::google::GLOG_WARNING: ROS_WARN_STREAM(message_string); break;
case ::google::GLOG_ERROR: ROS_ERROR_STREAM(message_string); break;
case ::google::GLOG_FATAL: ROS_FATAL_STREAM(message_string); will_die_ = true; break; } }
WaitTillSent()会在每次send后调用, 用于一些异步写的场景
1 2 3 4 5
voidScopedRosLogSink::WaitTillSent(){ if (will_die_) { // Give ROS some time to actually publish our message. std::this_thread::sleep_for(std::chrono::milliseconds(1000)); }