How can I reset the simulated clock?
I have a simulator running which publishes the /clock
topic, and I have the /use_sim_time
parameter set to true.
When I start my ROS core and run the simulator the first time, things run normally.
If I stop the simulator and restart it, restarting the clock at 0, I get TF warnings from all of the nodes that are subscribed to TF:
[ WARN] [1399927275.284426178, 678.770000000]: TF_OLD_DATA ignoring data from the past for frame local_utm at time 678.77 according to authority /simulator
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
Is there any way to reset the clock and clear the TF buffer?
According to this post, there should be a /reset_clock
topic that I can publish a stdmsgs::Empty to to trigger a clock reset, and a Reset
button in rivz which will do this for me, but the `/resetclock` topic doesn't seem to exist, and while the button in rviz still exists, it doesn't seem to have the desired effect.
I'm currently using ROS Hydro on Ubuntu 12.04.
Asked by ahendrix on 2014-05-12 10:46:29 UTC
Comments
I think the Reset button in rviz is only for rviz.
Asked by dornhege on 2014-05-12 13:03:32 UTC
I have the same problem. Did you fix it?
Asked by Luis E. Rubio on 2014-09-10 04:11:27 UTC
I haven't found a solution for this yet. I've opened a bug against tf2, but it hasn't gotten any attention from the maintainer: https://github.com/ros/geometry_experimental/issues/64 . As a workaround, I've created launch files for the nodes that need to be restarted, and restart them frequently.
Asked by ahendrix on 2014-09-10 04:45:10 UTC