From cddd336c7f673d2c90bccb122dd84185f43af537 Mon Sep 17 00:00:00 2001 From: Salih Date: Sat, 12 Sep 2020 12:59:56 +0300 Subject: [PATCH 1/2] 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 --- clients/rospy/src/rospy/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clients/rospy/src/rospy/core.py b/clients/rospy/src/rospy/core.py index e5e315f4d8..4707e2e7be 100644 --- a/clients/rospy/src/rospy/core.py +++ b/clients/rospy/src/rospy/core.py @@ -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): + self.last_logging_time_table = {} + return True return False From ea051098c67415e19a2a6b67f3b7127b3d7c7dcc Mon Sep 17 00:00:00 2001 From: Salih Date: Fri, 18 Sep 2020 00:28:43 +0300 Subject: [PATCH 2/2] 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 --- clients/rospy/src/rospy/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clients/rospy/src/rospy/core.py b/clients/rospy/src/rospy/core.py index 4707e2e7be..784b0b32c1 100644 --- a/clients/rospy/src/rospy/core.py +++ b/clients/rospy/src/rospy/core.py @@ -223,8 +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): + elif last_logging_time > now: self.last_logging_time_table = {} + self.last_logging_time_table[caller_id] = now return True return False