ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Interactive Marker with rosbag "ROS Time moved backwards"

asked 2016-04-28 13:57:37 -0600

curranw gravatar image

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/ht... ).

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 use_sim_time set to true and --clock set.

Thanks

edit retag flag offensive close merge delete

Comments

I also get the "ROS time moved backwards" when trying to use rospy.sleep() with rosbag play -l, and I finally get around it by using time.sleep() instead.

lunmre gravatar image lunmre  ( 2017-03-17 06:00:07 -0600 )edit
1

I've converted your answer to a comment, as what you propose is not really a solution: rospy.sleep() uses ROS Time, while time.sleep() uses walltime, which may not be the same (fi if you're playing a bag, or using a simulator).

gvdhoorn gravatar image gvdhoorn  ( 2017-03-17 06:59:42 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-09-10 04:29:08 -0600

moooeeeep gravatar image

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.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2016-04-28 13:57:37 -0600

Seen: 2,536 times

Last updated: Sep 10 '19