void DynamicVoronoi::exchangeObstacles(std::vector<INTPOINT> &points) {
    for (unsigned int i=0; i<lastObstacles.size(); i++) {
        int x = lastObstacles[i].x;
        int y = lastObstacles[i].y;

        bool v = gridMap[x][y];
        if (v) continue;
        removeObstacle(x,y);
    }

    lastObstacles.clear();

    for (unsigned int i=0; i<points.size(); i++) {
        int x = points[i].x;
        int y = points[i].y;
        bool v = gridMap[x][y];
        if (v) continue;
        setObstacle(x,y);
        lastObstacles.push_back(points[i]);
    }
}
示例#2
0
void DynamicEDTOctomap::updateMaxDepthLeaf(octomap::OcTreeKey& key, bool occupied){
	if(occupied)
		setObstacle(key[0]+offsetX, key[1]+offsetY, key[2]+offsetZ);
	else
		removeObstacle(key[0]+offsetX, key[1]+offsetY, key[2]+offsetZ);
}
示例#3
0
void DynamicEDT3D::clearCell(int x, int y, int z) {
	gridMap[x][y][z] = 0;
	removeObstacle(x,y,z);
}
void DynamicVoronoi::clearCell(int x, int y) {
    gridMap[x][y] = 0;
    removeObstacle(x,y);
}