0
$\begingroup$

Rosanswers logo

I am playing back a bag file and need to be able to move things around while the bag is on pause. I have an interactive marker that broadcasts its pose as a transform. I also have a laser scan in the frame of the marker's transform frame. RViz does update transform tree display and interactive marker, but the laser scan only moved to the new location when I resume the bag playback.

The laser scan is published by a node (not by the rosbag) based on wallclock. To force the RViz to update the scan I tried to change laser scan time stamp. I tried to publish to /clock myself, incrementing the timestamp while the bag is on pause (I remapped the rosbag's /clock). Nothing did work.

Edit: The laser scan I want to move in the rviz display is published with ros::wallTimer callback (frequency does not depend on simulation clock). It is stamped based on the last /clock message from the bag. I was hoping to figure out how to get the laser scan to be redrawn at the correct location according to updated tf tree, without resuming the bag playback.

The goal is to be able to get some measurements done on the recorded data using convenience of RViz infrastructure.


Originally posted by mmedvede on ROS Answers with karma: 221 on 2013-01-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Setting /use_sim_time true should be done globally. Having some nodes run with wall clock time makes no sense.

If your laser driver publishes data to the same ROS graph, make sure it uses simulated time, as well.


Originally posted by joq with karma: 25443 on 2013-01-22

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by mmedvede on 2013-01-23:
Thank you for the answer. I should have specified I use wallTimer callback, and I do not use wall time to stamp any of the messages I send out when the bag playback is on pause.

Comment by joq on 2013-01-23:
The problem is that rviz uses ros::time, which does not change while rosbag is paused. I can't think of any way around that.

Comment by mmedvede on 2013-01-23:
I did try to publish my own time to /clock. It was slightly incremented compared to the one that rosbag published. The rosbag /clock has been remapped to /clock2, as it keeps publishing the clock even when playback is on hold.

Comment by joq on 2013-01-23:
Fighting with rosbag over who generates simulated time does not sound very promising. Are you guaranteed that rosbag will never resume after the pause?

Comment by mmedvede on 2013-01-23:
No, rosbag would resume after the pause. This is a problem if my own clock ran ahead of the rosbag's. The thing is, even publishing my own clock does not make RViz to redraw. I wander if RViz needs the full tf tree with the newer stamps along with the new clock to redraw.

Comment by joq on 2013-01-23:
Probably so, tf is very sensitive to missing parts of the tree. Until messages can be fully transformed, rviz does not see them.

Comment by mmedvede on 2013-01-23:
My tf tree does not have any parts missing and is fully connected at all times. In any case, what I want seems to bee too convoluted to implement with RViz right now. Thank you

Comment by joq on 2013-01-23:
The parts need not be missing, just not up to date. I think you are right that it will not work.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.