|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
32 m_remote_name.clear();
37 if (m_local_name ==
"")
39 yCError(ROBOTDESCRIPTIONCLIENT,
"open(): Invalid local name");
43 if (m_remote_name ==
"")
45 yCError(ROBOTDESCRIPTIONCLIENT,
"open(): Invalid remote name");
49 std::string local_rpc, remote_rpc;
51 local_rpc = m_local_name +
"/rpc";
52 remote_rpc = m_remote_name +
"/rpc";
54 if (!m_rpc_port.open(local_rpc))
56 yCError(ROBOTDESCRIPTIONCLIENT,
"open(): Could not open rpc port %s, check network", local_rpc.c_str());
63 ok = Network::connect(local_rpc, remote_rpc);
66 yCError(ROBOTDESCRIPTIONCLIENT,
"open(): Could not connect to %s", remote_rpc.c_str());
91 bool ret = m_rpc_port.write(b, resp);
96 yCError(ROBOTDESCRIPTIONCLIENT) <<
"getAllDevices(): Received error from server";
102 for (
size_t i = 0; i < b->
size(); i += 2)
107 dev_list.push_back(desc);
114 yCError(ROBOTDESCRIPTIONCLIENT) <<
"Error on writing on rpc port";
129 bool ret = m_rpc_port.write(b, resp);
134 yCError(ROBOTDESCRIPTIONCLIENT) <<
"unregisterDevice(): Received error from server";
140 yCError(ROBOTDESCRIPTIONCLIENT) <<
"Error on writing on rpc port";
156 bool ret = m_rpc_port.write(b, resp);
161 yCError(ROBOTDESCRIPTIONCLIENT) <<
"registerDevice(): Received error from server";
167 yCError(ROBOTDESCRIPTIONCLIENT) <<
"Error on writing on rpc port";
182 bool ret = m_rpc_port.write(b, resp);
187 yCError(ROBOTDESCRIPTIONCLIENT) <<
"getAllDevices(): Received error from server";
193 for (
size_t i = 0; i < b->
size();i+=2)
198 dev_list.push_back(desc);
205 yCError(ROBOTDESCRIPTIONCLIENT) <<
"Error on writing on rpc port";
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_BY_TYPE
A simple collection of objects that can be described and transmitted in a portable way.
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.
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_DEVICE
bool getAllDevices(std::vector< yarp::dev::DeviceDescription > &dev_list) override
Ask the complete list of all yarp device drivers registered by a robot description server.
#define YARP_LOG_COMPONENT(name,...)
bool close() override
Close the DeviceDriver.
bool unregisterDevice(const std::string &device_name) override
Unregister a running yarp device from a robot description server.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
An interface for the device drivers.
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_DESCRIPTION
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_SET
virtual std::string asString() const
Get string value.
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_DELETE
void addVocab(int x)
Places a vocabulary item in the bottle, at the end of the list.
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_GET
#define yCError(component,...)
bool getAllDevicesByType(const std::string &type, std::vector< yarp::dev::DeviceDescription > &dev_list) override
Ask a list of all registered yarp device drivers whose type corresponds to the given param.
An interface to the operating system, including Port based communication.
bool registerDevice(const yarp::dev::DeviceDescription &dev) override
Register a new running yarp device into a robot description server.
virtual Bottle * asList() const
Get list value.
constexpr yarp::conf::vocab32_t VOCAB_IROBOT_ALL
constexpr yarp::conf::vocab32_t VOCAB_OK