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 region

Keywords: PointCloud

Tutorial Level: INTERMEDIATE

region_segmentation_title.jpg

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.

gazebo_objects_on_table.jpg

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

axclient_look_down.jpg

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.

rviz_region_segmentation.jpg

Tuning

A rqt_reconfigure GUI also appears and selecting the pcl_regions node a set of parameters can be tuned.

rqt_reconfigure_region_segmentation.jpg

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.

rviz_region_segmentation2.jpg

Wiki: Robots/TIAGo/Tutorials/RegionSegmentation (last edited 2023-02-24 11:11:06 by thomaspeyrucain)