filtering.h
Go to the documentation of this file.
1 /**************************************************************************************************
2  Software License Agreement (BSD License)
3 
4  Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt
5  All rights reserved.
6 
7  Redistribution and use in source and binary forms, with or without modification, are permitted
8  provided that the following conditions are met:
9 
10  *Redistributions of source code must retain the above copyright notice, this list of
11  conditions and the following disclaimer.
12  *Redistributions in binary form must reproduce the above copyright notice, this list of
13  conditions and the following disclaimer in the documentation and/or other materials provided
14  with the distribution.
15  *Neither the name of the University of Aveiro nor the names of its contributors may be used to
16  endorse or promote products derived from this software without specific prior written permission.
17 
18  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 ***************************************************************************************************/
32 #ifndef _FILTERING_H_
33 #define _FILTERING_H_
34 
35 // ROS includes.
36 #include <ros/ros.h>
37 #include <sensor_msgs/PointCloud2.h>
38 #include <tf/transform_listener.h>
39 #include <pcl_ros/transforms.h>
40 
41 // PCL includes
42 #include <pcl/point_types.h>
43 #include <pcl/conversions.h>
44 #include <pcl/filters/voxel_grid.h>
45 
46 // LAR includes
47 #include <points_from_volume/points_from_volume.h>
48 
49 #ifndef PFLN
50  #define PFLN printf("LINE= %d in FILE=%s \n", __LINE__, __FILE__);
51 #endif
52 
53 using namespace std;
54 using namespace pcl;
55 
56 
60 template<class T>
61 class filtering
62 {
63 public:
64 
67  {
68  };
69 
72  {
73  };
74 
75  // VARIABLES
76 
78  PointCloud<T> pc_in;
79 
81  PointCloud<T> pc_out;
82 
84  PointCloud<T> convex_hull;
85 
87  double voxel_size;
88 
90  double max_z;
91 
93  double min_z;
94 
96  ros::Publisher *pub_ptr;
97 
99  tf::TransformListener *transform_listener_ptr;
100 
102  string frame_id;
103 
104  // FUNCTIONS
105 
107  void filter(const sensor_msgs::PointCloud2Ptr& msg);
108 
116  sensor_msgs::PointCloud2 voxel_filter(const sensor_msgs::PointCloud2Ptr& msg_in, double voxel_size);
117 
118 };
119 
120 #include "filtering.hpp"
121 
122 #endif
filtering()
Class constructor.
Definition: filtering.h:66
double min_z
Minimum value for Z pointcloud.
Definition: filtering.h:93
~filtering()
Class destructor.
Definition: filtering.h:71
double max_z
Maximum value for Z pointcloud.
Definition: filtering.h:90
PointCloud< T > pc_out
Point cloud filtered.
Definition: filtering.h:81
string frame_id
The frame_id to transform.
Definition: filtering.h:102
tf::TransformListener * transform_listener_ptr
Pointer to a transform listener.
Definition: filtering.h:99
filtering class declaration
ros::Publisher * pub_ptr
Pointer to pointcloud publisher.
Definition: filtering.h:96
double voxel_size
Voxel grid size.
Definition: filtering.h:87
PointCloud< T > convex_hull
The convex hull for cloud extraction.
Definition: filtering.h:84


pointcloud_segmentation
Author(s): Tiago Talhada
autogenerated on Mon Mar 2 2015 01:32:39