-
Notifications
You must be signed in to change notification settings - Fork 913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ROS_DEBUG_DTHROTTLE #571
Comments
I am not sure I understand the expected behavior. Can you please clarify. If the macro is only being called once but not again later you want the message to be sent after a delay? |
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 current
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(); \ with ::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?" |
Ok, as you said if in the loop it calls it a couple of times but less then the duration it doesn't print anything. Does that imply that if then much later a single call happens it will be immediately printed? |
I guess this would make sense to print immediately if the macro is called again after a long period of time, because this would not be the first call, for behavior consistency. |
@dirk-thomas Any further comment? |
That sounds like a reasonable behavior. It would be great if you could provide a PR for that. |
Regarding the name I think |
You're right about the clarity of the name. But with your proposed name, this would give a very long name for the longest macro |
I don't have a better proposal at the moment. So, ok. |
Can you please update the wiki page describing the macros to mention the newly added ones? You should annotate this with (added in Indigo as of |
Done! |
Thank you! |
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 text was updated successfully, but these errors were encountered: