ROS and Kinect- Ubuntu Installation

ROS- Installation

1.0 Install ROS

1.1 check/add repositories

1.2 Setup your sources.list
For Ubuntu 10.10 (Maverick)
sudo sh -c ‘echo “deb maverick main” > /etc/apt/sources.list.d/ros-latest.list’

1.3 Set up your keys
wget -O – | sudo apt-key add -

1.4 Installation

Make sure you have re-indexed the server:
sudo apt-get update

Desktop-Full Install: (Recommended): ROS, rx, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception
sudo apt-get install ros-electric-desktop-full

1.5 Environment setup
echo “source /opt/ros/electric/setup.bash” >> ~/.bashrc
. ~/.bashrc

(change the environment of your current shell, you can type:
source /opt/ros/electric/setup.bash)

Install Eclipse

Ubuntu Software Center
search for eclipse
install Eclipse Integrated Development Enviroment
install C/C++ Eclipse Development for Eclipse

Window>Open Perspective>Other…>C/C++

Kinect Installation

2 Install Rosinstall
Rosinstall needs to be installed on your system. If its not installed, follow the installation instructions here: rosinstall.

sudo apt-get install python-setuptools
sudo easy_install -U rosinstall

3.0 Install Kinect driver/components
link >

3.1 Ubuntu installation
sudo apt-get install ros-electric-openni-kinect

3.2 Source based installation
3.2.1 – Install the Openni drivers onto your system
hg clone
cd drivers
make install

3.2.2 – Run Rosinstall:
rosinstall ~/openni_kinect /opt/ros/electric ‘’

3.2.3 – Setup your environment:
. ~/openni_kinect/setup.bash
Add the above line to your .bashrc or source the setup file each time you open a terminal.

3.2.4 – Compile everything:
rosmake openni_kinect –rosdep-install

!! when getting errors: !!

install git
sudo apt-get install git-core
(see here, yum installation not needed,

install java6 sdk
sudo add-apt-repository “deb maverick partner”
sudo apt-get update
sudo apt-get install sun-java6-jdk
(see here

open the bash shell with:
sudo gedit ~/.bashscr

Testing the Kinect

from ros-diamondback: (choose diamondback)

Plug the Kinect in

Launch the OpenNI driver: roslaunch openni_camera openni_node.launch

To view in rviz, launch rviz: rosrun rviz rviz
Set the Fixed Frame (top left of rviz window) to /openni_rgb_optical_frame.

Add a Point Cloud2 display, and set the topic to /camera/rgb/points.
Turning the background to light gray can help with viewing.

To view the color image in image_viewer: rosrun image_view image_view image:=/camera/rgb/image_color
or following to view the grayscale image: rosrun image_view image_view image:=/camera/rgb/image_mono

New in ros-electric:

Launch the OpenNI driver: roslaunch openni_launch openni.launch

To visualize in rviz: rosrun rviz rviz
Set the Fixed Frame (top left of rviz window) to /camera_depth_optical_frame.

Add a PointCloud2 display, and set the topic to /camera/depth/points. Turning the background to light gray can help with viewing. This is the unregistered point cloud in the frame of the depth (IR) camera. It is not matched with the RGB camera images.

Now let’s look at a registered point cloud, aligned with the RGB data. Open the dynamic reconfigure GUI:
rosrun dynamic_reconfigure reconfigure_gui

And select /camera/driver from the drop-down menu. Enable the depth_registration checkbox.

Now go back to rviz, and change your PointCloud2 topic to /camera/depth_registered/points. Set Color Transformer to RGB8. You should see a color, 3D point cloud of your scene.

Installing the PCL normal + trunk


Install binaries
sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-all

or compile from source
download PCL-1.3.1-Source.tar.bz2
tar xvfj PCL-1.3.1-Source.tar.bz2

cd PCL-1.3.1 && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
sudo make install


checkout pcl trunk
or> Experimental

svn co pcl-trunk
cd pcl-trunk && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
sudo make install

Compile in Eclipse

I presume you just manually added the PCL folders to the project. I recommend you use the Eclipse CDT4 Generator,
which is an option for the CMake tool. Basically, you just need to do this:
cmake -G”Eclipse CDT4 – Unix Makefiles” <path_to_CMakeLists.txt>

This will generate the .project and .cproject files Eclipse needs. Then you just go to
Eclipse and import -> Existing projects to workspace and point it to the pcl folder
where you have the .project file generated.