9 #ifndef YARP_DEV_MAPGRID2D_H
10 #define YARP_DEV_MAPGRID2D_H
41 MAP_CELL_KEEP_OUT = 1,
42 MAP_CELL_TEMPORARY_OBSTACLE = 2,
43 MAP_CELL_ENLARGED_OBSTACLE = 3,
53 double m_occupied_thresh;
60 void enlargeCell(
XYCell cell);
67 bool loadMapYarpOnly(std::string yarp_img_filename);
68 bool loadMapROSOnly(std::string ros_yaml_filename);
69 bool loadROSParams(std::string ros_yaml_filename, std::string& pgm_occ_filename,
double& resolution,
double& orig_x,
double& orig_y,
double& orig_t);
70 bool loadMapYarpAndRos(std::string yarp_img_filename, std::string ros_yaml_filename);
82 bool isWall(
XYCell cell)
const;
88 bool isFree(
XYCell cell)
const;
94 bool isNotFree(
XYCell cell)
const;
101 bool isKeepOut(
XYCell cell)
const;
119 bool setOccupancyData(
XYCell cell,
double occupancy);
125 bool getOccupancyData(
XYCell cell,
double& occupancy)
const;
137 bool setOrigin(
double x,
double y,
double theta);
143 void getOrigin(
double& x,
double& y,
double& theta)
const;
150 bool setResolution(
double resolution);
156 void getResolution(
double& resolution)
const;
163 bool setSize_in_meters(
double x,
double y);
169 bool setSize_in_cells(
size_t x,
size_t y);
174 void getSize_in_meters(
double& x,
double& y)
const;
179 void getSize_in_cells(
size_t&x,
size_t& y)
const;
185 size_t width()
const;
191 size_t height()
const;
198 bool setMapName(std::string map_name);
204 std::string getMapName()
const;
213 bool crop(
int left,
int top,
int right,
int bottom);
221 bool isInsideMap(
XYCell cell)
const;
228 bool isInsideMap(
XYWorld world)
const;
235 bool isIdenticalTo(
const MapGrid2D& otherMap)
const;
244 bool enlargeObstacles(
double size);
253 bool loadFromFile(std::string map_filename);
260 bool saveToFile(std::string map_filename)
const;
278 #endif // YARP_DEV_MAPGRID2D_H