40 distances_(NULL), scale_(scale), max_dist_(max_dist)
42 cell_radius_ = max_dist / scale;
43 distances_ =
new double *[cell_radius_+2];
44 for(
int i=0; i<=cell_radius_+1; i++)
46 distances_[i] =
new double[cell_radius_+2];
47 for(
int j=0; j<=cell_radius_+1; j++)
49 distances_[i][j] = sqrt(i*i + j*j);
57 for(
int i=0; i<=cell_radius_+1; i++)
58 delete[] distances_[i];
91 std::priority_queue<CellData>& Q,
93 unsigned char* marked)
98 int di = abs(i - src_i);
99 int dj = abs(j - src_j);
122 unsigned char* marked;
123 std::priority_queue<CellData> Q;
126 memset(marked, 0,
sizeof(
unsigned char) * map->
size_x*map->
size_y);
135 for(
int i=0; i<map->
size_x; i++)
138 for(
int j=0; j<map->
size_y; j++)
155 if(current_cell.
i_ > 0)
159 if(current_cell.
j_ > 0)
163 if((
int)current_cell.
i_ < map->
size_x - 1)
167 if((
int)current_cell.
j_ < map->
size_y - 1)
193 for (j = 0; j < map->
size_y; j++)
195 for (i = 0; i < map->
size_x; i++)
203 for (j = 0; j < map->
size_y; j++)
205 for (i = 0; i < map->
size_x; i++)
214 for (nj = -s; nj <= +s; nj++)
216 for (ni = -s; ni <= +s; ni++)
222 d = map->
scale * sqrt(ni * ni + nj * nj);
224 if (d < ncell->occ_dist)
#define MAP_VALID(map, i, j)
#define MAP_INDEX(map, i, j)
TFSIMD_FORCE_INLINE tfScalar distance(const Vector3 &v) const
bool operator<(const CellData &a, const CellData &b)
void map_update_cspace(map_t *map, double max_occ_dist)
void enqueue(map_t *map, int i, int j, int src_i, int src_j, std::priority_queue< CellData > &Q, CachedDistanceMap *cdm, unsigned char *marked)
CachedDistanceMap(double scale, double max_dist)
CachedDistanceMap * get_distance_map(double scale, double max_dist)