object_support_segmentation.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014, Unbounded Robotics Inc.
3  * Copyright (c) 2013, Michael E. Ferguson
4  * All Rights Reserved
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * * The names of the authors may not be used to endorse or promote products
15  * derived from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
23  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 // Author: Michael Ferguson
30 
31 #ifndef SIMPLE_GRASPING_OBJECT_SUPPORT_SEGMENTATION_H
32 #define SIMPLE_GRASPING_OBJECT_SUPPORT_SEGMENTATION_H
33 
34 #include <vector>
35 
36 #include <grasping_msgs/Object.h>
37 
38 #include <pcl/io/io.h>
39 #include <pcl/point_types.h>
40 #include <pcl/segmentation/extract_clusters.h>
41 #include <pcl/filters/extract_indices.h>
42 #include <pcl/segmentation/sac_segmentation.h>
43 #include <pcl/filters/voxel_grid.h>
44 
45 namespace simple_grasping
46 {
47 
52 {
53 public:
54 
60 
70  bool segment(const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr& cloud,
71  std::vector<grasping_msgs::Object>& objects,
72  std::vector<grasping_msgs::Object>& supports,
73  pcl::PointCloud<pcl::PointXYZRGB>& object_cloud,
74  pcl::PointCloud<pcl::PointXYZRGB>& support_cloud,
75  bool output_clouds);
76 
77 private:
78  pcl::VoxelGrid<pcl::PointXYZRGB> voxel_grid_;
79  pcl::SACSegmentation<pcl::PointXYZRGB> segment_;
80  pcl::EuclideanClusterExtraction<pcl::PointXYZRGB> extract_clusters_;
81  pcl::ExtractIndices<pcl::PointXYZRGB> extract_indices_;
82 };
83 
84 } // namespace simple_grasping
85 
86 #endif // SIMPLE_GRASPING_OBJECT_SUPPORT_SEGMENTATION_H
ObjectSupportSegmentation(ros::NodeHandle &nh)
Constructor, loads pipeline using ROS parameters.
pcl::VoxelGrid< pcl::PointXYZRGB > voxel_grid_
Class that segments a point cloud into objects and supporting surfaces.
pcl::SACSegmentation< pcl::PointXYZRGB > segment_
pcl::EuclideanClusterExtraction< pcl::PointXYZRGB > extract_clusters_
bool segment(const pcl::PointCloud< pcl::PointXYZRGB >::ConstPtr &cloud, std::vector< grasping_msgs::Object > &objects, std::vector< grasping_msgs::Object > &supports, pcl::PointCloud< pcl::PointXYZRGB > &object_cloud, pcl::PointCloud< pcl::PointXYZRGB > &support_cloud, bool output_clouds)
Split a cloud into objects and supporting surfaces.
pcl::ExtractIndices< pcl::PointXYZRGB > extract_indices_


simple_grasping
Author(s): Michael Ferguson
autogenerated on Wed Jun 5 2019 20:04:47