Point Cloud Library (PCL)  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
common.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2010, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage, Inc. nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  * $Id: common.h 5026 2012-03-12 02:51:44Z rusu $
35  *
36  */
37 
38 #ifndef PCL_COMMON_H_
39 #define PCL_COMMON_H_
40 
41 #include <pcl/pcl_base.h>
42 #include <cfloat>
43 
51 namespace pcl
52 {
59  inline double
60  getAngle3D (const Eigen::Vector4f &v1, const Eigen::Vector4f &v2);
61 
68  inline void
69  getMeanStd (const std::vector<float> &values, double &mean, double &stddev);
70 
78  template <typename PointT> inline void
79  getPointsInBox (const pcl::PointCloud<PointT> &cloud, Eigen::Vector4f &min_pt,
80  Eigen::Vector4f &max_pt, std::vector<int> &indices);
81 
88  template<typename PointT> inline void
89  getMaxDistance (const pcl::PointCloud<PointT> &cloud, const Eigen::Vector4f &pivot_pt, Eigen::Vector4f &max_pt);
90 
98  template<typename PointT> inline void
99  getMaxDistance (const pcl::PointCloud<PointT> &cloud, const std::vector<int> &indices,
100  const Eigen::Vector4f &pivot_pt, Eigen::Vector4f &max_pt);
101 
108  template <typename PointT> inline void
109  getMinMax3D (const pcl::PointCloud<PointT> &cloud, PointT &min_pt, PointT &max_pt);
110 
117  template <typename PointT> inline void
118  getMinMax3D (const pcl::PointCloud<PointT> &cloud,
119  Eigen::Vector4f &min_pt, Eigen::Vector4f &max_pt);
120 
128  template <typename PointT> inline void
129  getMinMax3D (const pcl::PointCloud<PointT> &cloud, const std::vector<int> &indices,
130  Eigen::Vector4f &min_pt, Eigen::Vector4f &max_pt);
131 
139  template <typename PointT> inline void
140  getMinMax3D (const pcl::PointCloud<PointT> &cloud, const pcl::PointIndices &indices,
141  Eigen::Vector4f &min_pt, Eigen::Vector4f &max_pt);
142 
150  template <typename PointT> inline double
151  getCircumcircleRadius (const PointT &pa, const PointT &pb, const PointT &pc);
152 
160  template <typename PointT> inline void
161  getMinMax (const PointT &histogram, int len, float &min_p, float &max_p);
162 
171  PCL_EXPORTS void
172  getMinMax (const sensor_msgs::PointCloud2 &cloud, int idx, const std::string &field_name,
173  float &min_p, float &max_p);
174 
181  PCL_EXPORTS void
182  getMeanStdDev (const std::vector<float> &values, double &mean, double &stddev);
183 
184 }
187 
188 #endif //#ifndef PCL_COMMON_H_