44 :
DynamicEDT3D(((int) (maxdist/_octree->getResolution()+1)*((int) (maxdist/_octree->getResolution()+1)))), octree(_octree), unknownOccupied(treatUnknownAsOccupied)
101 int nodeDepth = it.getDepth();
105 int cubeSize = 1 << (
treeDepth - nodeDepth);
107 for(
int dx = 0; dx < cubeSize; dx++)
108 for(
int dy = 0; dy < cubeSize; dy++)
109 for(
int dz = 0; dz < cubeSize; dz++){
110 unsigned short int tmpx = key[0]+dx;
111 unsigned short int tmpy = key[1]+dy;
112 unsigned short int tmpz = key[2]+dz;
114 if(boundingBoxMinKey[0] > tmpx || boundingBoxMinKey[1] > tmpy || boundingBoxMinKey[2] > tmpz)
126 for(
int dx=0; dx<
sizeX; dx++){
127 key[0] = boundingBoxMinKey[0] + dx;
128 for(
int dy=0; dy<
sizeY; dy++){
129 key[1] = boundingBoxMinKey[1] + dy;
130 for(
int dz=0; dz<
sizeZ; dz++){
131 key[2] = boundingBoxMinKey[2] + dz;
144 bool isSurrounded =
true;
147 for(
int dx=-1; dx<=1; dx++)
148 for(
int dy=-1; dy<=1; dy++)
149 for(
int dz=-1; dz<=1; dz++){
150 if(dx==0 && dy==0 && dz==0)
154 isSurrounded =
false;
205 if(x>=0 && x<sizeX && y>=0 && y<sizeY && z>=0 && z<
sizeZ){
238 if(x>=0 && x<sizeX && y>=0 && y<sizeY && z>=0 && z<
sizeZ){
257 if(x>=0 && x<sizeX && y>=0 && y<sizeY && z>=0 && z<
sizeZ){
277 if(x>=0 && x<sizeX && y>=0 && y<sizeY && z>=0 && z<
sizeZ){
298 for(
int x=0; x<
sizeX; x++){
299 for(
int y=0; y<
sizeY; y++){
300 for(
int z=0; z<
sizeZ; z++){
307 bool treeOccupied =
false;
315 if(mapOccupied != treeOccupied){
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...
key_type coordToKey(double coordinate) const
virtual ~DynamicEDTOctomap()
void setObstacle(int x, int y, int z)
void mapToWorld(int x, int y, int z, octomap::point3d &p) const
leaf_bbx_iterator begin_leafs_bbx(const OcTreeKey &min, const OcTreeKey &max, unsigned char maxDepth=0) const
void worldToMap(const octomap::point3d &p, int &x, int &y, int &z) const
OcTreeNode * search(double x, double y, double z, unsigned int depth=0) const
unsigned int getTreeDepth() 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
int getSquaredDistanceInCells_unsafe(const octomap::point3d &p) const
static float distanceValue_Error
distance value returned when requesting distance for a cell outside the map
void initializeEmpty(int _sizeX, int _sizeY, int sizeZ, bool initGridMap=true)
Initialization with an empty map.
void getDistanceAndClosestObstacle(const octomap::point3d &p, float &distance, octomap::point3d &closestObstacle) const
A DynamicEDT3D object computes and updates a 3D distance map.
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 ...
KeyBoolMap::const_iterator changedKeysBegin() const
bool isOccupied(int x, int y, int z) const
checks whether the specficied location is occupied
double getResolution() const
virtual void update(bool updateRealDist=true)
update distance map to reflect the changes
void removeObstacle(int x, int y, int z)
void initializeOcTree(octomap::point3d bbxMin, octomap::point3d bbxMax)
void resetChangeDetection()
void enableChangeDetection(bool enable)
const leaf_bbx_iterator end_leafs_bbx() const
bool isNodeOccupied(const OcTreeNode *occupancyNode) const
octomap::OcTreeKey boundingBoxMinKey
void updateMaxDepthLeaf(octomap::OcTreeKey &key, bool occupied)
KeyBoolMap::const_iterator changedKeysEnd() const
double keyToCoord(key_type key, unsigned depth) const