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

How to playback pointcloud in rviz which was recorded using rosbag

asked 2013-08-11 23:01:02 -0600

ljk gravatar image

updated 2016-10-24 08:59:29 -0600

ngrennan gravatar image

Hi my friends, I am quite new to ROS and pointcloud. I am running some experiments with pointcloud using kinect.

after running roslaunch openni_launch openni.launch and rosbag record /camera/depth/points for a few seconds, i terminate the recording and get a .bag file in /bagfile. Now i want to play back the .bag file and visualize it in rviz. Any clue how to achieve this? Thanks a lot for your kind instruction!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
13

answered 2013-08-11 23:18:33 -0600

fergs gravatar image

You'll want to set use_sim_time to true (do this BEFORE starting rviz):

rosparam set use_sim_time true

Then use rosbag, and republish the clock:

rosbag play name_of_bagfile.bag --clock
edit flag offensive delete link more

Comments

Thanks fergs! It works! btw, it should be " /user_sim_time"

ljk gravatar image ljk  ( 2013-08-12 03:29:40 -0600 )edit
1

No, it should be use_sim_time, just as @fergs wrote.

Martin Günther gravatar image Martin Günther  ( 2013-08-12 04:47:17 -0600 )edit

sorry~~my fault, should be "use_sim_time" or "/use_sim_time" ,both are fine

ljk gravatar image ljk  ( 2013-08-13 00:12:48 -0600 )edit

Do you mean that first 'rosparam set use_sim_time true' and then run rviz and then 'rosbag play name_of_bagfile.bag --clock'? I do the same procedure but cant play back the data. Furthermore, my rosbag record just record only 2 seconds for the kinect. How can I fix it? Thanks a lot.

Battery gravatar image Battery  ( 2013-11-08 01:58:34 -0600 )edit

Yes, rosrun rviz rviz after setting param true. What I do is,run as above, quickly set the topic, then run the bag again and the topic will show as expected inside rviz. You have a bag that was recorded for 2s - dont set the time and you can record as long as you like: rosbag record -O subset /topic

kleinsplash gravatar image kleinsplash  ( 2014-02-09 22:44:37 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2013-08-11 23:01:02 -0600

Seen: 13,491 times

Last updated: Aug 11 '13