MapNode.h
Go to the documentation of this file.
1 /*
2  * OctoMap - An Efficient Probabilistic 3D Mapping Framework Based on Octrees
3  * https://octomap.github.io/
4  *
5  * Copyright (c) 2009-2013, K.M. Wurm and A. Hornung, University of Freiburg
6  * All rights reserved.
7  * License: New BSD
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the distribution.
17  * * Neither the name of the University of Freiburg nor the names of its
18  * contributors may be used to endorse or promote products derived from
19  * this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef OCTOMAP_MAP_NODE_H
35 #define OCTOMAP_MAP_NODE_H
36 
37 
38 #include <string>
39 #include <octomap/OcTree.h>
40 
41 namespace octomap {
42 
43  template <class TREETYPE>
44  class MapNode {
45 
46  public:
47  MapNode();
48  MapNode(TREETYPE* node_map, pose6d origin);
49  MapNode(std::string filename, pose6d origin);
50  MapNode(const Pointcloud& cloud, pose6d origin);
51  ~MapNode();
52 
53  typedef TREETYPE TreeType;
54 
55  TREETYPE* getMap() { return node_map; }
56 
57  void updateMap(const Pointcloud& cloud, point3d sensor_origin);
58 
59  inline std::string getId() { return id; }
60  inline void setId(std::string newid) { id = newid; }
61 
62  inline pose6d getOrigin() { return origin; }
63 
64  // returns cloud of voxel centers in global reference frame
66  bool writeMap(std::string filename);
67 
68  protected:
69  TREETYPE* node_map; // occupancy grid map
70  pose6d origin; // origin and orientation relative to parent
71  std::string id;
72 
73  void clear();
74  bool readMap(std::string filename);
75 
76  };
77 
78 } // end namespace
79 
80 #include "octomap/MapNode.hxx"
81 
82 #endif
octomap::MapNode::updateMap
void updateMap(const Pointcloud &cloud, point3d sensor_origin)
octomap::Pointcloud
Definition: Pointcloud.h:47
octomap::MapNode::setId
void setId(std::string newid)
Definition: MapNode.h:60
octomap::MapNode::node_map
TREETYPE * node_map
Definition: MapNode.h:69
octomap::MapNode::writeMap
bool writeMap(std::string filename)
octomap::MapNode::origin
pose6d origin
Definition: MapNode.h:70
octomath::Vector3
This class represents a three-dimensional vector.
Definition: Vector3.h:50
octomap::MapNode::getOrigin
pose6d getOrigin()
Definition: MapNode.h:62
octomap::MapNode::readMap
bool readMap(std::string filename)
octomap::MapNode::MapNode
MapNode()
octomap::MapNode::~MapNode
~MapNode()
octomap::MapNode::TreeType
TREETYPE TreeType
Definition: MapNode.h:53
octomap::MapNode::getMap
TREETYPE * getMap()
Definition: MapNode.h:55
octomap::MapNode
Definition: MapNode.h:44
octomap
octomap::MapNode::id
std::string id
Definition: MapNode.h:71
octomath::Pose6D
This class represents a tree-dimensional pose of an object.
Definition: Pose6D.h:49
octomap::MapNode::getId
std::string getId()
Definition: MapNode.h:59
OcTree.h
octomap::MapNode::generatePointcloud
Pointcloud generatePointcloud()
octomap::MapNode::clear
void clear()


octomap
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Tue Dec 12 2023 03:39:40