|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
48 if (m_local_name ==
"")
50 yCError(MAP2DCLIENT,
"open() error you have to provide valid local name");
53 if (m_map_server ==
"")
55 yCError(MAP2DCLIENT,
"open() error you have to provide valid remote name");
59 std::string local_rpc1 = m_local_name;
60 local_rpc1 +=
"/mapClient_rpc";
62 std::string remote_rpc1 = m_map_server;
63 remote_rpc1 +=
"/rpc";
65 if (!m_rpcPort_to_Map2DServer.open(local_rpc1))
67 yCError(MAP2DCLIENT,
"open() error could not open rpc port %s, check network", local_rpc1.c_str());
72 ok=Network::connect(local_rpc1, remote_rpc1);
75 yCError(MAP2DCLIENT,
"open() error could not connect to %s", remote_rpc1.c_str());
91 if (Property::copyPortable(maptemp, mapbot) ==
false)
93 yCError(MAP2DCLIENT) <<
"store_map() failed copyPortable()";
97 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
102 yCError(MAP2DCLIENT) <<
"store_map() received error from server";
108 yCError(MAP2DCLIENT) <<
"store_map() error on writing on rpc port";
123 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
128 yCError(MAP2DCLIENT) <<
"get_map() received error from server";
134 if (Property::copyPortable(bt, map))
140 yCError(MAP2DCLIENT) <<
"get_map() failed copyPortable()";
147 yCError(MAP2DCLIENT) <<
"get_map() error on writing on rpc port";
161 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
166 yCError(MAP2DCLIENT) <<
"clear() received error from server";
172 yCError(MAP2DCLIENT) <<
"clear() error on writing on rpc port";
186 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
191 yCError(MAP2DCLIENT) <<
"get_map_names() received error from server";
196 for (
size_t i = 1; i < resp.
size(); i++)
205 yCError(MAP2DCLIENT) <<
"get_map_names() error on writing on rpc port";
220 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
225 yCError(MAP2DCLIENT) <<
"remove_map() received error from server";
231 yCError(MAP2DCLIENT) <<
"remove_map() error on writing on rpc port";
251 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
256 yCError(MAP2DCLIENT) <<
"storeLocation() received error from locations server";
262 yCError(MAP2DCLIENT) <<
"storeLocation() error on writing on rpc port";
279 if (Property::copyPortable(areatemp, areabot) ==
false)
281 yCError(MAP2DCLIENT) <<
"storeArea() failed copyPortable()";
285 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
290 yCError(MAP2DCLIENT) <<
"storeArea() received error from locations server";
296 yCError(MAP2DCLIENT) <<
"storeArea() error on writing on rpc port";
313 if (Property::copyPortable(pathtemp, areabot) ==
false)
315 yCError(MAP2DCLIENT) <<
"storePath() failed copyPortable()";
319 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
324 yCError(MAP2DCLIENT) <<
"storePath() received error from locations server";
330 yCError(MAP2DCLIENT) <<
"storePath() error on writing on rpc port";
345 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
350 yCError(MAP2DCLIENT) <<
"getLocationsList() received error from locations server";
359 for (
size_t i = 0; i < list->
size(); i++)
367 yCError(MAP2DCLIENT) <<
"getLocationsList() error while reading from locations server";
374 yCError(MAP2DCLIENT) <<
"getLocationsList() error on writing on rpc port";
389 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
394 yCError(MAP2DCLIENT) <<
"getAreasList() received error from locations server";
403 for (
size_t i = 0; i < list->
size(); i++)
411 yCError(MAP2DCLIENT) <<
"getAreasList() error while reading from locations server";
418 yCError(MAP2DCLIENT) <<
"getAreasList() error on writing on rpc port";
433 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
438 yCError(MAP2DCLIENT) <<
"getPathsList() received error from locations server";
447 for (
size_t i = 0; i < list->
size(); i++)
455 yCError(MAP2DCLIENT) <<
"getPathsList() error while reading from locations server";
462 yCError(MAP2DCLIENT) <<
"getPathsList() error on writing on rpc port";
478 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
483 yCError(MAP2DCLIENT) <<
"getLocation() received error from locations server";
496 yCError(MAP2DCLIENT) <<
"getLocation() error on writing on rpc port";
512 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
517 yCError(MAP2DCLIENT) <<
"getArea() received error from locations server";
523 if (Property::copyPortable(bt, area))
529 yCError(MAP2DCLIENT) <<
"getArea() failed copyPortable()";
536 yCError(MAP2DCLIENT) <<
"getArea() error on writing on rpc port";
552 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
557 yCError(MAP2DCLIENT) <<
"getPath() received error from locations server";
563 if (Property::copyPortable(bt, path))
569 yCError(MAP2DCLIENT) <<
"getPath() failed copyPortable()";
576 yCError(MAP2DCLIENT) <<
"getPath() error on writing on rpc port";
592 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
597 yCError(MAP2DCLIENT) <<
"deleteLocation() received error from locations server";
603 yCError(MAP2DCLIENT) <<
"deleteLocation() error on writing on rpc port";
620 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
625 yCError(MAP2DCLIENT) <<
"renameLocation() received error from locations server";
631 yCError(MAP2DCLIENT) <<
"renameLocation() error on writing on rpc port";
647 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
652 yCError(MAP2DCLIENT) <<
"deleteArea() received error from locations server";
658 yCError(MAP2DCLIENT) <<
"deleteArea() error on writing on rpc port";
674 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
679 yCError(MAP2DCLIENT) <<
"deletePath() received error from locations server";
685 yCError(MAP2DCLIENT) <<
"deletePath() error on writing on rpc port";
702 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
707 yCError(MAP2DCLIENT) <<
"renameArea() received error from locations server";
713 yCError(MAP2DCLIENT) <<
"renameArea() error on writing on rpc port";
730 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
735 yCError(MAP2DCLIENT) <<
"renamePath() received error from locations server";
741 yCError(MAP2DCLIENT) <<
"renamePath() error on writing on rpc port";
756 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
761 yCError(MAP2DCLIENT) <<
"clearAllLocations() received error from locations server";
767 yCError(MAP2DCLIENT) <<
"clearAllLocations() error on writing on rpc port";
782 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
787 yCError(MAP2DCLIENT) <<
"clearAllAreas() received error from locations server";
793 yCError(MAP2DCLIENT) <<
"clearAllAreas() error on writing on rpc port";
808 bool ret = m_rpcPort_to_Map2DServer.write(b, resp);
813 yCError(MAP2DCLIENT) <<
"clearAllPaths() received error from locations server";
819 yCError(MAP2DCLIENT) <<
"clearAllPaths() error on writing on rpc port";
A simple collection of objects that can be described and transmitted in a portable way.
constexpr yarp::conf::vocab32_t VOCAB_IMAP_SET_MAP
constexpr yarp::conf::vocab32_t VOCAB_IMAP_REMOVE
virtual std::int32_t asVocab() const
Get vocabulary identifier as an integer.
A base class for nested structures that can be searched.
size_type size() const
Gets the number of elements in the bottle.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool renameArea(std::string original_name, std::string new_name) override
Searches for an area and renames it.
constexpr yarp::conf::vocab32_t VOCAB_NAV_LOCATION
constexpr yarp::conf::vocab32_t VOCAB_IMAP_GET_MAP
bool getLocationsList(std::vector< std::string > &locations) override
Get a list of all stored locations.
#define YARP_LOG_COMPONENT(name,...)
constexpr yarp::conf::vocab32_t VOCAB_NAV_DELETE_X
bool deleteArea(std::string location_name) override
Delete an area.
bool renamePath(std::string original_name, std::string new_name) override
Searches for a path and renames it.
constexpr yarp::conf::vocab32_t VOCAB_NAV_CLEAR_X
constexpr yarp::conf::vocab32_t VOCAB_NAV_RENAME_X
void addFloat64(yarp::conf::float64_t x)
Places a 64-bit floating point number in the bottle, at the end of the list.
bool close() override
Close the DeviceDriver.
constexpr yarp::conf::vocab32_t VOCAB_IMAP_GET_NAMES
An interface for the device drivers.
bool get_map_names(std::vector< std::string > &map_names) override
Gets a list containing the names of all registered maps.
bool clearAllMaps() override
Removes all the registered maps from the server.
constexpr yarp::conf::vocab32_t VOCAB_NAV_GET_LIST_X
bool get_map(std::string map_name, yarp::dev::Nav2D::MapGrid2D &map) override
Gets a map from the map server.
bool deletePath(std::string path_name) override
Delete a path.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
Bottle & addList()
Places an empty nested list in the bottle, at the end of the list.
bool clearAllAreas() override
Delete all stored areas.
bool clearAllPaths() override
Delete all stored paths.
bool getAreasList(std::vector< std::string > &locations) override
Get a list of all stored areas.
bool getLocation(std::string location_name, yarp::dev::Nav2D::Map2DLocation &loc) override
Retrieves a location specified by the user in the world reference frame.
virtual std::string asString() const
Get string value.
bool deleteLocation(std::string location_name) override
Delete a location.
constexpr yarp::conf::vocab32_t VOCAB_NAV_AREA
constexpr yarp::conf::vocab32_t VOCAB_NAV_GET_X
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
bool storeArea(std::string location_name, yarp::dev::Nav2D::Map2DArea area) override
Store an area.
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 getPath(std::string path_name, yarp::dev::Nav2D::Map2DPath &path) override
Retrieves a path.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
void addVocab(int x)
Places a vocabulary item in the bottle, at the end of the list.
constexpr yarp::conf::vocab32_t VOCAB_IMAP_CLEAR
bool getPathsList(std::vector< std::string > &paths) override
Get a list of all stored paths.
constexpr yarp::conf::vocab32_t VOCAB_IMAP_OK
#define yCError(component,...)
bool store_map(const yarp::dev::Nav2D::MapGrid2D &map) override
Stores a map into the map server.
An interface to the operating system, including Port based communication.
constexpr yarp::conf::vocab32_t VOCAB_NAV_PATH
bool clearAllLocations() override
Delete all stored locations.
constexpr yarp::conf::vocab32_t VOCAB_NAV_STORE_X
bool renameLocation(std::string original_name, std::string new_name) override
Searches for a location and renames it.
virtual Bottle * asList() const
Get list value.
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 storePath(std::string path_name, yarp::dev::Nav2D::Map2DPath path) override
Store a path.
A single value (typically within a Bottle).
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
constexpr yarp::conf::vocab32_t VOCAB_OK
constexpr yarp::conf::vocab32_t VOCAB_IMAP
constexpr yarp::conf::vocab32_t VOCAB_INAVIGATION