dynamicEDTOctomap.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright (c) 2011-2012, C. Sprunk, B. Lau, W. Burgard, University of Freiburg
11  * All rights reserved.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions are met:
15  *
16  * * Redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer.
18  * * Redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution.
21  * * Neither the name of the University of Freiburg nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
29  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35  * POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 #ifndef DYNAMICEDTOCTOMAP_H_
39 #define DYNAMICEDTOCTOMAP_H_
40 
41 #include "dynamicEDT3D.h"
42 #include <octomap/OcTree.h>
43 
46 public:
54  DynamicEDTOctomap(float maxdist, octomap::OcTree* _octree, octomap::point3d bbxMin, octomap::point3d bbxMax, bool treatUnknownAsOccupied);
55 
56  virtual ~DynamicEDTOctomap();
57 
60  virtual void update(bool updateRealDist=true);
61 
64  void getDistanceAndClosestObstacle(const octomap::point3d& p, float &distance, octomap::point3d& closestObstacle) const;
65 
67  float getDistance(const octomap::point3d& p) const;
68 
70  float getDistance(const octomap::OcTreeKey& k) const;
71 
73  int getSquaredDistanceInCells(const octomap::point3d& p) const;
74 
75  //variant of getDistanceAndClosestObstacle that ommits the check whether p is inside the area of the distance map. Use only if you are certain that p is covered by the distance map and if you need to save the time of the check.
76  void getDistanceAndClosestObstacle_unsafe(const octomap::point3d& p, float &distance, octomap::point3d& closestObstacle) const;
77 
78  //variant of getDistance that ommits the check whether p is inside the area of the distance map. Use only if you are certain that p is covered by the distance map and if you need to save the time of the check.
79  float getDistance_unsafe(const octomap::point3d& p) const;
80 
81  //variant of getDistance that ommits the check whether p is inside the area of the distance map. Use only if you are certain that p is covered by the distance map and if you need to save the time of the check.
82  float getDistance_unsafe(const octomap::OcTreeKey& k) const;
83 
84  //variant of getSquaredDistanceInCells that ommits the check whether p is inside the area of the distance map. Use only if you are certain that p is covered by the distance map and if you need to save the time of the check.
86 
88  float getMaxDist() const {
89  return maxDist*octree->getResolution();
90  }
91 
93  int getSquaredMaxDistCells() const {
94  return maxDist_squared;
95  }
96 
98  bool checkConsistency() const;
99 
101  static float distanceValue_Error;
104 
105 private:
109 
110  void worldToMap(const octomap::point3d &p, int &x, int &y, int &z) const;
111  void mapToWorld(int x, int y, int z, octomap::point3d &p) const;
112  void mapToWorld(int x, int y, int z, octomap::OcTreeKey &key) const;
113 
121 };
122 
123 #endif /* DYNAMICEDTOCTOMAP_H_ */
int getSquaredDistanceInCells(const octomap::point3d &p) const
retrieves squared distance in cells at point. Returns DynamicEDTOctomap::distanceInCellsValue_Error i...
bool checkConsistency() const
Brute force method used for debug purposes. Checks occupancy state consistency between octomap and in...
A DynamicEDTOctomap object connects a DynamicEDT3D object to an octomap.
int getSquaredMaxDistCells() const
retrieve squared maximum distance value in grid cells
float getMaxDist() const
retrieve maximum distance value
void mapToWorld(int x, int y, int z, octomap::point3d &p) const
void worldToMap(const octomap::point3d &p, int &x, int &y, int &z) const
void getDistanceAndClosestObstacle_unsafe(const octomap::point3d &p, float &distance, octomap::point3d &closestObstacle) const
DynamicEDTOctomap(float maxdist, octomap::OcTree *_octree, octomap::point3d bbxMin, octomap::point3d bbxMax, bool treatUnknownAsOccupied)
octomap::OcTreeKey boundingBoxMaxKey
float getDistance_unsafe(const octomap::point3d &p) const
octomap::OcTree * octree
int getSquaredDistanceInCells_unsafe(const octomap::point3d &p) const
static float distanceValue_Error
distance value returned when requesting distance for a cell outside the map
double maxDist
Definition: dynamicEDT3D.h:145
void getDistanceAndClosestObstacle(const octomap::point3d &p, float &distance, octomap::point3d &closestObstacle) const
A DynamicEDT3D object computes and updates a 3D distance map.
Definition: dynamicEDT3D.h:47
void insertMaxDepthLeafAtInitialize(octomap::OcTreeKey key)
float getDistance(const octomap::point3d &p) const
retrieves distance at point. Returns DynamicEDTOctomap::distanceValue_Error if point is outside the m...
virtual void update(bool updateRealDist=true)
static int distanceInCellsValue_Error
distance value returned when requesting distance in cell units for a cell outside the map ...
void initializeOcTree(octomap::point3d bbxMin, octomap::point3d bbxMax)
octomap::OcTreeKey boundingBoxMinKey
void updateMaxDepthLeaf(octomap::OcTreeKey &key, bool occupied)


dynamicEDT3D
Author(s): Christoph Sprunk
autogenerated on Mon Jun 10 2019 14:00:23