Ask Your Question

Minimal Topics for RGBDSLAM?

asked 2012-03-22 05:57:31 -0500

Yo gravatar image

updated 2016-10-24 09:10:35 -0500

ngrennan gravatar image

I'd like to record some bag files of Kinect data and then run RGBDSLAM on them later. (The computer I'm doing the collection with isn't up to doing the RGBDSLAM itself.)

The problem is that I want to keep the bag files as small as possible, so I want to collect the minimal amount of data necessary.

In particular, that means I would like to record to the bag file the smallest number of topics possible, and preferably only image topics and the like -- PointCloud2 messages are quite large in comparison.

Can someone tell me exactly which topics are necessary for running RGBDSLAM off a bag file, and walk me through how to get RGBDSLAM to use only them? (Also, I'm a little confused about whether I should be using the dynamic_reconfigure reconfigure_gui to turn on OpenNI's depth registration or not...)

I thought I needed only RGB and depth image and possibly camera info topics, but when I tried running RGBDSLAM off of only those, it kept saying it was waiting for various other things. I think maybe I just need to change the parameters in the launch file to tell it that those are the only things I want it to work with, but I can't figure out how to do that properly.

Any help would be greatly appreciated! :)


As a specific example of one of the things I've tried, I ran the following:

$ rosbag record /camera/depth_registered/image_rect_raw /camera/rgb/image_rect_color /camera/rgb/camera_info

I then ran the RGBDSLAM GUI and pressed the space key. The status bar displayed:

Processing. Waiting for motion information.

I then started playback of the bag file. Nothing changed.

Edit 2:

I followed Felix's directions, and everything worked swell... except for one problem. The depth images were not registered with the RGB images, so the textures in the resulting map were all incorrect.

So I tried again, this time using openni_launch openni.launch, using the dynamic_reconfigure reconfigure_gui to turn on depth registration (/camera/driver --> depth registration checkbox), and then using the following call to rosbag to record the bag file:

$ rosbag record -o /home/full/path/and/filename_prefix /tf /camera/rgb/image_color /camera/rgb/camera_info /camera/depth_registered/image /camera/depth/camera_info

I then ran the following launch file on this bag file (pressing the spacebar to start the processing once the GUI came up):

  <node pkg="rgbdslam" type="rgbdslam" name="rgbdslam" cwd="node" required="false" output="log" > 
    <!-- see rgbslam_sample_config.launch for all available parameters and their default values -->
      <param name="config/topic_image_mono"              value="/camera/rgb/image_color"/>

<param name="config/topic_image_depth"             value="/camera/depth_registered/image"/>
<param name="config/topic_points"                  value=""/> <!--if empty, poincloud will be reconstructed from image and depth -->
<param name="config/camera_info_topic"             value="/camera/rgb/camera_info"/>
<param name="config/bagfile_name"                  value="/home/full/path/and/filename.bag"/>
<param name="config/start_paused"                  value="true"/>

      <param name="config/wide_topic"                    value=""/>;
      <param name="config/wide_cloud_topic"              value=""/>;
      <param name="config/drop_async_frames"             value="true"/> <!-- Check association of ...
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-03-26 02:16:39 -0500

updated 2012-03-26 02:21:54 -0500

The best way in general is to record the following:

  1. /tf
  2. /camera/rgb/image_mono OR /camera/rgb/image_color if you want color
  3. /camera/rgb/camera_info
  4. /camera/depth/image
  5. /camera/depth/camera_info

/tf is not strictly required but helpful depending on the use case. The rosbag command is then:

rosbag record -O filename-prefix /tf /camera/rgb/image_color /camera/rgb/camera_info /camera/depth/image /camera/depth/camera_info

I still use the openni_camera package to get the data, that would be:

roslaunch openni_camera openni_node.launch

Have a look at the file launch/rgbdslam.launch. If necessary adapt to your choice of grayscale image: change the first parameter to /camera/rgb/image_mono

Play the bagfile (but stop the openni_node first):

rosbag play filename-prefix-some-date-string.bag

Have a look at the options (rosbag help play). Reducing the playback rate might help unless you have a really fast computer.

Alternatively, you can set the bagfile_name parameter (see the example config launchfile to your bagfile. Use an absolute path. The start_paused parameter could make things more convenient.

Then run rgbdslam from the (adapted) launch file

roslaunch rgbdslam rgbdslam.launch
edit flag offensive delete link more


Awesome, thank you, Felix! :) I'm still having some trouble however -- please see Edit 2 in the question. :)

Yo gravatar image Yo  ( 2012-03-27 06:57:15 -0500 )edit

Interesting. Are you using openni_launch or openni_camera? That could cause the missing calibration. The rgb thing is maybe a different version of cv_bridge. I am using ROS electric and you? A workaround may be to additionally record "/camera/rgb/points" and set that topic as the topic_points param.

Felix Endres gravatar image Felix Endres  ( 2012-03-27 10:57:33 -0500 )edit

I'm using openni_launch, since, as I noted in Edit 2, openni_camera was not providing registered depth images. I'm also using ROS Electric. I'm not using /camera/rgb/points because I want to keep the bag filesize as low as possible.

Yo gravatar image Yo  ( 2012-04-04 06:21:52 -0500 )edit

Well, interesting. I haven't got that problem with openni_camera. So openni_launch gives you bgr8 with the rgb8 encoding specified? If you don't care about the image colors in the UI, you could also just switch the channels in misc.cpp line 481-483 and skip the conversion in Edit 3

Felix Endres gravatar image Felix Endres  ( 2012-04-07 11:33:24 -0500 )edit

Hi @Yo, I encounter the same problem as discribed in your Edit 2. I run kinect XBOX on ROS hydro, and it works well for unregistered image. But there is no output of registered RGBD image. The detailed information is listed here Could you please tell me how to fix it?

pinocchio gravatar image pinocchio  ( 2014-03-26 14:26:38 -0500 )edit

answered 2012-03-22 06:18:34 -0500

Mac gravatar image
edit flag offensive delete link more


I DID search and I found that earlier, however RGBDSLAM didn't seem happy with only those topics. You also said there that you're using openni_camera_unstable, whereas I'm not. Maybe I just need to know how to setup the launch file-- I don't know. I just figured I'd get it all answered in one go.

Yo gravatar image Yo  ( 2012-03-22 07:15:21 -0500 )edit

The openni_camera_unstable reference is because that question is fairly old; the electric release promoted those tools to primacy. Can you explain in more detail what's not working given those topics?

Mac gravatar image Mac  ( 2012-03-22 07:25:52 -0500 )edit

Sure, see the edit of the question. :)

Yo gravatar image Yo  ( 2012-03-23 03:20:35 -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: 2012-03-22 05:57:31 -0500

Seen: 2,692 times

Last updated: Mar 27 '12