6 #ifndef YARP_DEV_MAPGRID2D_H
7 #define YARP_DEV_MAPGRID2D_H
39 MAP_CELL_KEEP_OUT = 1,
40 MAP_CELL_TEMPORARY_OBSTACLE = 2,
41 MAP_CELL_ENLARGED_OBSTACLE = 3,
51 double m_occupied_thresh;
57 bool m_compressed_data_over_network;
59 bool enable_map_compression_over_network (
bool val);
63 void enlargeCell(
XYCell cell);
74 bool loadMapYarpOnly(std::string yarp_img_filename);
75 bool loadMapROSOnly(std::string ros_yaml_filename);
76 bool loadROSParams(std::string ros_yaml_filename, std::string& pgm_occ_filename,
double& resolution,
double& orig_x,
double& orig_y,
double& orig_t);
77 bool loadMapYarpAndRos(std::string yarp_img_filename, std::string ros_yaml_filename);
89 bool isWall(
XYCell cell)
const;
96 bool isFree(
XYCell cell)
const;
103 bool isNotFree(
XYCell cell)
const;
111 bool isKeepOut(
XYCell cell)
const;
130 void clearMapTemporaryFlags();
137 bool setOccupancyData(
XYCell cell,
double occupancy);
144 bool getOccupancyData(
XYCell cell,
double& occupancy)
const;
156 bool setOrigin(
double x,
double y,
double theta);
162 void getOrigin(
double& x,
double& y,
double& theta)
const;
169 bool setResolution(
double resolution);
175 void getResolution(
double& resolution)
const;
182 bool setSize_in_meters(
double x,
double y);
189 bool setSize_in_cells(
size_t x,
size_t y);
195 void getSize_in_meters(
double& x,
double& y)
const;
201 void getSize_in_cells(
size_t&x,
size_t& y)
const;
207 size_t width()
const;
213 size_t height()
const;
220 bool setMapName(std::string map_name);
226 std::string getMapName()
const;
235 bool crop(
int left,
int top,
int right,
int bottom);
243 bool isInsideMap(
XYCell cell)
const;
250 bool isInsideMap(
XYWorld world)
const;
257 bool isIdenticalTo(
const MapGrid2D& otherMap)
const;
266 bool enlargeObstacles(
double size);
275 bool loadFromFile(std::string map_filename);
282 bool saveToFile(std::string map_filename)
const;
yarp::sig::PixelMono CellFlagData
yarp::sig::PixelMono CellOccupancyData
An interface for reading from a network connection.
An interface for writing to a network connection.
This is a base class for objects that can be both read from and be written to the YARP network.
A class for storing options and configuration information.
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
unsigned char PixelMono
Monochrome pixel type.
The main, catch-all namespace for YARP.