18#define DEFAULT_THREAD_PERIOD 0.01
21#define M_PI 3.14159265358979323846
28#define CHECK_POINTER(xxx) {if (xxx==nullptr) {yCError(MAP2D_RPC, "Invalid interface"); return false;}}
32 std::lock_guard <std::mutex> lg(m_mutex);
34 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
38 yCError(MAP2D_RPC,
"Unable to clearAllMaps");
46 std::lock_guard <std::mutex> lg(m_mutex);
48 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
52 yCError(MAP2D_RPC,
"Unable to store_map");
60 std::lock_guard <std::mutex> lg(m_mutex);
63 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return ret; }}
65 if (!m_iMap->
get_map(map_name,map))
67 yCError(MAP2D_RPC,
"Unable to getEstimatedPoses");
80 std::lock_guard <std::mutex> lg(m_mutex);
83 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return ret; }}
84 std::vector<string> map_names;
87 yCError(MAP2D_RPC,
"Unable to getEstimatedPoses");
93 ret.map_names = map_names;
100 std::lock_guard <std::mutex> lg(m_mutex);
102 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
106 yCError(MAP2D_RPC,
"Unable to remove_map");
114 std::lock_guard <std::mutex> lg(m_mutex);
116 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
120 yCError(MAP2D_RPC,
"Unable to storeLocation");
128 std::lock_guard <std::mutex> lg(m_mutex);
130 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
134 yCError(MAP2D_RPC,
"Unable to storeArea");
142 std::lock_guard <std::mutex> lg(m_mutex);
144 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
148 yCError(MAP2D_RPC,
"Unable to storePath");
156 std::lock_guard <std::mutex> lg(m_mutex);
158 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
162 yCError(MAP2D_RPC,
"Unable to renameLocation");
170 std::lock_guard <std::mutex> lg(m_mutex);
172 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
176 yCError(MAP2D_RPC,
"Unable to deleteLocation");
184 std::lock_guard <std::mutex> lg(m_mutex);
186 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
190 yCError(MAP2D_RPC,
"Unable to deletePath");
198 std::lock_guard <std::mutex> lg(m_mutex);
200 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
202 if (!m_iMap->
renameArea(original_name, new_name))
204 yCError(MAP2D_RPC,
"Unable to renameArea");
212 std::lock_guard <std::mutex> lg(m_mutex);
214 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
216 if (!m_iMap->
renamePath(original_name, new_name))
218 yCError(MAP2D_RPC,
"Unable to renamePath");
226 std::lock_guard <std::mutex> lg(m_mutex);
228 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
232 yCError(MAP2D_RPC,
"Unable to deleteArea");
240 std::lock_guard <std::mutex> lg(m_mutex);
242 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
246 yCError(MAP2D_RPC,
"Unable to clearAllLocations");
254 std::lock_guard <std::mutex> lg(m_mutex);
256 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
260 yCError(MAP2D_RPC,
"Unable to storePath");
268 std::lock_guard <std::mutex> lg(m_mutex);
270 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
274 yCError(MAP2D_RPC,
"Unable to clearAllPaths");
282 std::lock_guard <std::mutex> lg(m_mutex);
284 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
288 yCError(MAP2D_RPC,
"Unable to clearAllMapsTemporaryFlags");
296 std::lock_guard <std::mutex> lg(m_mutex);
298 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
302 yCError(MAP2D_RPC,
"Unable to clearMapTemporaryFlags");
310 std::lock_guard <std::mutex> lg(m_mutex);
312 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
316 yCError(MAP2D_RPC,
"Unable to saveMapsCollection");
324 std::lock_guard <std::mutex> lg(m_mutex);
326 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
330 yCError(MAP2D_RPC,
"Unable to loadMapsCollection");
338 std::lock_guard <std::mutex> lg(m_mutex);
340 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
344 yCError(MAP2D_RPC,
"Unable to saveLocationsAndExtras");
352 std::lock_guard <std::mutex> lg(m_mutex);
354 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return false; }}
358 yCError(MAP2D_RPC,
"Unable to loadLocationsAndExtras");
366 std::lock_guard <std::mutex> lg(m_mutex);
369 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return ret; }}
373 yCError(MAP2D_RPC,
"Unable to getLocation");
386 std::lock_guard <std::mutex> lg(m_mutex);
389 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return ret; }}
391 if (!m_iMap->
getArea(area_name,area))
393 yCError(MAP2D_RPC,
"Unable to getArea");
406 std::lock_guard <std::mutex> lg(m_mutex);
409 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return ret; }}
411 if (!m_iMap->
getPath(path_name, path))
413 yCError(MAP2D_RPC,
"Unable to getPath");
426 std::lock_guard <std::mutex> lg(m_mutex);
429 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return ret; }}
430 std::vector<string> loc_names;
433 yCError(MAP2D_RPC,
"Unable to getLocationsList");
439 ret.locations = loc_names;
446 std::lock_guard <std::mutex> lg(m_mutex);
449 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return ret; }}
450 std::vector<string> area_names;
453 yCError(MAP2D_RPC,
"Unable to getAreasList");
459 ret.areas = area_names;
466 std::lock_guard <std::mutex> lg(m_mutex);
469 {
if (m_iMap ==
nullptr) {
yCError(MAP2D_RPC,
"Invalid interface");
return ret; }}
470 std::vector<string> path_names;
473 yCError(MAP2D_RPC,
"Unable to getPathsList");
479 ret.paths = path_names;
return_get_map_names get_map_names_RPC() override
bool remove_map_RPC(const std::string &map_name) override
return_get_path get_path_RPC(const std::string &path_name) override
bool delete_area_RPC(const std::string &area_name) override
bool save_locations_and_extras_RPC(const std::string &locations_collection_file) override
bool clear_all_locations_RPC() override
bool clear_all_areas_RPC() override
bool store_area_RPC(const std::string &area_name, const yarp::dev::Nav2D::Map2DArea &area) override
bool clear_all_maps_RPC() override
bool rename_location_RPC(const std::string &original_name, const std::string &new_name) override
bool clear_all_maps_temporary_flags_RPC() override
bool clear_all_paths_RPC() override
bool load_locations_and_extras_RPC(const std::string &locations_collection_file) override
return_get_location get_location_RPC(const std::string &location_name) override
bool rename_path_RPC(const std::string &original_name, const std::string &new_name) override
return_get_areas_list get_areas_list_RPC() override
bool save_maps_collection_RPC(const std::string &maps_collection_file) override
bool rename_area_RPC(const std::string &original_name, const std::string &new_name) override
bool store_map_RPC(const yarp::dev::Nav2D::MapGrid2D &themap) override
bool clear_map_temporary_flags_RPC(const std::string &map_name) override
bool store_path_RPC(const std::string &path_name, const yarp::dev::Nav2D::Map2DPath &path) override
return_get_paths_list get_paths_list_RPC() override
return_get_locations_list get_locations_list_RPC() override
return_get_area get_area_RPC(const std::string &area_name) override
bool delete_path_RPC(const std::string &path_name) override
return_get_map get_map_RPC(const std::string &map_name) override
bool store_location_RPC(const std::string &location_name, const yarp::dev::Nav2D::Map2DLocation &loc) override
bool delete_location_RPC(const std::string &location_name) override
bool load_maps_collection_RPC(const std::string &maps_collection_file) override
virtual bool deleteLocation(std::string location_name)=0
Delete a location.
virtual bool deletePath(std::string path_name)=0
Delete a path.
virtual bool get_map(std::string map_name, yarp::dev::Nav2D::MapGrid2D &map)=0
Gets a map from the map server.
virtual bool deleteArea(std::string area_name)=0
Delete an area.
virtual bool storeArea(std::string area_name, yarp::dev::Nav2D::Map2DArea area)=0
Store an area.
virtual bool remove_map(std::string map_name)=0
Removes a map from the map server.
virtual bool storePath(std::string path_name, yarp::dev::Nav2D::Map2DPath path)=0
Store a path.
virtual bool clearAllPaths()=0
Delete all stored paths.
virtual bool clearAllAreas()=0
Delete all stored areas.
virtual bool storeLocation(std::string location_name, yarp::dev::Nav2D::Map2DLocation loc)=0
Store a location specified by the user in the world reference frame.
virtual bool getLocation(std::string location_name, yarp::dev::Nav2D::Map2DLocation &loc)=0
Retrieves a location specified by the user in the world reference frame.
virtual bool store_map(const yarp::dev::Nav2D::MapGrid2D &map)=0
Stores a map into the map server.
virtual bool clearAllLocations()=0
Delete all stored locations.
virtual bool clearAllMapsTemporaryFlags()=0
Clear all temporary flags from all stored maps.
virtual bool get_map_names(std::vector< std::string > &map_names)=0
Gets a list containing the names of all registered maps.
virtual bool renameArea(std::string original_name, std::string new_name)=0
Searches for an area and renames it.
virtual bool getPathsList(std::vector< std::string > &paths)=0
Get a list of the names of all stored paths.
virtual bool clearAllMaps()=0
Removes all the registered maps from the server.
virtual bool clearMapTemporaryFlags(std::string map_name)=0
Clear all temporary flags from a specific map.
virtual bool renamePath(std::string original_name, std::string new_name)=0
Searches for a path and renames it.
virtual bool saveMapsCollection(std::string file_name)=0
Save a collection of maps to disk.
virtual bool loadLocationsAndExtras(std::string file_name)=0
Load a collection of locations/areas/paths etc from disk.
virtual bool getArea(std::string area_name, yarp::dev::Nav2D::Map2DArea &area)=0
Retrieves an area.
virtual bool loadMapsCollection(std::string file_name)=0
Load a collection of maps from disk.
virtual bool getPath(std::string path_name, yarp::dev::Nav2D::Map2DPath &path)=0
Retrieves a path.
virtual bool renameLocation(std::string original_name, std::string new_name)=0
Searches for a location and renames it.
virtual bool getLocationsList(std::vector< std::string > &locations)=0
Get a list of the names of all stored locations.
virtual bool getAreasList(std::vector< std::string > &areas)=0
Get a list of the names of all stored areas.
virtual bool saveLocationsAndExtras(std::string file_name)=0
Save a collection of locations/area/paths etc to disk.
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.