Interactive Marker with rosbag "ROS Time moved backwards"
I'm using rqt_bag to visualize a rosbag in RViz. Independently of that, I publish a interactive marker that changes colors based on a topic being published. This works well, until I move backwards in the rosbag, then the interactive marker throws an exception because the ROS time moved backwards. Specifically, the sleep() method in the rospy timer (http://docs.ros.org/jade/api/rospy/html/rospy.timer-pysrc.html).
I've tried changing the interactive marker header stamp to rospy.time.now() and I've tried just a static non-changing time.
I've also tried deleting the interactive marker whenever I go backwards in time, but the error procs before I can delete the marker.
Am I trying to do something that is not possible with the way Interactive Markers work?
I have usesimtime set to true and --clock set.
Thanks
Asked by curranw on 2016-04-28 13:57:37 UTC
Answers
The issue is caused by the default response behavior of rospy.Timer
when confronted with a /clock
signal jumping backwards.
This shouldn't be an issue here, so it should be possible to just ignore the incident and reset the timer. I suggested a patch in this PR.
Asked by moooeeeep on 2019-09-10 04:29:08 UTC
Comments
I also get the "ROS time moved backwards" when trying to use
rospy.sleep()
withrosbag play -l
, and I finally get around it by usingtime.sleep()
instead.Asked by lunmre on 2017-03-17 06:00:07 UTC
I've converted your answer to a comment, as what you propose is not really a solution:
rospy.sleep()
uses ROS Time, whiletime.sleep()
uses walltime, which may not be the same (fi if you're playing a bag, or using a simulator).Asked by gvdhoorn on 2017-03-17 06:59:42 UTC