kinect/asus xtion with ROS fuerte in debian
- Get the openni_camera and openni_launch ros packages:
env_ros_fuerte roslocate info --distro=fuerte openni_launch | rosws merge - roslocate info --distro=fuerte openni_camera | rosws merge - rosws update env_ros_fuerte
- If the first two commands give an error you can try the following instead:
env_ros_fuerte rosws set openni_launch --hg `roslocate uri --distro=fuerte openni_launch` rosws set openni_camera --hg `roslocate uri --distro=fuerte openni_camera` rosws update env_ros_fuerte
- Install some dependencies:
sudo apt-get install libusb-1.0-0-dev freeglut3-dev openjdk-7-jdk openjdk-7-jre doxygen graphviz-dev libcppunit-dev libvtk5-dev libvtk5-qt4-dev libgtest-dev libqhull-dev
- Edit ~/local/src/ros-fuerte/image_pipeline/depth_image_proc/manifest.xml, remove pcl dependency:
<depend package="pcl"/>
- We have to fix a little bug in openni_camera:
roscd openni_camera
- Edit the file CMakeLists.txt and replace the line:
pkg_check_modules(OPENNI libopenni)
with:
pkg_check_modules(OPENNI openni-dev)
- Compile openni_camera package
rosmake openni_camera
- Compile image_view:
rosmake image_view
- Get and compile pcl for ros:
cd ~/local/src/ros-dependencies/ git clone https://github.com/ros-gbp/pcl-fuerte-release.git #git clone https://github.com/wg-debs/pcl.git cd pcl-fuerte-release git checkout debian/fuerte/pcl mkdir build cd build ccmake ../ -DCMAKE_INSTALL_PREFIX=${HOME}/local/DIR/pcl-ros
- In the configuration please activate options: USE_ROS and BUILD_visualization and set the CMAKE_INSTALL_PREFIX to /home/usuario/local/DIR/pcl-wg
- Then in file ~/local/src/ros-dependencies/pcl-fuerte-release/tracking/include/pcl/tracking/impl/kld_adaptive_particle_filter.hpp, change all ocurrences of genAliasTable with this->genAliasTable
- In file ~/local/src/ros-dependencies/pcl-fuerte-release/tracking/include/pcl/tracking/impl/particle_filter_omp.hpp, change all ocurrences of computeTransformedPointCloudWithNormal with this->computeTransformedPointCloudWithNormal, cropInputPointCloud with this->cropInputPointCloud, testChangeDetection with this->testChangeDetection and computeTransformedPointCloudWithoutNormal with this->computeTransformedPointCloudWithoutNormal
- In file ~/local/src/ros-dependencies/pcl-fuerte-release/tracking/include/pcl/tracking/impl/kld_adaptive_particle_filter_omp.hpp, change all ocurrences of computeTransformedPointCloudWithNormal with this->computeTransformedPointCloudWithNormal, testChangeDetection with this->testChangeDetection and cropInputPointCloud with this->cropInputPointCloud and computeTransformedPointCloudWithoutNormal with this->computeTransformedPointCloudWithoutNormal
make -j10 make install cd ~/local/DIR xstow pcl-ros
- Aditionally, before compiling you could edit file cmake/pcl_find_sse.cmake and disable the lines of native gcc compilation to allow for distributed compilation to work.
- Lets compile openni_launch
rosmake openni_launch
- Now lets test it!
- Run a roscore.
roscore
- In a new console run:
roslaunch openni_launch openni.launch
- In another console run 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
Result:
- To view the disparity image:
rosrun image_view disparity_view image:=/camera/depth/disparity
- To register the point cloud (rgb+depth):
rosrun dynamic_reconfigure reconfigure_gui
- Select /camera/driver and enable the depth_registration
- Change your PointCloud2 topic to /camera/depth_registered/points
- Set Color Transformer to RGB8
- To view the registered disparity image:
rosrun image_view disparity_view image:=/camera/depth_registered/disparity
- The rgb image:
rosrun image_view image_view image:=/camera/rgb/image_color
Discussion