wavefront_map_accessor.h
Go to the documentation of this file.
1 /*
2  * wavefront_map_accessor.h
3  *
4  * Created on: May 2, 2012
5  * Author: tkruse
6  */
7 
8 #ifndef WAVEFRONT_MAP_ACCESSOR_H_
9 #define WAVEFRONT_MAP_ACCESSOR_H_
10 #include <costmap_2d/cost_values.h>
11 namespace base_local_planner {
12 
18  public:
19  WavefrontMapAccessor(MapGrid* map, double outer_radius)
20  : costmap_2d::Costmap2D(map->size_x_, map->size_y_, 1, 0, 0),
21  map_(map), outer_radius_(outer_radius) {
22  synchronize();
23  }
24 
25  virtual ~WavefrontMapAccessor(){};
26 
27  void synchronize(){
28  // Write Cost Data from the map
29  for(unsigned int x = 0; x < size_x_; x++){
30  for (unsigned int y = 0; y < size_y_; y++){
31  unsigned int ind = x + (y * size_x_);
32  if(map_->operator ()(x, y).target_dist == 1) {
34  } else {
35  costmap_[ind] = 0;
36  }
37  }
38  }
39  }
40 
41  private:
43  double outer_radius_;
44 };
45 
46 }
47 
48 
49 
50 #endif /* WAVEFRONT_MAP_ACCESSOR_H_ */
unsigned int size_y_
unsigned int size_x_
TFSIMD_FORCE_INLINE const tfScalar & y() const
A grid of MapCell cells that is used to propagate path and goal distances for the trajectory controll...
Definition: map_grid.h:52
WavefrontMapAccessor(MapGrid *map, double outer_radius)
TFSIMD_FORCE_INLINE const tfScalar & x() const
static const unsigned char LETHAL_OBSTACLE
unsigned char * costmap_


base_local_planner
Author(s): Eitan Marder-Eppstein, Eric Perko, contradict@gmail.com
autogenerated on Thu Jan 21 2021 04:05:49