35 if (m_local_name ==
"")
37 yCError(MAP2DCLIENT,
"open() error you have to provide valid local name");
40 if (m_map_server ==
"")
42 yCError(MAP2DCLIENT,
"open() error you have to provide valid remote name");
46 std::string local_rpc1 = m_local_name;
47 local_rpc1 +=
"/mapClient_rpc";
49 std::string remote_rpc1 = m_map_server;
50 remote_rpc1 +=
"/rpc";
52 if (!m_rpcPort_to_Map2DServer.open(local_rpc1))
54 yCError(MAP2DCLIENT,
"open() error could not open rpc port %s, check network", local_rpc1.c_str());
59 ok=Network::connect(local_rpc1, remote_rpc1);
62 yCError(MAP2DCLIENT,
"open() error could not connect to %s", remote_rpc1.c_str());
78 if (Property::copyPortable(maptemp, mapbot) ==
false)
80 yCError(MAP2DCLIENT) <<
"store_map() failed copyPortable()";
84 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
89 yCError(MAP2DCLIENT) <<
"store_map() received error from server";
95 yCError(MAP2DCLIENT) <<
"store_map() error on writing on rpc port";
110 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
115 yCError(MAP2DCLIENT) <<
"get_map() received error from server";
121 if (Property::copyPortable(bt, map))
127 yCError(MAP2DCLIENT) <<
"get_map() failed copyPortable()";
134 yCError(MAP2DCLIENT) <<
"get_map() error on writing on rpc port";
148 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
153 yCError(MAP2DCLIENT) <<
"clear() received error from server";
159 yCError(MAP2DCLIENT) <<
"clear() error on writing on rpc port";
173 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
178 yCError(MAP2DCLIENT) <<
"get_map_names() received error from server";
183 for (
size_t i = 1; i < resp.
size(); i++)
192 yCError(MAP2DCLIENT) <<
"get_map_names() error on writing on rpc port";
207 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
212 yCError(MAP2DCLIENT) <<
"remove_map() received error from server";
218 yCError(MAP2DCLIENT) <<
"remove_map() error on writing on rpc port";
238 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
243 yCError(MAP2DCLIENT) <<
"storeLocation() received error from locations server";
249 yCError(MAP2DCLIENT) <<
"storeLocation() error on writing on rpc port";
266 if (Property::copyPortable(areatemp, areabot) ==
false)
268 yCError(MAP2DCLIENT) <<
"storeArea() failed copyPortable()";
272 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
277 yCError(MAP2DCLIENT) <<
"storeArea() received error from locations server";
283 yCError(MAP2DCLIENT) <<
"storeArea() error on writing on rpc port";
300 if (Property::copyPortable(pathtemp, areabot) ==
false)
302 yCError(MAP2DCLIENT) <<
"storePath() failed copyPortable()";
306 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
311 yCError(MAP2DCLIENT) <<
"storePath() received error from locations server";
317 yCError(MAP2DCLIENT) <<
"storePath() error on writing on rpc port";
332 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
337 yCError(MAP2DCLIENT) <<
"getLocationsList() received error from locations server";
346 for (
size_t i = 0; i < list->
size(); i++)
354 yCError(MAP2DCLIENT) <<
"getLocationsList() error while reading from locations server";
361 yCError(MAP2DCLIENT) <<
"getLocationsList() error on writing on rpc port";
376 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
381 yCError(MAP2DCLIENT) <<
"getAreasList() received error from locations server";
390 for (
size_t i = 0; i < list->
size(); i++)
398 yCError(MAP2DCLIENT) <<
"getAreasList() error while reading from locations server";
405 yCError(MAP2DCLIENT) <<
"getAreasList() error on writing on rpc port";
420 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
425 yCError(MAP2DCLIENT) <<
"getPathsList() received error from locations server";
434 for (
size_t i = 0; i < list->
size(); i++)
442 yCError(MAP2DCLIENT) <<
"getPathsList() error while reading from locations server";
449 yCError(MAP2DCLIENT) <<
"getPathsList() error on writing on rpc port";
465 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
470 yCError(MAP2DCLIENT) <<
"getLocation() received error from locations server";
483 yCError(MAP2DCLIENT) <<
"getLocation() error on writing on rpc port";
499 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
504 yCError(MAP2DCLIENT) <<
"getArea() received error from locations server";
510 if (Property::copyPortable(bt, area))
516 yCError(MAP2DCLIENT) <<
"getArea() failed copyPortable()";
523 yCError(MAP2DCLIENT) <<
"getArea() error on writing on rpc port";
539 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
544 yCError(MAP2DCLIENT) <<
"getPath() received error from locations server";
550 if (Property::copyPortable(bt, path))
556 yCError(MAP2DCLIENT) <<
"getPath() failed copyPortable()";
563 yCError(MAP2DCLIENT) <<
"getPath() error on writing on rpc port";
579 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
584 yCError(MAP2DCLIENT) <<
"deleteLocation() received error from locations server";
590 yCError(MAP2DCLIENT) <<
"deleteLocation() error on writing on rpc port";
607 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
612 yCError(MAP2DCLIENT) <<
"renameLocation() received error from locations server";
618 yCError(MAP2DCLIENT) <<
"renameLocation() error on writing on rpc port";
634 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
639 yCError(MAP2DCLIENT) <<
"deleteArea() received error from locations server";
645 yCError(MAP2DCLIENT) <<
"deleteArea() error on writing on rpc port";
661 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
666 yCError(MAP2DCLIENT) <<
"deletePath() received error from locations server";
672 yCError(MAP2DCLIENT) <<
"deletePath() error on writing on rpc port";
689 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
694 yCError(MAP2DCLIENT) <<
"renameArea() received error from locations server";
700 yCError(MAP2DCLIENT) <<
"renameArea() error on writing on rpc port";
717 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
722 yCError(MAP2DCLIENT) <<
"renamePath() received error from locations server";
728 yCError(MAP2DCLIENT) <<
"renamePath() error on writing on rpc port";
743 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
748 yCError(MAP2DCLIENT) <<
"clearAllLocations() received error from locations server";
754 yCError(MAP2DCLIENT) <<
"clearAllLocations() error on writing on rpc port";
769 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
774 yCError(MAP2DCLIENT) <<
"clearAllAreas() received error from locations server";
780 yCError(MAP2DCLIENT) <<
"clearAllAreas() error on writing on rpc port";
795 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
800 yCError(MAP2DCLIENT) <<
"clearAllMapsTemporaryFlags() received error from locations server";
806 yCError(MAP2DCLIENT) <<
"clearAllAreas() error on writing on rpc port";
822 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
827 yCError(MAP2DCLIENT) <<
"clearMapTemporaryFlags() received error from locations server";
833 yCError(MAP2DCLIENT) <<
"clearAllAreas() error on writing on rpc port";
848 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
853 yCError(MAP2DCLIENT) <<
"clearAllPaths() received error from locations server";
859 yCError(MAP2DCLIENT) <<
"clearAllPaths() error on writing on rpc port";
880 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
885 yCError(MAP2DCLIENT) <<
"saveMapsCollection() received error from locations server";
891 yCError(MAP2DCLIENT) <<
"saveMapsCollection() error on writing on rpc port";
907 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
912 yCError(MAP2DCLIENT) <<
"loadMapsCollection() received error from locations server";
918 yCError(MAP2DCLIENT) <<
"loadMapsCollection() error on writing on rpc port";
934 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
939 yCError(MAP2DCLIENT) <<
"saveLocationsAndExtras() received error from locations server";
945 yCError(MAP2DCLIENT) <<
"saveLocationsAndExtras() error on writing on rpc port";
961 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
966 yCError(MAP2DCLIENT) <<
"loadLocationsAndExtras() received error from locations server";
972 yCError(MAP2DCLIENT) <<
"loadLocationsAndExtras() error on writing on rpc port";
constexpr yarp::conf::vocab32_t VOCAB_OK
constexpr yarp::conf::vocab32_t VOCAB_NAV_DELETE_X
constexpr yarp::conf::vocab32_t VOCAB_INAVIGATION
constexpr yarp::conf::vocab32_t VOCAB_NAV_GET_LIST_X
constexpr yarp::conf::vocab32_t VOCAB_NAV_AREA
constexpr yarp::conf::vocab32_t VOCAB_NAV_STORE_X
constexpr yarp::conf::vocab32_t VOCAB_NAV_GET_X
constexpr yarp::conf::vocab32_t VOCAB_NAV_RENAME_X
constexpr yarp::conf::vocab32_t VOCAB_NAV_LOCATION
constexpr yarp::conf::vocab32_t VOCAB_NAV_TEMPORARY_FLAGS
constexpr yarp::conf::vocab32_t VOCAB_NAV_CLEARALL_X
constexpr yarp::conf::vocab32_t VOCAB_NAV_PATH
constexpr yarp::conf::vocab32_t VOCAB_IMAP_LOAD_X
constexpr yarp::conf::vocab32_t VOCAB_IMAP_OK
constexpr yarp::conf::vocab32_t VOCAB_IMAP_SAVE_X
constexpr yarp::conf::vocab32_t VOCAB_IMAP
constexpr yarp::conf::vocab32_t VOCAB_IMAP_GET_MAP
constexpr yarp::conf::vocab32_t VOCAB_IMAP_SET_MAP
constexpr yarp::conf::vocab32_t VOCAB_IMAP_LOCATIONS_COLLECTION
constexpr yarp::conf::vocab32_t VOCAB_IMAP_MAPS_COLLECTION
constexpr yarp::conf::vocab32_t VOCAB_IMAP_CLEAR_ALL_MAPS
constexpr yarp::conf::vocab32_t VOCAB_IMAP_REMOVE
constexpr yarp::conf::vocab32_t VOCAB_IMAP_GET_NAMES
bool getAreasList(std::vector< std::string > &locations) override
Get a list of all stored areas.
bool storeArea(std::string location_name, yarp::dev::Nav2D::Map2DArea area) override
Store an area.
bool loadLocationsAndExtras(std::string locations_collection_file) override
Load a collection of locations/areas/paths etc.
bool deleteArea(std::string location_name) override
Delete an area.
bool renameLocation(std::string original_name, std::string new_name) override
Searches for a location and renames it.
bool loadMapsCollection(std::string maps_collection_file) override
Load a collection of maps.
bool getPathsList(std::vector< std::string > &paths) override
Get a list of all stored paths.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool store_map(const yarp::dev::Nav2D::MapGrid2D &map) override
Stores a map into the map server.
bool saveMapsCollection(std::string maps_collection_file) override
Save a collection of maps.
bool clearAllPaths() override
Delete all stored paths.
bool renameArea(std::string original_name, std::string new_name) override
Searches for an area and renames it.
bool saveLocationsAndExtras(std::string locations_collection_file) override
Save a collection of locations/area/paths etc.
bool getLocation(std::string location_name, yarp::dev::Nav2D::Map2DLocation &loc) override
Retrieves a location specified by the user in the world reference frame.
bool renamePath(std::string original_name, std::string new_name) override
Searches for a path and renames it.
bool clearMapTemporaryFlags(std::string map_name) override
Clear all temporary flags from a specific map.
bool getLocationsList(std::vector< std::string > &locations) override
Get a list of all stored locations.
bool storePath(std::string path_name, yarp::dev::Nav2D::Map2DPath path) override
Store a path.
bool deletePath(std::string path_name) override
Delete a path.
bool getPath(std::string path_name, yarp::dev::Nav2D::Map2DPath &path) override
Retrieves a path.
bool get_map_names(std::vector< std::string > &map_names) override
Gets a list containing the names of all registered maps.
bool deleteLocation(std::string location_name) override
Delete a location.
bool remove_map(std::string map_name) override
Removes a map from the map server.
bool getArea(std::string location_name, yarp::dev::Nav2D::Map2DArea &area) override
Retrieves an area.
bool get_map(std::string map_name, yarp::dev::Nav2D::MapGrid2D &map) override
Gets a map from the map server.
bool close() override
Close the DeviceDriver.
bool clearAllMaps() override
Removes all the registered maps from the server.
bool clearAllAreas() override
Delete all stored areas.
bool clearAllLocations() override
Delete all stored locations.
bool storeLocation(std::string location_name, yarp::dev::Nav2D::Map2DLocation loc) override
Store a location specified by the user in the world reference frame.
bool clearAllMapsTemporaryFlags() override
Clear all temporary flags from all stored maps.
A simple collection of objects that can be described and transmitted in a portable way.
void addVocab32(yarp::conf::vocab32_t x)
Places a vocabulary item in the bottle, at the end of the list.
Bottle & addList()
Places an empty nested list in the bottle, at the end of the list.
size_type size() const
Gets the number of elements in the bottle.
void addFloat64(yarp::conf::float64_t x)
Places a 64-bit floating point number in the bottle, at the end of the list.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
void clear()
Empties the bottle of any objects it contains.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
A base class for nested structures that can be searched.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
A single value (typically within a Bottle).
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
virtual yarp::conf::vocab32_t asVocab32() const
Get vocabulary identifier as an integer.
virtual Bottle * asList() const
Get list value.
virtual std::string asString() const
Get string value.
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
An interface for the device drivers.
An interface to the operating system, including Port based communication.