Wednesday, December 19, 2012

How to successfully compile rgbdslam_freiburg package under ROS

This article was posted in Dec 2012. Later versions of rgbdslam package may differ from our post. I will try to make this post up-to-date and more detailed.

We have been working on rgbdslam package for more than one week to make it compile successfully. The answers in the ROS forum is plentiful, so at the same time it is hard to find out the exact one fits your problem. That is why I am going to compose this article. Since currently I cannot contribute to ROS wiki, and it is not proper to post a tutorial on, just post a detailed procedure and the problems we encountered here, hope can be helpful for those who are working on the same thing.

Part.I Basic Settings. ROS installation

We are using Ubuntu 12.04 (Precision) and ROS fuerte, on 32 bit system.First you need to follow the instructions on If you are new to ROS, better spend at least one week time on the ROS basic things. Keeping in mind that every time downloading packages using svn, you need to enter the /ros_workspace (may differ according to your configuration, mine is /fuerte_workspace) first. Just type 'roscd' in terminal, it should bring you there.

If it brings you into the /opt/ros/fuerte/... something like that, means your ROS_PACKAGE_PATH is not set properly. It is a system environment variable, your can change it in In my case, I added

export ROS_PACKAGE_PATH=~/fuerte_workspace:$ROS_PACKAGE_PATH

to the file. If you still have problem, check .bashrc in your home folder. you can just type

gedit ~/.bashrc

and add 

source ~/fuerte_workspace/setup.bash

Appended on 15 March 2013

I should include this long time ago, about using the rosws command to perform the basic settings for packages and stacks in fuerte.

First, create the overlay and read through the rosws tutorial.

So check out the rgbdslam package using svn in the fuerte_workspace. 

svn co

Though it is possible to link the package with its source, I do not recommend you to do this. As we know ros is an actively maintained system and many packages are updating frequently. But for most of the users, we only aim for an stable version and do not want to make any change after we successfully integrate it with our own system.

Set rgbdslam_freiburg to a workspace, you should stay in your fuerte_workspace folder.

rosws set rgbdslam_freiburg 

Remember to restart your terminal or source the Try roscd rgbdslam, does it work?

Part.II Install all the dependencies

In fuerte and electric, the command to install all the dependencies are different. Though on wiki, the documentation is well distinguished, on the website, some replies may be misled. We did not use any command other than provided by the wiki.

Remember to install QT first, it deals with GUI. Install it from Ubuntu software center. Install the QT Creator.

When running

rosdep update

rosdep install rgbdslam_freiburg

it may give you some error. If you are installing QT...then wait until finished. Ubuntu can only install one software at one time. If it says missing package rgbdslam, means you did not download the software in the correct path or your ROS_PACKAGE_PATH not set..go to PART. I...

Any other dependencies missing, you need to check manifest.xml. We simply explain the meaning of the scripts.

<depend package="g2o"/>

means you need to have a ros package, namely g2o, it will compile this package when you compiles the rgbdslam.

<rosdep name="libg2o">

means you need to install a library. So rosdep install rgbdslam_freiburg will install all the libraries.

Problem for eigen, you need to change package to library. When I downloaded the source, it had changed already. See this link

A lot of rgbdslam users mentioned change g2o library to package. We explain this in detail in next part.

Part. III g2o, manifest.xml, CMakeLists.txt

Need to say that we spend several days working on these three files.. Following ROS wiki we cannot get it work.. We have read a lot of posts at first beginning, but we missed the useful info because we do not have an idea what problems we were facing.

I think currently most of the people have the same problems as us who failed to do a rosmake. It is because of g2o. If we are using <rosdep name="libg2o"> in the manifest.xml, there is an error"configuring incomplete" when rosmake rgbdslam using<depend package="g2o">, we get an error during compiling g2o package. Same error occurs if we compile g2o separately.

Three main problems we resolved to make the package work are as follows.

A. Follow, make sure that you can use roscd g2o to access the folder. Try to rosmake the package, it gives an certificate verification error...Due to the svn command. Actually the ros g2o package need to use svn to download code from openslam and compile it. Check this link

I think the author commented out the wrong line in the g2o makefile, or maybe due to different configurations.

Change the corresponding local makefile to

SVN_CMDLINE = svn --no-auth-cache --trust-server-cert --non-interactive

#SVN_CMDLINE = svn --non-interactive --config-dir $(TOP_DIR)/svnconf

rosmake the g2o package again. It should work now. Takes quite a long time cos it needs to perform the svn task...

B. Modify the manifest.xml in rgbdslam package.

Change the g2o to package setting. Means change this line

<rosdep name="libg2o"> 


<depend package="g2o"/>

Not sure what is the problem with libg2o. One guy mentioned that you'd better remove the libg2o from software center during rosmake the rgbdslam to avoid conflicts.

C.Modify the CMakeLists.txt in rgbdslam

Remove the line

find_package(g2o REQUIRED)

And compile again. Because the removed line conflicts with the package g2o.
Useful info can be found in these two posts
Seems electric and fuerte got same error..

Now it should be no problem to compile rgbdslam package. I hope this article can be useful for those who are still struggling with rgbdslam package compiling. Leave me a message if you think anything need to be improved.


  1. Does the 3D reconstruction of rgbdslam work with you? I have tried for quite some time to get it working but there seems to be issues due to changes between openni fuerte and openni electric. The rgb & depth feeds are working fine but no 3D point clouds are shown in the top black screen

    1. Hi Tarek, we are running openni.launch and rgbdslam seperately, havent tried the kinect+rgbdslam.launch yet. Just one person hold the kinect and slowly turn around like shown in this video , another person keep click the 'enter' key, it is a manually update and can generate the 3D point clouds.

  2. Just wanted to tell you THANK YOU !!! Your post should be linked here: . I don't know how much longer i would have struggled to make g2o work! Thanks!

  3. Will this work for rosgroovy? I tried the above procedure for rosgroovy, but i am getting 'undefined reference to g2o' error while doing rosmake rgbdslam_freiburg. Please give me a solution for this problem.

    1. I am sorry that I have not installed the rgbdslam on groovy. But seems you are using g2o package not libg2o, in this case, you need to include the find_package(g2o REQUIRED) in the CMakelist.txt. And make sure that you can access your g2o package using roscd g2o. If it doesn't work please post your question on

  4. successfully installed on desktop, but in hp dv 6 laptop with ubuntu 12.04.4 rosmake rgbdslam_freiburg freezes ubuntu. what to do??

    1. Most of the time it is because of the driver of the graphic card, ubuntu does not support intel very well. I checked that hp dv 6 using a hd3000 graphic card. AMD or Nvidia should be no problem. You can check my answer to a similar question and give me a thumb up at