ROS and Kinect- Ubuntu Installation

ROS- Installation

1.0 Install ROS

http://www.ros.org/wiki/electric/Installation/Ubuntu

1.1 check/add repositories https://help.ubuntu.com/community/Repositories/Ubuntu

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

1.3 Set up your keys
wget http://packages.ros.org/ros.key -O – | sudo apt-key add -

1.4 Installation

Make sure you have re-indexed the ROS.org 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

http://www.ros.org/wiki/IDEs

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

Applications>Programming>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.
http://www.ros.org/wiki/rosinstall

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

3.0 Install Kinect driver/components
link > http://www.ros.org/wiki/openni_kinect

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 https://kforge.ros.org/openni/drivers
cd drivers
make
make install

3.2.2 – Run Rosinstall:
rosinstall ~/openni_kinect /opt/ros/electric ‘http://www.ros.org/wiki/openni_kinect?action=AttachFile&do=get&target=openni_kinect.rosinstall’

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, http://book.git-scm.com/2_installing_git.html)

install java6 sdk
sudo add-apt-repository “deb http://archive.canonical.com/ maverick partner”
sudo apt-get update
sudo apt-get install sun-java6-jdk
(see here http://stackoverflow.com/questions/3747789/how-to-install-the-sun-java-jdk-on-ubuntu-10-10-maverick-meerkat)

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

Testing the Kinect

from ros-diamondback: http://www.ros.org/wiki/openni_camera (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: http://www.ros.org/wiki/openni_launch

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

NORMAL

Install binaries
http://www.pointclouds.org/downloads/linux.html
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
http://www.pointclouds.org/downloads
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 ..
make
sudo make install

EXPERIMENTAL

checkout pcl trunk
http://dev.pointclouds.org/projects/pcl/wiki
or
http://www.pointclouds.org/downloads/source.html> Experimental

svn co http://svn.pointclouds.org/pcl/trunk pcl-trunk
cd pcl-trunk && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install

Compile in Eclipse
http://www.pcl-users.org/Getting-Started-with-PCL-using-Eclipse-td3270182.html

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.