32 " > sending to [%s] %s",
44 rpc(getRosCoreAddress(),
"xmlrpc", req, reply);
50 std::string::size_type break1 = url.find(
"://",0);
51 if (break1==std::string::npos) {
55 std::string::size_type break2 = url.find(
':',break1+3);
56 if (break2==std::string::npos) {
60 std::string::size_type break3 = url.find(
'/',break2+1);
61 if (break3==std::string::npos) {
65 hostname = url.substr(break1+3,break2-break1-3);
67 vportnum.
fromString(url.substr(break2+1,break3-break2-1).c_str());
71 rpc(getRosCoreAddress(),
"xmlrpc", req, reply);
93 rpc(c,
"xmlrpc",req,reply);
100 yCError(
TCPROSCARRIER,
"Failure looking up topic %s: expected list of protocols", name.c_str());
114 "topic %s available at %s:%d",
131 static bool checkedEnv =
false;
134 Contact c = getRosCoreAddressFromEnv();
static bool rpc(const Contact &c, const char *carrier, Bottle &writer, Bottle &reader)
const yarp::os::LogComponent & TCPROSCARRIER()
static yarp::os::Contact getRosCoreAddress()
bool lookupTopic(const std::string &name)
bool lookupCore(const std::string &name)
static yarp::os::Contact getRosCoreAddressFromEnv()
A simple collection of objects that can be described and transmitted in a portable way.
Bottle & addList()
Places an empty nested list 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 addString(const char *str)
Places a string in the bottle, at the end of the list.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
static Contact queryName(const std::string &name)
Find out information about a registered name.
static bool write(const Contact &contact, PortWriter &cmd, PortReader &reply, bool admin=false, bool quiet=false, double timeout=-1)
Send a single command to a port and await a single response.
A single value (typically within a Bottle).
virtual std::int32_t asInt32() const
Get 32-bit integer value.
virtual Bottle * asList() const
Get list value.
void fromString(const char *str)
Set value to correspond to a textual representation.
virtual std::string asString() const
Get string value.
std::string toString(const T &value)
convert an arbitrary type to string.
#define yCError(component,...)
#define yCDebug(component,...)
std::string getEnvironment(const char *key, bool *found=nullptr)
Read a variable from the environment.
An interface to the operating system, including Port based communication.