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

Revision history [back]

click to hide/show revision 1
initial version

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: 1) start roscore as normal 2) 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

3) start dummy TF transform

rosrun tf static_transform_publisher 0 0 0 0 0 0 map dumm_frame 100

Where: 0 0 0 0 0 0 is offset and rotation for child frame "dumm_frame" 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

4) Play bag file along with clock signal for other ROS nodes

rosbag play --clock mydata.bag

5) Start Rviz

Hope this helps.

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: 1) start roscore as normal 2) 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

3) start dummy TF transform

rosrun tf static_transform_publisher 0 0 0 0 0 0 map dumm_frame dummy_frame 100

Where: Where:

  • 0 0 0 0 0 0 is offset and rotation for child frame "dumm_frame" "dummy_frame" - this does not matter 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?) name?)
  • dummy_frame - static_transform_publisher needs some child frame to work with - does not matter matter
  • 100 - publish rate in ms

4) Play bag file along with clock signal for other ROS nodes

rosbag play --clock mydata.bag

5) Start Rviz

Hope this helps.

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: following:

1) start roscore as normal normal

2) 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

3) 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

4) Play bag file along with clock signal for other ROS nodes

rosbag play --clock mydata.bag

5) Start Rviz

Hope this helps.