=======Perception Tutorial======= Tutorial describing first steps needed to start processing data from the Kinect, in the form of Point Clouds, using tools included in ROS Fuerte. ==== 1. Prerequisite ==== Follow the steps described in [[software:ros:installation|Recommended procedure for installing ROS]] and [[software:ros:getting-started|Getting Started with ROS]] If you are using a PrimeSense device (Xbox Kinect, Asus Xtion) check whether //ros-fuerte-openni-kinect// is installed. You can do this by running the following command in a terminal: dpkg -l | grep ros-fuerte-openni-kinect If not present install using: sudo apt-get install ros-fuerte-openni-kinect Check out the code presented at seminar in your ros-workspace from:\\ [[https://github.com/ai-seminar/perception-tutorials.git]] \\ Prerecorded bag file can be found in ../tutorial_pkg/data/. ==== 2. Viewing and recording data from the Kinect === == Bag files and Rviz == For a PrimeSense device: connect it to your PC and run: roslaunch openni_launch openni.launch Run rviz: rosrun rviz rviz Add a new PointCloud2 display type to rviz, and choose // /camera/depth_registered_points // in the topics field. If rviz returns errors, change //Fixed Frame// in //Global Options// from //// to one of the available ones in the dropdown list (e.g. /camera_link) Use //rosbag// to record data in a bag file, e.g.: rosbag record /camera/depth_registered/points /tf Note: /tf is needed if you want to view the recorded data using rviz. Play back a bag file using: rosbag play filename.bag --loop More detail and a more elegant way of saving data from a Kinect to bag files can be found [[http://www.ros.org/wiki/openni_launch/Tutorials/BagRecordingPlayback|here]] In order to save Point Clouds to *.pcd files run: rosrun pcl_ros pointcloud_to_pcd /input:=/camera/depth_registered/points == Image_view == View rgb image: rosrun image_view image_view image:=/camera/rgb/image_color View depth image: rosrun image_view image_view image:=/camera/depth/image == From a ROS node == To see how you subscribe to a topic from a ros node take a look at //subscriber.cpp// from the source code. ==== 3.Processing Point Clouds ==== The following are presented in //tutorial.cpp//, for more detailed description check the links attached. * reading in a pcd file[[http://pointclouds.org/documentation/tutorials/reading_pcd.php#reading-pcd|link]] * using PCLVisualizer[[http://pointclouds.org/documentation/tutorials/cloud_viewer.php#cloud-viewer|link]] * removing nans * calcultaing normals[[http://pointclouds.org/documentation/tutorials/normal_estimation.php#normal-estimation|link]] * filtering based on axes[[http://pointclouds.org/documentation/tutorials/passthrough.php#passthrough|link]] * downsampling the Point Cloud[[http://pointclouds.org/documentation/tutorials/voxel_grid.php#voxelgrid|link]] * RANSAC plane fitting, and extracting indices [[http://pointclouds.org/documentation/tutorials/planar_segmentation.php#planar-segmentation|link1]][[http://pointclouds.org/documentation/tutorials/extract_indices.php#extract-indices|link2]] For further questions contact: //**balintbe** at **tzi** dot **de**//