polygon_primitive.cpp
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 ***************************************************************************************************/
36 #ifndef _polygon_primitive_CPP_
37 #define _polygon_primitive_CPP_
38 
39 
40 #include "polygon_primitive.h"
41 
51 c_polygon_primitive::c_polygon_primitive(ros::NodeHandle *node, const char* name, unsigned char r, unsigned char g, unsigned char b)
52 {
53 
54  rosnode = node;
55  grow_number = 0;
57  set_names(name);
58 
59  //Set the name of the local reference system
60  std::string tmp_str(data.misc.name);
61  std::string tmp_str1("/");
62  data.frames.local_name = tmp_str1 + tmp_str;
63 
64  data.misc.color.r = r;
65  data.misc.color.g = g;
66  data.misc.color.b = b;
67 
68  //set default values for area and solidity
69  data.hulls.convex.area = NAN;
70  data.hulls.convex.solidity = NAN;
71  data.hulls.concave.area = NAN;
72  data.hulls.concave.solidity = NAN;
73 
74  //ROS_INFO("Starting a new polygon class named %s",data.misc.name);
75 };
76 
81 {
82  //reset all shared ptr to free
83  pointclouds.all.reset();
84  pointclouds.projected.reset();
85  pointclouds.additional.reset();
86  data.hulls.convex.polygon.reset();
87  data.hulls.convex.extended_polygon.reset();
88  data.hulls.concave.polygon.reset();
89  data.hulls.concave.extended_polygon.reset();
90  pointclouds.growed.reset();
91  pointclouds.tmp.reset();
92  data.planes.current.reset();;
93  data.planes.previous.reset();;
94 };
95 
96 
97 #endif
98 
struct t_polygon_primitive_data::@3::@8 concave
data from the polygon concave hull
pcl::ModelCoefficients::Ptr current
ros::NodeHandle * rosnode
void set_names(const char *s)
Sets the polygon name.
struct c_polygon_primitive::@9 pointclouds
A structure containing all the point clouds needed to represent the polygon primitive.
pcl::ModelCoefficients::Ptr previous
current supporting plane coefficients
struct t_polygon_primitive_data::@5 frames
the axis frames
struct t_polygon_primitive_data::@3::@7 convex
data from the polygon convex hull
struct t_polygon_primitive_data::@2 misc
t_polygon_primitive_data data
struct t_polygon_primitive_data::@3 hulls
Information about the several hulls used.
~c_polygon_primitive()
Destructor. Frees the space of objects.
A class c_polygon_primitive that contains information about a detected polygon primitive as well as t...
struct t_polygon_primitive_data::@4 planes
The supporting plane coefficients.
unsigned char b[16]
unsigned char g[16]
c_polygon_primitive(ros::NodeHandle *node, const char *name="unamed", unsigned char r=0, unsigned char g=0, unsigned char b=0)
Constructor. Allocates space for the required objecs.
struct t_polygon_primitive_data::@2::@6 color
the color of the polygon


polygon_primitives_extraction
Author(s): Miguel Oliveira
autogenerated on Mon Mar 2 2015 01:32:42