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

Updating RViz display without clock being published (use_sim_time is true)

asked 2013-01-22 05:29:51 -0500

mmedvede gravatar image

updated 2013-01-23 04:41:22 -0500

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-01-22 15:24:16 -0500

joq gravatar image

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.

edit flag offensive delete link more

Comments

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.

mmedvede gravatar image mmedvede  ( 2013-01-23 04:45:58 -0500 )edit

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.

joq gravatar image joq  ( 2013-01-23 04:54:20 -0500 )edit

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.

mmedvede gravatar image mmedvede  ( 2013-01-23 05:02:06 -0500 )edit

Fighting with rosbag over who generates simulated time does not sound very promising. Are you guaranteed that rosbag will never resume after the pause?

joq gravatar image joq  ( 2013-01-23 05:06:39 -0500 )edit

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.

mmedvede gravatar image mmedvede  ( 2013-01-23 05:13:54 -0500 )edit

Probably so, tf is very sensitive to missing parts of the tree. Until messages can be fully transformed, rviz does not see them.

joq gravatar image joq  ( 2013-01-23 05:19:01 -0500 )edit

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

mmedvede gravatar image mmedvede  ( 2013-01-23 05:46:21 -0500 )edit

The parts need not be missing, just not up to date. I think you are right that it will not work.

joq gravatar image joq  ( 2013-01-23 13:25:53 -0500 )edit

Question Tools

Stats

Asked: 2013-01-22 05:29:51 -0500

Seen: 1,743 times

Last updated: Jan 23 '13