fix(costmap_2d_robot): stop dumping every TF frame while waiting for the robot transform

The wait loop logged allFramesAsString() every 5 s on top of the warning, which flooded the log during a long boot. Keep only the throttled warning that names the missing transform and the TF error.
This commit is contained in:
2026-11-04 13:36:25 +07:00
parent 40488b7632
commit b990ce0f25

View File

@@ -161,10 +161,10 @@ void Costmap2DROBOT::getParams(const std::string& config_file_name,const std::st
{
if (last_error + robot::Duration(5.0) < robot::Time::now())
{
std::string all_frames_string = tf_.allFramesAsString();
robot::log_info("[%s:%d]\n INFO: tf allFramesAsString: %s", __FILE__, __LINE__, all_frames_string.c_str());
// std::string all_frames_string = tf_.allFramesAsString();
// robot::log_info("[%s:%d]\n INFO: tf allFramesAsString: %s", __FILE__, __LINE__, all_frames_string.c_str());
// std::cout << std::fixed << std::setprecision(6) << robot::Time::now().toSec() << std::endl;
robot::log_warning("[%s:%d] %0.6f: Timed out waiting for transform from %s to %s to become available before running costmap, tf error: %s\n",
robot::log_warning_throttle(5.0, "[%s:%d] %0.6f: Timed out waiting for transform from %s to %s to become available before running costmap, tf error: %s\n",
__FILE__, __LINE__, robot::Time::now().toSec(), robot_base_frame_.c_str(), global_frame_.c_str(), tf_error.c_str());
last_error = robot::Time::now();
}