RViz requires not only data to display, but also TF transform information that is published on separate topic. If TF data was not generated when .bag file was recorded, then it would be missing. Thus you probably need to spoof some dummy TF transform, just so RViz is happy.
The other problem is that, to spoof TF data correctly, you need to spoof them with timestamps corresponding to data from .bag file. Which means you need to use simulated clock from bag file.
Try the following:
start roscore as normal
setup roscore to use simulation time (I read that rosbag should do it automatically, but it didn't seem to work for me):
rosparam set use_sim_time true
start dummy TF transform
rosrun tf static_transform_publisher 0 0 0 0 0 0 map dummy_frame 100
Where:
- 0 0 0 0 0 0 is offset and rotation for child frame "dummy_frame" - this does not matter
- map is source "global" frame - this is the one you are missing (this should really be fixed in RViz, if no frames, then assume global frame exists with default name?)
- dummy_frame - static_transform_publisher needs some child frame to work with - does not matter
- 100 - publish rate in ms
Play bag file along with clock signal for other ROS nodes
rosbag play --clock mydata.bag
Start Rviz
Hope this helps.
Originally posted by Marcin Bogdanski with karma: 231 on 2016-08-08
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by lisa on 2016-08-08:
Thank you for your detailed answer. It was so clear, I succeed on first try =)
Comment by Marcin Bogdanski on 2016-08-08:
I just realized parameter description got folded into one long unreadable blob. Now fixed. Happy to help.