From b990ce0f256212b7abc1e0411299694c86d8c4f3 Mon Sep 17 00:00:00 2001 From: duongtd Date: Wed, 4 Nov 2026 13:36:25 +0700 Subject: [PATCH] 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. --- src/costmap_2d_robot.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/costmap_2d_robot.cpp b/src/costmap_2d_robot.cpp index f03fe32..86b6a8e 100644 --- a/src/costmap_2d_robot.cpp +++ b/src/costmap_2d_robot.cpp @@ -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(); }