6 void CostmapLayer::touch(
double x,
double y,
double* min_x,
double* min_y,
double* max_x,
double* max_y)
8 *min_x = std::min(x, *min_x);
9 *min_y = std::min(y, *min_y);
10 *max_x = std::max(x, *max_x);
11 *max_y = std::max(y, *max_y);
25 bool xrange = x>start_x && x<end_x;
28 if(xrange && y>start_y && y<end_y)
68 unsigned char* master_array = master_grid.
getCharMap();
71 for (
int j = min_j; j < max_j; j++)
73 unsigned int it = j * span + min_i;
74 for (
int i = min_i; i < max_i; i++)
81 unsigned char old_cost = master_array[it];
94 unsigned char* master = master_grid.
getCharMap();
97 for (
int j = min_j; j < max_j; j++)
99 unsigned int it = span*j+min_i;
100 for (
int i = min_i; i < max_i; i++)
112 unsigned char* master = master_grid.
getCharMap();
115 for (
int j = min_j; j < max_j; j++)
117 unsigned int it = span*j+min_i;
118 for (
int i = min_i; i < max_i; i++)
131 unsigned char* master_array = master_grid.
getCharMap();
134 for (
int j = min_j; j < max_j; j++)
136 unsigned int it = j * span + min_i;
137 for (
int i = min_i; i < max_i; i++)
144 unsigned char old_cost = master_array[it];
153 master_array[it] = sum;
unsigned int getSizeInCellsX() const
Accessor for the x size of the costmap in cells.
LayeredCostmap * layered_costmap_
void resizeMap(unsigned int size_x, unsigned int size_y, double resolution, double origin_x, double origin_y)
void updateWithOverwrite(costmap_2d::Costmap2D &master_grid, int min_i, int min_j, int max_i, int max_j)
unsigned int getSizeInCellsY() const
Accessor for the y size of the costmap in cells.
unsigned int getIndex(unsigned int mx, unsigned int my) const
Given two map coordinates... compute the associated index.
double getOriginY() const
Accessor for the y origin of the costmap.
void useExtraBounds(double *min_x, double *min_y, double *max_x, double *max_y)
unsigned char * getCharMap() const
Will return a pointer to the underlying unsigned char array used as the costmap.
static const unsigned char INSCRIBED_INFLATED_OBSTACLE
void updateWithTrueOverwrite(costmap_2d::Costmap2D &master_grid, int min_i, int min_j, int max_i, int max_j)
void updateWithAddition(costmap_2d::Costmap2D &master_grid, int min_i, int min_j, int max_i, int max_j)
virtual void matchSize()
Implement this to make this layer match the size of the parent costmap.
virtual void clearArea(int start_x, int start_y, int end_x, int end_y)
double getOriginX() const
Accessor for the x origin of the costmap.
bool enabled_
Currently this var is managed by subclasses. TODO: make this managed by this class and/or container c...
static const unsigned char NO_INFORMATION
void addExtraBounds(double mx0, double my0, double mx1, double my1)
double getResolution() const
Accessor for the resolution of the costmap.
void updateWithMax(costmap_2d::Costmap2D &master_grid, int min_i, int min_j, int max_i, int max_j)
A 2D costmap provides a mapping between points in the world and their associated "costs".
void touch(double x, double y, double *min_x, double *min_y, double *max_x, double *max_y)