observation.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, 2013, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  *
29  * Authors: Conor McGann
30  */
31 
32 #ifndef COSTMAP_2D_OBSERVATION_H_
33 #define COSTMAP_2D_OBSERVATION_H_
34 
35 #include <geometry_msgs/Point.h>
36 #include <pcl/point_types.h>
37 #include <pcl/point_cloud.h>
38 
39 namespace costmap_2d
40 {
41 
48 {
49 public:
54  cloud_(new pcl::PointCloud<pcl::PointXYZ>()), obstacle_range_(0.0), raytrace_range_(0.0)
55  {
56  }
57 
58  virtual ~Observation()
59  {
60  delete cloud_;
61  }
62 
70  Observation(geometry_msgs::Point& origin, pcl::PointCloud<pcl::PointXYZ> cloud,
71  double obstacle_range, double raytrace_range) :
72  origin_(origin), cloud_(new pcl::PointCloud<pcl::PointXYZ>(cloud)),
73  obstacle_range_(obstacle_range), raytrace_range_(raytrace_range)
74  {
75  }
76 
81  Observation(const Observation& obs) :
82  origin_(obs.origin_), cloud_(new pcl::PointCloud<pcl::PointXYZ>(*(obs.cloud_))),
84  {
85  }
86 
92  Observation(pcl::PointCloud<pcl::PointXYZ> cloud, double obstacle_range) :
93  cloud_(new pcl::PointCloud<pcl::PointXYZ>(cloud)), obstacle_range_(obstacle_range), raytrace_range_(0.0)
94  {
95  }
96 
97  geometry_msgs::Point origin_;
98  pcl::PointCloud<pcl::PointXYZ>* cloud_;
100 };
101 
102 } // namespace costmap_2d
103 #endif // COSTMAP_2D_OBSERVATION_H_
geometry_msgs::Point origin_
Definition: observation.h:97
Observation()
Creates an empty observation.
Definition: observation.h:53
pcl::PointCloud< pcl::PointXYZ > * cloud_
Definition: observation.h:98
Stores an observation in terms of a point cloud and the origin of the source.
Definition: observation.h:47
sensor_msgs::PointCloud2 PointCloud
Observation(const Observation &obs)
Copy constructor.
Definition: observation.h:81
Observation(geometry_msgs::Point &origin, pcl::PointCloud< pcl::PointXYZ > cloud, double obstacle_range, double raytrace_range)
Creates an observation from an origin point and a point cloud.
Definition: observation.h:70
Observation(pcl::PointCloud< pcl::PointXYZ > cloud, double obstacle_range)
Creates an observation from a point cloud.
Definition: observation.h:92


costmap_2d
Author(s): Eitan Marder-Eppstein, David V. Lu!!, Dave Hershberger, contradict@gmail.com
autogenerated on Thu Jan 21 2021 04:05:42