object_support_segmentation.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2014, Unbounded Robotics Inc.
00003  * Copyright (c) 2013, Michael E. Ferguson
00004  * All Rights Reserved
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are met:
00008  *
00009  *     * Redistributions of source code must retain the above copyright
00010  *       notice, this list of conditions and the following disclaimer.
00011  *     * Redistributions in binary form must reproduce the above copyright
00012  *       notice, this list of conditions and the following disclaimer in the
00013  *       documentation and/or other materials provided with the distribution.
00014  *     * The names of the authors may not be used to endorse or promote products
00015  *       derived from this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00019  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00020  * DISCLAIMED. IN NO EVENT SHALL AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00022  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
00023  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00024  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
00025  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00026  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  */
00028 
00029 // Author: Michael Ferguson
00030 
00031 #ifndef SIMPLE_GRASPING_OBJECT_SUPPORT_SEGMENTATION_H
00032 #define SIMPLE_GRASPING_OBJECT_SUPPORT_SEGMENTATION_H
00033 
00034 #include <vector>
00035 
00036 #include <grasping_msgs/Object.h>
00037 
00038 #include <pcl/io/io.h>
00039 #include <pcl/point_types.h>
00040 #include <pcl/segmentation/extract_clusters.h>
00041 #include <pcl/filters/extract_indices.h>
00042 #include <pcl/segmentation/sac_segmentation.h>
00043 #include <pcl/filters/voxel_grid.h>
00044 
00045 namespace simple_grasping
00046 {
00047 
00051 class ObjectSupportSegmentation
00052 {
00053 public:
00054 
00059   ObjectSupportSegmentation(ros::NodeHandle& nh);
00060 
00070   bool segment(const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr& cloud,
00071                std::vector<grasping_msgs::Object>& objects,
00072                std::vector<grasping_msgs::Object>& supports,
00073                pcl::PointCloud<pcl::PointXYZRGB>& object_cloud,
00074                pcl::PointCloud<pcl::PointXYZRGB>& support_cloud,
00075                bool output_clouds);
00076   
00077 private:
00078   pcl::VoxelGrid<pcl::PointXYZRGB> voxel_grid_;
00079   pcl::SACSegmentation<pcl::PointXYZRGB> segment_;
00080   pcl::EuclideanClusterExtraction<pcl::PointXYZRGB> extract_clusters_;
00081   pcl::ExtractIndices<pcl::PointXYZRGB> extract_indices_;
00082 };
00083 
00084 }  // namespace simple_grasping
00085 
00086 #endif  // SIMPLE_GRASPING_OBJECT_SUPPORT_SEGMENTATION_H


simple_grasping
Author(s): Michael Ferguson
autogenerated on Fri Aug 26 2016 13:17:24