Manipulate ROS time
Hello,
I would like to "jump" forward in ROS time by using setNow. But the point is, that after calling ROS::setNow(newNow), the ROS::time::now() function always returns the same value, the newNow value. By calling ROS::time::init() the g_use_sim_time is set to false again, but the now time is the old time again.
Is it possible to achieve a "jump" in ROS::time::now()?
I am running ROS kinetic.
Just to avoid an xy-problem (and don't take this the wrong way): can you explain what it is that you're actually trying to achieve?
I am replaying data files into the ROS system. Some files are having a long waiting time at the beginning, and to avoid waiting everytime I would like to make an initial jump to the first timestamp.
PS: there are different workarounds, by not manipulating the ros Time, but they have dissadvantages
Are these data files rosbags?
Not rosbags, but a similiar data container format.
I'm wondering if it might not make sense to have your 'player' publish to the
clock
topic - asrosbag
does. That would put you in complete control of the clock values used in the ROS application (ie: other nodes) that receives the data.