Skip to content
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

Fix log*_throttle with sim time #2044

Merged
merged 2 commits into from
Sep 17, 2020

Conversation

salihmarangoz
Copy link
Contributor

When log*_throttle is used with bags or a simulation, logging stops when bag/simulation restarts. Solved this problem with resetting logging_time_table when ros time moved backward.

Testing code:

import rospy

rospy.init_node('test_node')

while not rospy.is_shutdown():
    rospy.loginfo_throttle(100.0, "Throttled message!")

When log*_throttle is used with bags or a simulation, logging stops. Solved this problem with resetting logging_time_table when ros time moved backward
@@ -223,6 +223,9 @@ def __call__(self, caller_id, period):
(now - last_logging_time) > rospy.Duration(period)):
self.last_logging_time_table[caller_id] = now
return True
elif (last_logging_time > now):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: please remove the parenthesis.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks

clients/rospy/src/rospy/core.py Show resolved Hide resolved
removed paranthesis
fixed a bug where client loses a log message when rostime goes backward
@salihmarangoz
Copy link
Contributor Author

It should be ok now

@dirk-thomas
Copy link
Member

Thanks for the patch.

@dirk-thomas dirk-thomas merged commit 84d413f into ros:noetic-devel Sep 17, 2020
jacobperron pushed a commit that referenced this pull request Oct 16, 2020
* Fix log*_throttle with sim time

When log*_throttle is used with bags or a simulation, logging stops. Solved this problem with resetting logging_time_table when ros time moved backward

* fixed a bug where client loses a log message when rostime goes backward

removed paranthesis
fixed a bug where client loses a log message when rostime goes backward
jacobperron pushed a commit that referenced this pull request Oct 22, 2020
* Fix log*_throttle with sim time

When log*_throttle is used with bags or a simulation, logging stops. Solved this problem with resetting logging_time_table when ros time moved backward

* fixed a bug where client loses a log message when rostime goes backward

removed paranthesis
fixed a bug where client loses a log message when rostime goes backward
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants