65 std::vector<signed char>::const_iterator mapDataIter = gridMap->data.begin();
68 unsigned char map_occ_thres = 70;
72 for(
unsigned int j = 0; j <
m_mapInfo.height; ++j){
73 for(
unsigned int i = 0; i <
m_mapInfo.width; ++i){
74 if (*mapDataIter > map_occ_thres){
float distanceMapAtCell(unsigned int mx, unsigned int my) const
Returns distance (in m) at map cell <mx, my> in m; -1 if out of bounds!
void setMap(const nav_msgs::OccupancyGridConstPtr &gridMap)
Initialize map from a ROS OccupancyGrid message.
bool inMapBounds(double wx, double wy) const
check if a coordinate is covered by the map extent (same as worldToMap)
void inflateMap(double inflationRaduis)
uchar binaryMapAtCell(unsigned int mx, unsigned int my) const
Returns map value at map cell <mx, my>; out of bounds will be returned as 0!
cv::Mat m_binaryMap
binary occupancy map. 255: free, 0 occupied.
std::string m_frameId
"map" frame where ROS OccupancyGrid originated from
void worldToMapNoBounds(double wx, double wy, unsigned int &mx, unsigned int &my) const
bool worldToMap(double wx, double wy, unsigned int &mx, unsigned int &my) const
uchar binaryMapAt(double wx, double wy) const
Returns map value at world coordinates <wx, wy>; out of bounds will be returned as 0! ...
float distanceMapAt(double wx, double wy) const
Returns distance (in m) at world coordinates <wx,wy> in m; -1 if out of bounds!
bool isOccupiedAt(double wx, double wy) const
const cv::Mat & binaryMap() const
void mapToWorld(unsigned int mx, unsigned int my, double &wx, double &wy) const
bool isOccupiedAtCell(unsigned int mx, unsigned int my) const
nav_msgs::MapMetaData m_mapInfo
cv::Mat m_distMap
distance map (in meter)