YARP
Yet Another Robot Platform
yarpros.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 
10 #include "RosSlave.h"
11 #include "RosLookup.h"
12 #include "TcpRosStream.h"
13 
14 #include <yarp/os/Vocab.h>
15 #include <yarp/os/LogComponent.h>
16 #include <yarp/os/LogStream.h>
17 
18 #include <cstdio>
19 #include <string>
20 
21 using namespace yarp::os;
22 using namespace std;
23 
24 
25 namespace {
27  const char* msg,
28  const char* file,
29  const unsigned int line,
30  const char* func,
31  double systemtime,
32  double networktime,
33  double externaltime,
34  const char* comp_name)
35 {
36  YARP_UNUSED(type);
37  YARP_UNUSED(file);
38  YARP_UNUSED(line);
39  YARP_UNUSED(func);
40  YARP_UNUSED(systemtime);
41  YARP_UNUSED(networktime);
42  YARP_UNUSED(externaltime);
43  YARP_UNUSED(comp_name);
44  static const char* err_str = "[ERROR] ";
45  static const char* warn_str = "[WARNING] ";
46  static const char* no_str = "";
47  printf("%s%s\n",
48  ((type == yarp::os::Log::ErrorType) ? err_str : ((type == yarp::os::Log::WarningType) ? warn_str : no_str)),
49  msg);
50 }
51 
52 YARP_LOG_COMPONENT(YARPROS,
53  "yarp.carrier.tcpros.yarpros",
57  nullptr)
58 }
59 
60 
61 string addPart(string t, string name, int code, Value *val, string orig, string mode="") {
62  char buf[5000];
63  if (mode=="length") {
64  sprintf(buf,"%s %s # suggested length: %d", t.c_str(), name.c_str(), code);
65  } else if (mode=="string") {
66  sprintf(buf,"%s %s # value seen: \"%s\"", t.c_str(), name.c_str(), orig.c_str());
67  } else if (mode=="vocab") {
68  char char4 = (code>>24)%256;
69  char char3 = (code>>16)%256;
70  char char2 = (code>>8)%256;
71  char char1 = code%256;
72  string r;
73  if (char1!=0) {
74  r += '\''; r += char1; r += "\'*256^3";
75  }
76  if (char2!=0) {
77  if (r!="") r += "+";
78  r += '\''; r += char2; r += "\'*256^2";
79  }
80  if (char3!=0) {
81  if (r!="") r += "+";
82  r += '\''; r += char3; r += "\'*256";
83  }
84  if (char4!=0) {
85  if (r!="") r += "+";
86  r += '\''; r += char4; r += '\'';
87  }
88  if (r.length()==0) {
89  r = "0";
90  }
91  sprintf(buf,"%s %s # set to %d (=%s=%s)", t.c_str(), name.c_str(), code, r.c_str(), orig.c_str());
92  } else {
93  if (val) {
94  sprintf(buf,"%s %s # set to %s (%s)", t.c_str(), name.c_str(), val->toString().c_str(), orig.c_str());
95  } else {
96  sprintf(buf,"%s %s # set to %d (%s)", t.c_str(), name.c_str(), code, orig.c_str());
97  }
98  }
99  return buf;
100 }
101 
102 string showFormat(Bottle& b, string root) {
103  string r;
104  int code = b.getSpecialization();
105  r += addPart("int32",root + "_tag",BOTTLE_TAG_LIST+code,nullptr,"BOTTLE_TAG_LIST+code");
106  r += "\n";
107  bool specialized = (code>0);
108  if (code==BOTTLE_TAG_INT32) {
109  r += addPart("int32[]",root,b.size(),nullptr,"length","length");
110  r += "\n";
111  if (b.size()<50) {
112  r += " # integers seen: ";
113  for (size_t i=0; i<b.size(); i++) {
114  char buf[1000];
115  sprintf(buf," %d",b.get(i).asInt32());
116  r += buf;
117  }
118  r += "\n";
119  }
120  return r;
121  }
122  if (code==BOTTLE_TAG_FLOAT64) {
123  r += addPart("float64[]",root,b.size(),nullptr,"length","length");
124  r += "\n";
125  if (b.size()<50) {
126  r += " # floats seen: ";
127  for (size_t i=0; i<b.size(); i++) {
128  char buf[1000];
129  sprintf(buf," %g",b.get(i).asFloat64());
130  r += buf;
131  }
132  r += "\n";
133  }
134  return r;
135  }
136  r += addPart("int32",root + "_len",b.size(),nullptr,"elements in list");
137  r += "\n";
138  for (size_t i=0; i<b.size(); i++) {
139  Value& v = b.get(i);
140  char tag_name[1000];
141  char val_name[1000];
142  sprintf(tag_name,"%s%zu_tag", root.c_str(), i);
143  sprintf(val_name,"%s%zu", root.c_str(), i);
144  if (v.isVocab()) {
145  if (!specialized) {
146  r += addPart("int32",tag_name,BOTTLE_TAG_VOCAB,nullptr,
147  "BOTTLE_TAG_VOCAB");
148  r += "\n";
149  }
150  r += addPart("int32",val_name,v.asInt32(),nullptr,v.toString(),"vocab");
151  r += "\n";
152  } else if (v.isInt32()) {
153  if (!specialized) {
154  r += addPart("int32",tag_name,BOTTLE_TAG_INT32,nullptr,
155  "BOTTLE_TAG_INT32");
156  r += "\n";
157  }
158  r += addPart("int32",val_name,v.asInt32(),&v,v.toString());
159  r += "\n";
160  } else if (v.isFloat64()) {
161  if (!specialized) {
162  r += addPart("int32",tag_name,BOTTLE_TAG_FLOAT64,nullptr,
163  "BOTTLE_TAG_FLOAT64");
164  r += "\n";
165  }
166  r += addPart("float64",val_name,v.asInt32(),&v,v.toString());
167  r += "\n";
168  } else if (v.isList()) {
169  r += showFormat(*v.asList(), val_name);
170  } else if (v.isBlob()) {
171  if (!specialized) {
172  r += addPart("int32",tag_name,BOTTLE_TAG_BLOB,nullptr,
173  "BOTTLE_TAG_BLOB");
174  r += "\n";
175  }
176  r += addPart("int8[]",val_name,v.asBlobLength(),nullptr,"length","length");
177  } else if (v.isString()) {
178  if (!specialized) {
179  r += addPart("int32",tag_name,BOTTLE_TAG_STRING,nullptr,
180  "BOTTLE_TAG_STRING");
181  r += "\n";
182  }
183  r += addPart("string",val_name,0,nullptr,v.asString(),"string");
184  r += "\n";
185  } else {
186  r += "IGNORED ";
187  r += v.toString();
188  r += "\n";
189  }
190  }
191  return r;
192 }
193 
194 void usage(const char *action,
195  const char *msg,
196  const char *example = nullptr,
197  const char *explanation = nullptr) {
198  yCInfo(YARPROS, "\n yarpros %s", action);
199  yCInfo(YARPROS, " %s\n", msg);
200  if (example!=nullptr) {
201  yCInfo(YARPROS, " $ yarpros %s", example);
202  }
203  if (explanation!=nullptr) {
204  yCInfo(YARPROS, " # %s", explanation);
205  }
206 }
207 
208 void show_usage() {
209  yCInfo(YARPROS, "Welcome to yarpros. Here are the most useful commands available:");
210  usage("sniff out <port>","suggest .msg for output from <port> ","sniff out /grabber");
211  usage("sniff in <port>","suggest .msg for input to <port> ","sniff in /grabber");
212  usage("type <name>","(MOVED to yarpidl_rosmsg) generate YARP header files from <name>.msg","type PointCloud2");
213  usage("help","show this help",nullptr);
214 
215  yCInfo(YARPROS);
216  yCInfo(YARPROS, "YARP clients can use the ROS name server. If you'd prefer to stick");
217  yCInfo(YARPROS, "with the native YARP name server, the following commands are useful:");
218  usage("roscore","register port /roscore to refer to ROS_MASTER_URI","roscore");
219  usage("roscore <hostname> <port number>","manually register port /roscore to point to the ros master","roscore 192.168.0.1 11311");
220  usage("pub[lisher] <node> <topic>","register a ROS publisher <node>/<topic> pair as a port called <node><topic>","publisher /talker /chatter","this registers a port called /talker/chatter");
221  usage("pub[lisher] <port> <node> <topic>","register a ROS publisher <node>/<topic> pair as a port called <port>","publisher /talker /talker /chatter");
222  usage("sub[scriber] <node> <topic>","register a ROS subscriber <node>/<topic> pair as a port called <node><topic>","subscriber /listener /chatter","this registers a port called /listener/chatter");
223  usage("sub[scriber] <yarp> <node> <topic>","register a ROS subscriber <node>/<topic> pair as a port called <port>","subscriber /listener /listener /chatter");
224  usage("service <yarp> <node> <service>","register a ROS service <node>/<service> pair as a port called <port>","service /adder /add_two_ints_server /add_two_ints");
225  usage("node <name>","register a ROS node name with YARP","node /talker");
226 }
227 
228 bool announce_port(const char *name,
229  PortReader& reply) {
230  Bottle req;
231  req.addString("announce");
232  req.addString(name);
234  req,
235  reply);
236 }
237 
238 bool register_port(const char *name,
239  const char *carrier,
240  const char *hostname,
241  int portnum,
242  PortReader& reply) {
243  std::string ip = Contact::convertHostToIp(hostname);
244  Bottle req;
245  req.addString("register");
246  req.addString(name);
247  req.addString(carrier);
248  req.addString(ip);
249  req.addInt32(portnum);
251  req,
252  reply);
253  if (ok) {
254  Bottle reply2;
255  announce_port(name,reply2);
256  }
257  return ok;
258 }
259 
260 
261 int main(int argc, char *argv[]) {
262  if (argc<=1) {
263  show_usage();
264  return 0;
265  }
266  if (std::string(argv[1])=="help" ||
267  std::string(argv[1])=="--help") {
268  show_usage();
269  return 0;
270  }
271 
272  Network yarp;
273 
274  // Read in the command sequence
275  Bottle cmd;
276  for (int i=1; i<argc; i++) {
277  Value v;
278  v.fromString(argv[i]);
279  if (argv[i][0]!='-') {
280  cmd.add(v);
281  }
282  }
283 
284  // Check for flags
285  Property options;
286  options.fromCommand(argc,argv);
287 
288  if (options.check("verbose")) {
289  yCWarning(YARPROS, "The 'verbose' option is deprecated");
290  }
291 
292  // Get the command tag
293  std::string tag = cmd.get(0).asString();
294 
295  // Process the command
296  if (tag=="roscore") {
297  if (cmd.size()>1) {
298  if (!(cmd.get(1).isString()&&cmd.get(2).isInt32())) {
299  yCError(YARPROS, "wrong syntax, run with no arguments for help");
300  return 1;
301  }
302  Bottle reply;
303  register_port("/roscore", "xmlrpc",
304  cmd.get(1).asString().c_str(), cmd.get(2).asInt32(),
305  reply);
306  yCInfo(YARPROS, "%s", reply.toString().c_str());
307  } else {
308  Bottle reply;
310  if (!c.isValid()) {
311  yCError(YARPROS, "cannot find roscore, is ROS_MASTER_URI set?");
312  return 1;
313  }
314  register_port("/roscore", "xmlrpc",
315  c.getHost().c_str(), c.getPort(),
316  reply);
317  yCInfo(YARPROS, "%s", reply.toString().c_str());
318  }
319  return 0;
320  } else if (tag=="node") {
321  Bottle req, reply;
322  if (cmd.size()!=2) {
323  yCError(YARPROS, "wrong syntax, run with no arguments for help");
324  return 1;
325  }
326  if (!cmd.get(1).isString()) {
327  yCError(YARPROS, "wrong syntax, run with no arguments for help");
328  return 1;
329  }
330  RosLookup lookup;
331  bool ok = lookup.lookupCore(cmd.get(1).asString());
332  if (ok) {
333  register_port(cmd.get(1).asString().c_str(),
334  "xmlrpc",
335  lookup.hostname.c_str(),
336  lookup.portnum,
337  reply);
338  yCInfo(YARPROS, "%s",reply.toString().c_str());
339  }
340  return ok?0:1;
341  } else if (tag=="publisher"||tag=="pub"||tag=="service"||tag=="srv") {
342  bool service = (tag=="service"||tag=="srv");
343  Bottle req, reply;
344  if (cmd.size()!=3 && cmd.size()!=4) {
345  yCError(YARPROS, "wrong syntax, run with no arguments for help");
346  return 1;
347  }
348  int offset = 0;
349  if (cmd.size()==3) {
350  offset = -1;
351  }
352  std::string yarp_port = cmd.get(1+offset).asString();
353  std::string ros_port = cmd.get(2+offset).asString();
354  std::string topic = cmd.get(3+offset).asString();
355  if (cmd.size()==3) {
356  yarp_port = ros_port + topic;
357  }
358  RosLookup lookup;
359  yCDebug(YARPROS, " * looking up ros node %s", ros_port.c_str());
360  bool ok = lookup.lookupCore(ros_port);
361  if (!ok) return 1;
362  yCDebug(YARPROS, " * found ros node %s", ros_port.c_str());
363  yCDebug(YARPROS, " * looking up topic %s", topic.c_str());
364  ok = lookup.lookupTopic(topic);
365  if (!ok) return 1;
366  yCDebug(YARPROS, " * found topic %s", topic.c_str());
367  string carrier = "tcpros+role.pub+topic.";
368  if (service) {
369  carrier = "rossrv+service.";
370  }
371  register_port(yarp_port.c_str(),
372  (carrier+topic).c_str(),
373  lookup.hostname.c_str(),
374  lookup.portnum,
375  reply);
376  yCInfo(YARPROS, "%s", reply.toString().c_str());
377  return 0;
378  } else if (tag=="subscriber"||tag=="sub") {
379  Bottle req, reply;
380  if (cmd.size()!=3 && cmd.size()!=4) {
381  yCError(YARPROS, "wrong syntax, run with no arguments for help");
382  return 1;
383  }
384  int offset = 0;
385  if (cmd.size()==3) {
386  offset = -1;
387  }
388  std::string yarp_port = cmd.get(1+offset).asString();
389  std::string ros_port = cmd.get(2+offset).asString();
390  std::string topic = cmd.get(3+offset).asString();
391  if (cmd.size()==3) {
392  yarp_port = ros_port + topic;
393  }
394  RosLookup lookup;
395  yCDebug(YARPROS, " * looking up ros node %s", ros_port.c_str());
396  bool ok = lookup.lookupCore(ros_port);
397  if (!ok) return 1;
398  yCDebug(YARPROS, " * found ros node %s", ros_port.c_str());
399  ok = register_port(yarp_port.c_str(),
400  (string("tcpros+role.sub+topic.")+topic).c_str(),
401  lookup.hostname.c_str(),
402  lookup.portnum,
403  reply);
404  yCInfo(YARPROS, "%s", reply.toString().c_str());
405  return ok?0:1;
406  } else if (tag=="type") {
407  yCError(YARPROS, "MOVED: 'yarpros type' is now 'yarpidl_rosmsg'");
408  return 1;
409  } else if (tag=="sniff") {
410  if (cmd.size()<2) {
411  yCError(YARPROS, "Show the format of a YARP bottle-compatible message in ROS syntax.");
412  return 1;
413  }
414  std::string dir = cmd.get(1).asString();
415  bool in = false;
416  if (dir=="in") in = true;
417  else if (dir=="out") in = false;
418  else {
419  yCError(YARPROS, "Please specify one of 'in' or 'out'.");
420  return 1;
421  }
422  std::string pname = cmd.get(2).asString();
423  Port p;
424  if (!p.open("...")) return 1;
425  if (in) {
426  if (!Network::connect(pname,p.getName(),"tcp+log.in")) return 1;
427  } else {
428  if (!Network::connect(pname,p.getName())) return 1;
429  }
430  Bottle b;
431  p.read(b);
432  string r;
433  if (in&&b.get(0).asVocab()==yarp::os::createVocab('r','p','c')&&b.get(1).isList()) {
434 
435  r = showFormat(*b.get(1).asList(),"v");
436  } else {
437  r = showFormat(b,"v");
438  }
439  yCInfo(YARPROS, "Got message: [%s]",r.c_str());
440  return 0;
441  } else {
442  yCError(YARPROS, "unknown command, run with no arguments for help");
443  return 1;
444  }
445  return 0;
446 }
LogStream.h
yarp::os::Bottle
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:73
yarp::os::Value::asVocab
virtual std::int32_t asVocab() const
Get vocabulary identifier as an integer.
Definition: Value.cpp:231
yarp::os::Bottle::toString
std::string toString() const override
Gives a human-readable textual representation of the bottle.
Definition: Bottle.cpp:214
yarp::os::createVocab
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
yarp::os::Log::InfoType
@ InfoType
Definition: Log.h:79
yarp::os::Log::ErrorType
@ ErrorType
Definition: Log.h:81
yarp::os::Bottle::size
size_type size() const
Gets the number of elements in the bottle.
Definition: Bottle.cpp:254
showFormat
string showFormat(Bottle &b, string root)
Definition: yarpros.cpp:102
t
float t
Definition: FfmpegWriter.cpp:74
BOTTLE_TAG_LIST
#define BOTTLE_TAG_LIST
Definition: Bottle.h:30
yCWarning
#define yCWarning(component,...)
Definition: LogComponent.h:146
yarp::os::NetworkBase::write
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.
Definition: Network.cpp:1229
yarp::os::Log::LogTypeReserved
@ LogTypeReserved
Definition: Log.h:83
yarp::os::Log::WarningType
@ WarningType
Definition: Log.h:80
YARP_LOG_COMPONENT
#define YARP_LOG_COMPONENT(name,...)
Definition: LogComponent.h:80
RosLookup.h
yarp::os::impl::LogComponent::print_callback
void print_callback(yarp::os::Log::LogType type, const char *msg, const char *file, const unsigned int line, const char *func, double systemtime, double networktime, double externaltime, const char *comp_name)
Definition: LogComponent.cpp:54
BOTTLE_TAG_STRING
#define BOTTLE_TAG_STRING
Definition: Bottle.h:28
main
int main(int argc, char *argv[])
Definition: yarpros.cpp:261
RosLookup::lookupTopic
bool lookupTopic(const std::string &name)
Definition: RosLookup.cpp:76
yarp::os::Contact::convertHostToIp
static std::string convertHostToIp(const char *name)
If the host is a machine name, convert it to a plausible IP address.
Definition: Contact.cpp:334
usage
void usage(const char *action, const char *msg, const char *example=nullptr, const char *explanation=nullptr)
Definition: yarpros.cpp:194
YARP_UNUSED
#define YARP_UNUSED(var)
Definition: api.h:159
yarp::os::Port::open
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
Definition: Port.cpp:82
RosLookup
Definition: RosLookup.h:15
RosLookup::getRosCoreAddressFromEnv
static yarp::os::Contact getRosCoreAddressFromEnv()
Definition: RosLookup.cpp:121
BOTTLE_TAG_INT32
#define BOTTLE_TAG_INT32
Definition: Bottle.h:23
yarp::os::Log::LogType
LogType
Definition: Log.h:75
yarp::os::Port
A mini-server for network communication.
Definition: Port.h:50
RosSlave.h
BOTTLE_TAG_VOCAB
#define BOTTLE_TAG_VOCAB
Definition: Bottle.h:25
yarp::os::Value::isString
virtual bool isString() const
Checks if value is a string.
Definition: Value.cpp:159
RosLookup::portnum
int portnum
Definition: RosLookup.h:19
yarp::os::Property::fromCommand
void fromCommand(int argc, char *argv[], bool skipFirst=true, bool wipe=true)
Interprets a list of command arguments as a list of properties.
Definition: Property.cpp:1057
yarp::os::PortReader
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition: PortReader.h:28
yarp::os::Bottle::get
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
Definition: Bottle.cpp:249
yarp::os::Value::isBlob
virtual bool isBlob() const
Checks if value is a binary object.
Definition: Value.cpp:183
yarp::os::Contact::getPort
int getPort() const
Get the port number associated with this Contact for socket communication.
Definition: Contact.cpp:242
yarp::os::Value::isFloat64
virtual bool isFloat64() const
Checks if value is a 64-bit floating point number.
Definition: Value.cpp:153
yarp::os::Value::asString
virtual std::string asString() const
Get string value.
Definition: Value.cpp:237
yarp::os::NetworkBase::connect
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
Definition: Network.cpp:685
register_port
bool register_port(const char *name, const char *carrier, const char *hostname, int portnum, PortReader &reply)
Definition: yarpros.cpp:238
RosLookup::hostname
std::string hostname
Definition: RosLookup.h:18
announce_port
bool announce_port(const char *name, PortReader &reply)
Definition: yarpros.cpp:228
addPart
string addPart(string t, string name, int code, Value *val, string orig, string mode="")
Definition: yarpros.cpp:61
yarp::os::Bottle::addInt32
void addInt32(std::int32_t x)
Places a 32-bit integer in the bottle, at the end of the list.
Definition: Bottle.cpp:143
yarp::os::Property::check
bool check(const std::string &key) const override
Check if there exists a property of the given name.
Definition: Property.cpp:1024
yarp::os::Contactable::getName
virtual std::string getName() const
Get name of port.
Definition: Contactable.cpp:17
yarp::os::Bottle::addString
void addString(const char *str)
Places a string in the bottle, at the end of the list.
Definition: Bottle.cpp:173
LogComponent.h
yarp::os::Value::isList
virtual bool isList() const
Checks if value is a list.
Definition: Value.cpp:165
yarp::os::Port::read
bool read(PortReader &reader, bool willReply=false) override
Read an object from the port.
Definition: Port.cpp:475
RosLookup::lookupCore
bool lookupCore(const std::string &name)
Definition: RosLookup.cpp:39
BOTTLE_TAG_BLOB
#define BOTTLE_TAG_BLOB
Definition: Bottle.h:29
yCError
#define yCError(component,...)
Definition: LogComponent.h:157
BOTTLE_TAG_FLOAT64
#define BOTTLE_TAG_FLOAT64
Definition: Bottle.h:27
yarp::os::Value::asInt32
virtual std::int32_t asInt32() const
Get 32-bit integer value.
Definition: Value.cpp:207
yCInfo
#define yCInfo(component,...)
Definition: LogComponent.h:135
yarp::os
An interface to the operating system, including Port based communication.
Definition: AbstractCarrier.h:17
yCDebug
#define yCDebug(component,...)
Definition: LogComponent.h:112
yarp::os::Contact::isValid
bool isValid() const
Checks if a Contact is tagged as valid.
Definition: Contact.cpp:301
yarp::os::Network
Utilities for manipulating the YARP network, including initialization and shutdown.
Definition: Network.h:786
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::os::Value::fromString
void fromString(const char *str)
Set value to correspond to a textual representation.
Definition: Value.cpp:354
Vocab.h
yarp::os::Contact::getHost
std::string getHost() const
Get the host name associated with this Contact for socket communication.
Definition: Contact.cpp:231
yarp::os::Contact
Represents how to reach a part of a YARP network.
Definition: Contact.h:39
yarp::os::Value::asList
virtual Bottle * asList() const
Get list value.
Definition: Value.cpp:243
show_usage
void show_usage()
Definition: yarpros.cpp:208
yarp::os::Bottle::add
void add(const Value &value)
Add a Value to the bottle, at the end of the list.
Definition: Bottle.cpp:339
yarp::os::Value::toString
std::string toString() const override
Return a standard text representation of the content of the object.
Definition: Value.cpp:359
yarp::os::Value
A single value (typically within a Bottle).
Definition: Value.h:47
yarp::os::NetworkBase::getNameServerContact
static Contact getNameServerContact()
Get the contact information for the port associated with the nameserver (usually "/root",...
Definition: Network.cpp:1363
yarp::os::Value::asBlobLength
virtual size_t asBlobLength() const
Get binary data length.
Definition: Value.cpp:270
TcpRosStream.h
yarp::os::Bottle::getSpecialization
int getSpecialization()
Get numeric bottle code for this bottle.
Definition: Bottle.cpp:264
yarp::os::Value::asFloat64
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
Definition: Value.cpp:225
yarp::os::Value::isVocab
virtual bool isVocab() const
Checks if value is a vocabulary identifier.
Definition: Value.cpp:177
yarp::os::Property
A class for storing options and configuration information.
Definition: Property.h:37
yarp::os::Value::isInt32
virtual bool isInt32() const
Checks if value is a 32-bit integer.
Definition: Value.cpp:135