Skip to content

Pattern recognition with 3D Cameras Microsoft Kinect & ASUS Xtion PRO LIVE

Janosch Haber edited this page Feb 8, 2014 · 7 revisions

This is a tutorial on how to use the Microsoft Kinect & ASUS Xtion PRO LIVE cameras to create rgb-overlay point clouds in rviz and add the framework of a datamatrix.

First, get the OpenNI packeges by running sudo apt-get install ros-hydro-openni*

FOR KINECT:

For a basic HOWTO on OpenNI startup see http://wiki.ros.org/openni_launch/Tutorials/QuickStart :: Step 4 use rosrun rqt_reconfigure rqt_reconfigure instead.

Execute

roslaunch openni_launch openni.launch

rosrun rviz rviz

Set the Fixed Frame to /camera_link

Click Add and choose the PointCloud2 display. Set its topic to /camera/depth/points. Set ColorTransformer to AxisColor and select axis Z.

To use RGB-overlay point-cloud:

rosrun rqt_reconfigure rqt_reconfigure

type camera/driver and enable the depth_registration checkbox

:: NOTE: The ROS driver no longer publishes in the unregistered /camera/depth/ namespace, but instead in /camera/depth_registered/

Back in rviz, set PointCloud2 topic to /camera/depth_registered/ and ColorTransformer to RGB8

FOR XTION PRO LIVE

REMARK:

roslaunch openni2_launch openni2.launch

rosrun rviz rviz

Set Fixed Frame topic to camera_rgb_optical_frame, set PointCloud2 topic to /camera/depth/points and ColorTransformer to AxisColor and select axis Z

To use RGB-overlay point-cloud:

Adjust the camera configuration settings:

rosrun rqt_reconfigure rqt_reconfigure

Type camera/driver and enable the depth_registration checkbox

:: NOTE: The ROS driver no longer publishes in the unregistered /camera/depth/ namespace, but instead in /camera/depth_registered/

Back in rviz, set PointCloud2 topic to /camera/depth_registered/ and ColorTransformer to RGB8

DATAMATRIX FINDER

download http://elearning2.uniroma1.it/mod/resource/view.php?id=35518

extract into catkin_ws/src

gedit datamatrix_finder/src/datamatrix_finder.cpp

run rostopic list

check if the subscribed topic on line 165 is published by the camera. If not, change to "/camera/rgb/image_rect_color"

save

sudo apt-get install libdmtx-dev cd to catkin_ws run catkin_make run rospack profile

rosrun datamatrix_finder datamatrix_finder_node 0.133

with the size of the datamatrix in meters. An image window should open, displaying the datamatrix frame overlay over the rgb image

Back in rviz, add TF to the display. Two frames now will mark the position of the cameras and one the position of the datamatrix.

###FURTHER ISSUES: