Ask Your Question

Unable to visualise point cloud from rosbag file in RViz

asked 2019-08-28 11:31:30 -0500

mun gravatar image

updated 2019-08-29 07:49:53 -0500

I have a .bag file which should contain point cloud and RGBD images. However, I'm unable to visualise them in RViz whilst playing the .bag file. This is what I have done:

1) Record using rosbag record camera/depth_registered/image_raw camera/depth_registered/camera_info camera/rgb/image_raw camera/rgb/camera_info --limit=120 -O astra

2) Start roscore

3) rosparam set use_sim_time true

4) rosrun tf static_transform_publisher 0 0 0 0 0 0 map dummy_frame 100

5) rosbag play --clock astra.bag

6) Start rviz

This is the result I get:

image description

Here's my bag file.

Am I missing anything?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-08-29 02:56:55 -0500

pavel92 gravatar image

updated 2019-08-29 02:58:10 -0500

I just tested it with you bag file and it works. You just need to change your static publisher to publish to a tf to between map and camera_depth_optical_frame:

rosrun tf static_transform_publisher 0 0 0 0 0 0 map camera_depth_optical_frame 100

Here is the result:
image description

edit flag offensive delete link more


I'm now trying your suggestion rosrun tf static_transform_publisher 0 0 0 0 0 0 map camera_depth_optical_frame 100 but the point cloud still doesn't show (screenshot) Is your configuration like this?

mun gravatar imagemun ( 2019-08-29 06:47:49 -0500 )edit

you bag is pretty short (7secs) and maybe it fails to load it the first time. Try adding a looping when replaying the bag and check if it picks up the cloud:

rosbag play --clock -l astra.bag
pavel92 gravatar imagepavel92 ( 2019-08-29 06:54:19 -0500 )edit

That's what I thought too and I've tried the -l flag, but still no point cloud. Did you have to make any special setting to get it to show?

mun gravatar imagemun ( 2019-08-29 07:03:25 -0500 )edit

do you get any warnings/errors when you launch your RViz config?

pavel92 gravatar imagepavel92 ( 2019-08-29 07:16:38 -0500 )edit

The only warning I get is [ WARN] [1567081149.663349526]: Messages of type 1 arrived closer (0.031979627) than the lower bound you provided (0.500000000) (will print only once). But I get that when I feed straight from the camera in real-time as well (which works fine).

mun gravatar imagemun ( 2019-08-29 07:20:38 -0500 )edit

yes I get the same. There is something wrong with starting RViz with defined config. Try to disable and enable the plugins one by one. Also re-select the same topics and fixed frame when you load your RViz config. This fixed it for me

pavel92 gravatar imagepavel92 ( 2019-08-29 09:09:11 -0500 )edit

Strange. Do you mind uploading your config somewhere? I've tried reselecting the topics and fixed frame, but still on point cloud. My rviz is a fresh install and I don't have any custom plugin.

mun gravatar imagemun ( 2019-08-29 09:17:53 -0500 )edit

well I am not using any custom plugins but you can still try with my config. If it does not work try re-selecting the fixed_frame, uncheck and check the DepthCloud display and re-select the two topics within it

pavel92 gravatar imagepavel92 ( 2019-08-29 09:28:54 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-08-28 11:31:30 -0500

Seen: 23 times

Last updated: Aug 29