Go to the documentation of this file.
34 #ifndef TUW_GRID_MAP_H
35 #define TUW_GRID_MAP_H
44 class GridMap :
public WorldScopedMaps
65 template <
typename MapMetaData,
class ARRAY>
66 void init (
const MapMetaData &metadata, ARRAY *data )
72 template <
typename MapMetaData,
class ARRAY>
73 void init ( MapMetaData &metadata, ARRAY &data )
79 template <
typename MapMetaData>
80 void init (
const MapMetaData &metadata,
const T &data,
bool copy =
false)
85 std::copy(data.begin(), data.end(),
data_.begin());
101 void circle (
const Point2D &
p,
double radius, int8_t value,
int thickness=1,
int lineType = cv::LINE_AA ) {
102 cv::circle (
data_,
w2m (
p ).
cv(),
scale_w2m(radius), cv::Scalar(value), thickness, lineType );
106 cv::Mat element = cv::getStructuringElement( cv::MORPH_ELLIPSE,
107 cv::Size( 2*erosion_size + 1, 2*erosion_size+1 ),
108 cv::Point( erosion_size, erosion_size ) );
111 cv::dilate( I, I, element);
121 T&
operator () (
const Point2D& _world_coordinates )
123 return data_ (
w2m ( _world_coordinates ).
cv() );
125 const T&
operator () (
const Point2D& _world_coordinates )
const
127 return data_ (
w2m ( _world_coordinates ).
cv() );
131 return data_ (
w2m ( _world_coordinates ).
cv() );
135 return data_ (
w2m ( _world_coordinates ).
cv() );
149 const cv::Mat_<T> &
mat()
const
183 T&
grid (
int row,
int col )
187 const T&
grid (
int row,
int col )
const
199 #endif // TUW_GRID_MAP_H
const T & getThresholdUnknown()
T & get(const Point2D &_world_coordinates)
GridMap & operator=(const GridMap &)=default
void circle(const Point2D &p, double radius, int8_t value, int thickness=1, int lineType=cv::LINE_AA)
double scale_w2m(double v) const
static const int8_t SPACE_NA
T & grid(int row, int col)
bool isFree(const Point2D &_world_coordinates) const
const T & getThresholdOccupied()
virtual ~GridMap()=default
void setThresholdUnknown(const T &threshold)
const T & getThresholdFree()
const cv::Mat_< T > & mat() const
Point2D w2m(const Point2D &src) const
static const int8_t SPACE_OCCUPIED
bool isOccupyied(const Point2D &_world_coordinates) const
static const int8_t SPACE_FREE
void setThresholdFree(const T &threshold)
void erode(double distance, const GridMap &src=GridMap())
void setThresholdOccupied(const T &threshold)
T & operator()(double x, double y)
void init()
initializes the transformation matrices
tuw_geometry
Author(s): Markus Bader
autogenerated on Sun Feb 26 2023 03:25:40