Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Sometimes I want to show a message that a node is waiting for a message on a specific topic. For that, I use ROS_DEBUG_THROTTLE.
However, ROS_DEBUG_THROTTLE shows a message on first call. I would like to have a Delayed (hence DTHROTTLE, name to be discussed), that would first show the message after the specified rate elapsed.
I'm OK to write a PR after the name has been discussed.
The behavior would be the same as ROS_DEBUG_THROTTLE with the exception of the time of the first message:
Does it make sense?
Ok, I think I get the idea.
The implementation is pretty straight forward. For each message the current time is compared to the last printed message and if the duration exceeds the interval the message is actually printed and the last timestamp updated.
How would you described the new macro and how would you imagine the implementation to work?
The implementation is straight forward, I think,
in include/ros/console.h, copy ROS_LOG_THROTTLE to ROS_LOG_DTHROTTLE and replace
static double last_hit = 0.0; \ ::ros::Time now = ::ros::Time::now(); \
::ros::Time now = ::ros::Time::now(); \ static double last_hit = now.toSec(); \
For the description, I would write something like:
I didn't really replied one question: "If the macro is only being called once but not again later you want the message to be sent after a delay?"