Main Page
Namespaces
Classes
Files
File List
File Members
test
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
17
class
WavefrontMapAccessor
:
public
costmap_2d::Costmap2D
{
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) {
33
costmap_
[ind] =
costmap_2d::LETHAL_OBSTACLE
;
34
}
else
{
35
costmap_
[ind] = 0;
36
}
37
}
38
}
39
}
40
41
private
:
42
MapGrid
*
map_
;
43
double
outer_radius_
;
44
};
45
46
}
47
48
49
50
#endif
/* WAVEFRONT_MAP_ACCESSOR_H_ */
costmap_2d::Costmap2D::size_y_
unsigned int size_y_
cost_values.h
costmap_2d::Costmap2D::size_x_
unsigned int size_x_
y
TFSIMD_FORCE_INLINE const tfScalar & y() const
base_local_planner
Definition:
costmap_model.h:44
base_local_planner::WavefrontMapAccessor::map_
MapGrid * map_
Definition:
wavefront_map_accessor.h:42
base_local_planner::MapGrid
A grid of MapCell cells that is used to propagate path and goal distances for the trajectory controll...
Definition:
map_grid.h:52
base_local_planner::WavefrontMapAccessor::WavefrontMapAccessor
WavefrontMapAccessor(MapGrid *map, double outer_radius)
Definition:
wavefront_map_accessor.h:19
base_local_planner::WavefrontMapAccessor::synchronize
void synchronize()
Definition:
wavefront_map_accessor.h:27
base_local_planner::WavefrontMapAccessor::outer_radius_
double outer_radius_
Definition:
wavefront_map_accessor.h:43
x
TFSIMD_FORCE_INLINE const tfScalar & x() const
costmap_2d::LETHAL_OBSTACLE
static const unsigned char LETHAL_OBSTACLE
costmap_2d::Costmap2D::Costmap2D
Costmap2D()
base_local_planner::WavefrontMapAccessor
Definition:
wavefront_map_accessor.h:17
costmap_2d::Costmap2D
costmap_2d
base_local_planner::WavefrontMapAccessor::~WavefrontMapAccessor
virtual ~WavefrontMapAccessor()
Definition:
wavefront_map_accessor.h:25
costmap_2d::Costmap2D::costmap_
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