Author: Job van Dieten <job.1994@gmail.com>
Maintainer: Jordi Pages <jordi.pages@pal-robotics.com>
Support: tiago-support@pal-robotics.com
Source: https://github.com/pal-robotics/tiago_tutorials.git
Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Region Based Segmentation (C++)
Description: Region based segmentation takes a point in the pointcloud and determines whether neighbouring points are part of the same regionKeywords: PointCloud
Tutorial Level: INTERMEDIATE
Contents
Purpose
This tutorial presents a C++ node that subscribes to the point cloud of the RGBD camera of TIAGo's head and applies the PCL region growing tutorial to segment the scene in different clusters.
Pre-Requisites
First, make sure that the tutorials are properly installed along with the TIAGo simulation, as shown in the Tutorials Installation Section.
Execution
Open three consoles and in each one source the workspace
cd /tiago_public_ws source ./devel/setup.bash
In the first console launch the simulation
roslaunch tiago_gazebo tiago_gazebo.launch public_sim:=true end_effector:=pal-gripper world:=objects_on_table
TIAGo will be spawn in front of a table with several objects.
In the second console load an specific file with motion definitions
rosparam load `rospack find tiago_pcl_tutorial`/config/pcl_motions.yaml
Now run a graphical action client interface for melodic:
rosrun actionlib axclient.py /play_motion
or for noetic:
rosrun actionlib_tools axclient.py /play_motion
In the GUI that shows up write the following text in the Goal text box
motion_name: 'look_down' skip_planning: True priority: 0
And press the SEND GOAL button. The robot will raise its torso and will lower the head in order to look at the table.
In the third console run the following launch command
roslaunch tiago_pcl_tutorial pcl_region.launch
Rviz will appear showing a colored point cloud where every segmented region is assigned a different color.
Tuning
A rqt_reconfigure GUI also appears and selecting the pcl_regions node a set of parameters can be tuned.
The parameters involve point cloud downsampling, in order to speed up the processing, and the region segmentation algorithm, which will have direct effect on the resulting number of regions and its morphology.