YARP
Yet Another Robot Platform
ServerInertial.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * Copyright (C) 2006-2010 RobotCub Consortium
4  * All rights reserved.
5  *
6  * This software may be modified and distributed under the terms of the
7  * BSD-3-Clause license. See the accompanying LICENSE file for details.
8  */
9 
10 #include "ServerInertial.h"
11 #include <cstdio>
12 
13 #include <yarp/os/BufferedPort.h>
14 #include <yarp/dev/PolyDriver.h>
16 #include <yarp/os/Time.h>
17 #include <yarp/os/Network.h>
18 #include <yarp/os/Thread.h>
19 #include <yarp/os/Vocab.h>
20 #include <yarp/os/Bottle.h>
22 #include <yarp/os/Log.h>
23 #include <yarp/os/LogStream.h>
24 
25 
26 using namespace yarp::dev;
27 using namespace yarp::os;
28 
29 YARP_LOG_COMPONENT(SERVERINERTIAL, "yarp.devices.ServerInertial")
30 
31 
32 
36  IMU_polydriver(nullptr),
37  ownDevices(false),
38  subDeviceOwned(nullptr)
39 {
40  IMU = nullptr;
41  spoke = false;
42  iTimed=nullptr;
43  period = 0.005;
44  prev_timestamp_counter=0;
45  curr_timestamp_counter=0;
46  trap = 0;
47  strict = false;
48  partName = "Server Inertial";
49 
50  // init ROS data
51  frame_id = "";
52  rosNodeName = "";
53  rosTopicName = "";
54  rosNode = nullptr;
55  rosMsgCounter = 0;
56  useROS = ROS_disabled;
57 
58  // init a fake covariance matrix
59  covariance.resize(9);
60  covariance.assign(9, 0);
61 
62 // rosData.angular_velocity.x = 0;
63 // rosData.angular_velocity.y = 0;
64 // rosData.angular_velocity.z = 0;
65 // rosData.angular_velocity_covariance = covariance;
66 
67 // rosData.linear_acceleration.x = 0;
68 // rosData.linear_acceleration.y = 0;
69 // rosData.linear_acceleration.z = 0;
70 // rosData.linear_acceleration_covariance = covariance;
71 
72 // rosData.orientation.x = 0;
73 // rosData.orientation.y = 0;
74 // rosData.orientation.z = 0;
75 // rosData.orientation.w = 0;
76 // rosData.orientation_covariance = covariance;
77 
78 // yCDebug(SERVERINERTIAL) << "covariance size is " << covariance.size();
79 }
80 
82 {
83  if (IMU != nullptr) close();
84 }
85 
86 
87 bool ServerInertial::checkROSParams(yarp::os::Searchable &config)
88 {
89  // check for ROS parameter group
90  if(!config.check("ROS") )
91  {
92  useROS = ROS_disabled;
93  yCInfo(SERVERINERTIAL) << "No ROS group found in config file ... skipping ROS initialization.";
94  return true;
95  }
96 
97  yCInfo(SERVERINERTIAL) << "ROS group was FOUND in config file.";
98 
99  Bottle &rosGroup = config.findGroup("ROS");
100  if(rosGroup.isNull())
101  {
102  yCError(SERVERINERTIAL) << partName << "ROS group params is not a valid group or empty";
103  useROS = ROS_config_error;
104  return false;
105  }
106 
107  // check for useROS parameter
108  if(!rosGroup.check("useROS"))
109  {
110  yCError(SERVERINERTIAL) << partName << " cannot find useROS parameter, mandatory when using ROS message. \n \
111  Allowed values are true, false, ROS_only";
112  useROS = ROS_config_error;
113  return false;
114  }
115  std::string ros_use_type = rosGroup.find("useROS").asString();
116  if(ros_use_type == "false")
117  {
118  yCInfo(SERVERINERTIAL) << partName << "useROS topic if set to 'false'";
119  useROS = ROS_disabled;
120  return true;
121  }
122  else if(ros_use_type == "true")
123  {
124  yCInfo(SERVERINERTIAL) << partName << "useROS topic if set to 'true'";
125  useROS = ROS_enabled;
126  }
127  else if(ros_use_type == "only")
128  {
129  yCInfo(SERVERINERTIAL) << partName << "useROS topic if set to 'only";
130  useROS = ROS_only;
131  }
132  else
133  {
134  yCInfo(SERVERINERTIAL) << partName << "useROS parameter is seet to unvalid value ('" << ros_use_type << "'), supported values are 'true', 'false', 'only'";
135  useROS = ROS_config_error;
136  return false;
137  }
138 
139  // check for ROS_nodeName parameter
140  if(!rosGroup.check("ROS_nodeName"))
141  {
142  yCError(SERVERINERTIAL) << partName << " cannot find ROS_nodeName parameter, mandatory when using ROS message";
143  useROS = ROS_config_error;
144  return false;
145  }
146  rosNodeName = rosGroup.find("ROS_nodeName").asString(); // TODO: check name is correct
147  yCInfo(SERVERINERTIAL) << partName << "rosNodeName is " << rosNodeName;
148 
149  // check for ROS_topicName parameter
150  if(!rosGroup.check("ROS_topicName"))
151  {
152  yCError(SERVERINERTIAL) << partName << " cannot find ROS_topicName parameter, mandatory when using ROS message";
153  useROS = ROS_config_error;
154  return false;
155  }
156  rosTopicName = rosGroup.find("ROS_topicName").asString();
157  yCInfo(SERVERINERTIAL) << partName << "ROS_topicName is " << rosTopicName;
158 
159  // check for frame_id parameter
160  if(!rosGroup.check("frame_id"))
161  {
162  yCError(SERVERINERTIAL) << partName << " cannot find frame_id parameter, mandatory when using ROS message";
163  useROS = ROS_config_error;
164  return false;
165  }
166  frame_id = rosGroup.find("frame_id").asString();
167  yCInfo(SERVERINERTIAL) << partName << "frame_id is " << frame_id;
168 
169  return true;
170 }
171 
172 bool ServerInertial::initialize_ROS()
173 {
174  bool success = false;
175  switch(useROS)
176  {
177  case ROS_enabled:
178  case ROS_only:
179  {
180  rosNode = new yarp::os::Node(rosNodeName); // add a ROS node
181 
182  if(rosNode == nullptr)
183  {
184  yCError(SERVERINERTIAL) << " opening " << rosNodeName << " Node, check your yarp-ROS network configuration";
185  success = false;
186  break;
187  }
188 
189  if (!rosPublisherPort.topic(rosTopicName) )
190  {
191  yCError(SERVERINERTIAL) << " opening " << rosTopicName << " Topic, check your yarp-ROS network configuration";
192  success = false;
193  break;
194  }
195  success = true;
196  } break;
197 
198  case ROS_disabled:
199  {
200  yCInfo(SERVERINERTIAL) << partName << ": no ROS initialization required";
201  success = true;
202  } break;
203 
204  case ROS_config_error:
205  {
206  yCError(SERVERINERTIAL) << partName << " ROS parameter are not correct, check your configuration file";
207  success = false;
208  } break;
209 
210  default:
211  {
212  yCError(SERVERINERTIAL) << partName << " something went wrong with ROS configuration, we should never be here!!!";
213  success = false;
214  } break;
215  }
216  return success;
217 }
218 
219 bool ServerInertial::openDeferredAttach(yarp::os::Property& prop)
220 {
221  return true;
222 }
223 
224 // If a subdevice parameter is given to the wrapper, it will open it as well
225 // and attach to it immediately.
226 bool ServerInertial::openAndAttachSubDevice(yarp::os::Property& prop)
227 {
228  yarp::os::Value &subdevice = prop.find("subdevice");
229  IMU_polydriver = new yarp::dev::PolyDriver;
230 
231  yCDebug(SERVERINERTIAL, "Subdevice %s", subdevice.toString().c_str());
232  if (subdevice.isString())
233  {
234  // maybe user isn't doing nested configuration
236  p.setMonitor(prop.getMonitor(), "subdevice"); // pass on any monitoring
237  p.fromString(prop.toString());
238  p.put("device",subdevice.toString());
239  IMU_polydriver->open(p);
240  }
241  else
242  IMU_polydriver->open(subdevice);
243 
244  if (!IMU_polydriver->isValid())
245  {
246  yCError(SERVERINERTIAL, "cannot create device <%s>", subdevice.toString().c_str());
247  return false;
248  }
249 
250  // if we are here, poly is valid
251  IMU_polydriver->view(IMU); // attach to subdevice
252  if(IMU == nullptr)
253  {
254  yCError(SERVERINERTIAL, "Error, subdevice <%s> has no valid IMU interface", subdevice.toString().c_str());
255  IMU_polydriver->close();
256  return false;
257  }
258 
259  // iTimed interface
260  IMU_polydriver->view(iTimed); // not mandatory
261  return true;
262 }
263 
275 {
276  Property prop;
277  prop.fromString(config.toString());
278 
279  p.setReader(*this);
280 
281  period = config.check("period",yarp::os::Value(0.005),"maximum period").asFloat64();
282  strict = config.check("strict",yarp::os::Value(false),"strict write").asBool();
283 
284  //Look for the device name (serial Port). Usually /dev/ttyUSB0
285  // check if we need to create subdevice or if they are
286  // passed later on thorugh attachAll()
287  if(prop.check("subdevice"))
288  {
289  ownDevices=true;
290  if(! openAndAttachSubDevice(prop))
291  {
292  yCError(SERVERINERTIAL, "ControlBoardWrapper: error while opening subdevice");
293  return false;
294  }
295  }
296  else
297  {
298  ownDevices=false;
299  if(!openDeferredAttach(prop))
300  return false;
301  }
302 
303 
304  checkROSParams(config);
305 
306 
307 
308  //Look for the portname to register (--name option), defaulting to /inertial if missing
309  std::string portName;
310  if(useROS != ROS_only)
311  {
312  if (config.check("name"))
313  portName = config.find("name").asString();
314  else
315  {
316  yCInfo(SERVERINERTIAL) << "Using default values for port name, you can change it by using '--name /myPortName' parameter";
317  portName = "/inertial";
318  }
319 
320  if(!p.open(portName))
321  {
322  yCError(SERVERINERTIAL) << "ServerInertial, cannot open port " << portName;
323  return false;
324  }
325  writer.attach(p);
326  }
327 
328  // call ROS node/topic initialization, if needed
329  if(!initialize_ROS() )
330  {
331  return false;
332  }
333 
334  if( (ownDevices) && (IMU!=nullptr) )
335  {
336  start();
337  }
338 
339  return true;
340 }
341 
343 {
344  yCInfo(SERVERINERTIAL, "Closing Server Inertial...");
345  stop();
346 
347  if(rosNode!=nullptr) {
348  rosNode->interrupt();
349  delete rosNode;
350  rosNode = nullptr;
351  }
352 
353  if( (ownDevices) && (IMU_polydriver != nullptr) )
354  {
355  IMU_polydriver->close();
356  IMU = nullptr;
357  }
358  return true;
359 }
360 
361 
363 {
364  if (IMU==nullptr)
365  {
366  return false;
367  }
368  else
369  {
370  int nchannels;
371  IMU->getChannels (&nchannels);
372 
373  yarp::sig::Vector indata(nchannels);
374  bool worked(false);
375 
376  worked=IMU->read(indata);
377  if (worked)
378  {
379  bot.clear();
380 
381  // Euler+accel+gyro+magn orientation values
382  for (int i = 0; i < nchannels; i++)
383  bot.addFloat64 (indata[i]);
384  }
385  else
386  {
387  bot.clear(); //dummy info.
388  }
389 
390  return(worked);
391  }
392 }
393 
395 {
396  double before, now;
397  yCInfo(SERVERINERTIAL, "Starting server Inertial thread");
398  while (!isStopping())
399  {
400  before = yarp::os::Time::now();
401  if (IMU!=nullptr)
402  {
403  Bottle imuData;
404  bool res = getInertial(imuData);
405 
406  // publish data on YARP port if required
407  if(useROS != ROS_only)
408  {
409  yarp::os::Bottle& bot = writer.get();
410  bot = imuData;
411  if (res)
412  {
413  static yarp::os::Stamp ts;
414  if (iTimed)
415  ts=iTimed->getLastInputStamp();
416  else
417  ts.update();
418 
419 
420  curr_timestamp_counter = ts.getCount();
421 
422  if (curr_timestamp_counter!=prev_timestamp_counter)
423  {
424  if (!spoke)
425  {
426  yCDebug(SERVERINERTIAL, "Writing an Inertial measurement.");
427  spoke = true;
428  }
429  p.setEnvelope(ts);
430  writer.write(strict);
431  }
432  else
433  {
434  trap++;
435  }
436 
437  prev_timestamp_counter = curr_timestamp_counter;
438  }
439  }
440 
441  // publish ROS topic if required
442  if(useROS != ROS_disabled)
443  {
444  double euler_xyz[3], quaternion[4];
445 
446  euler_xyz[0] = imuData.get(0).asFloat64();
447  euler_xyz[1] = imuData.get(1).asFloat64();
448  euler_xyz[2] = imuData.get(2).asFloat64();
449 
450  convertEulerAngleYXZdegrees_to_quaternion(euler_xyz, quaternion);
451 
452  yarp::rosmsg::sensor_msgs::Imu &rosData = rosPublisherPort.prepare();
453 
454  rosData.header.seq = rosMsgCounter++;
455  rosData.header.stamp = yarp::os::Time::now();
456  rosData.header.frame_id = frame_id;
457 
458  rosData.orientation.x = quaternion[0];
459  rosData.orientation.y = quaternion[1];
460  rosData.orientation.z = quaternion[2];
461  rosData.orientation.w = quaternion[3];
462  rosData.orientation_covariance = covariance;
463 
464  rosData.linear_acceleration.x = imuData.get(3).asFloat64(); // [m/s^2]
465  rosData.linear_acceleration.y = imuData.get(4).asFloat64(); // [m/s^2]
466  rosData.linear_acceleration.z = imuData.get(5).asFloat64(); // [m/s^2]
467  rosData.linear_acceleration_covariance = covariance;
468 
469  rosData.angular_velocity.x = imuData.get(6).asFloat64(); // to be converted into rad/s (?) - verify with users
470  rosData.angular_velocity.y = imuData.get(7).asFloat64(); // to be converted into rad/s (?) - verify with users
471  rosData.angular_velocity.z = imuData.get(8).asFloat64(); // to be converted into rad/s (?) - verify with users
472  rosData.angular_velocity_covariance = covariance;
473 
474  rosPublisherPort.write();
475  }
476  }
477 
480  if ((now - before) < period) {
481  double k = period-(now-before);
483  }
484  }
485  yCInfo(SERVERINERTIAL, "Server Intertial thread finished");
486 }
487 
489 {
490  yarp::os::Bottle cmd, response;
491  cmd.read(connection);
492  yCTrace(SERVERINERTIAL, "command received: %s", cmd.toString().c_str());
493 
494  // We receive a command but don't do anything with it.
495  return true;
496 }
497 
499 {
500  if (IMU == nullptr) { return false; }
501  return IMU->read (out);
502 }
503 
505 {
506  if (IMU == nullptr) { return false; }
507  return IMU->getChannels (nc);
508 }
509 
510 bool ServerInertial::calibrate(int ch, double v)
511 {
512  if (IMU==nullptr) {return false;}
513  return IMU->calibrate(ch, v);
514 }
515 
516 
518 {
520  if(!poly)
521  {
522  yCError(SERVERINERTIAL, "ServerInertial: device to attach to is not valid!");
523  return false;
524  }
525  IMU_polydriver = poly;
526  IMU_polydriver->view(IMU);
527 
528  // iTimed interface
529  IMU_polydriver->view(iTimed); // not mandatory
530 
531  if(IMU != nullptr)
532  {
533  if(!Thread::isRunning())
534  start();
535  }
536  else
537  {
538  yCError(SERVERINERTIAL, "ControlBoardWrapper: attach to subdevice failed");
539  }
540  return true;
541 }
542 
544 {
545  return true;
546 }
547 
548 bool ServerInertial::attachAll(const PolyDriverList &imuToAttachTo)
549 {
550  if (imuToAttachTo.size() != 1)
551  {
552  yCError(SERVERINERTIAL, "ServerInertial: cannot attach more than one device");
553  return false;
554  }
555 
556  return attach(imuToAttachTo[0]->poly);
557 }
558 
560 {
561  IMU = nullptr;
562  return true;
563 }
LogStream.h
ServerInertial::~ServerInertial
~ServerInertial() override
Definition: ServerInertial.cpp:81
yarp::rosmsg::geometry_msgs::Quaternion::y
yarp::conf::float64_t y
Definition: Quaternion.h:38
yarp::rosmsg::geometry_msgs::Vector3::z
yarp::conf::float64_t z
Definition: Vector3.h:42
ROS_only
@ ROS_only
Definition: yarpRosHelper.h:23
yarp::os::Bottle
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:73
yarp::os::Bottle::toString
std::string toString() const override
Gives a human-readable textual representation of the bottle.
Definition: Bottle.cpp:214
yarp::os::Property::put
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
Definition: Property.cpp:998
yarp::rosmsg::sensor_msgs::Imu::angular_velocity_covariance
std::vector< yarp::conf::float64_t > angular_velocity_covariance
Definition: Imu.h:62
yarp::os::Bottle::clear
void clear()
Empties the bottle of any objects it contains.
Definition: Bottle.cpp:124
ServerInertial::attach
bool attach(yarp::dev::PolyDriver *poly) override
IWrapper interface Attach to another object.
Definition: ServerInertial.cpp:517
Network.h
yarp::os::Searchable
A base class for nested structures that can be searched.
Definition: Searchable.h:69
ServerInertial::getInertial
virtual bool getInertial(yarp::os::Bottle &bot)
Definition: ServerInertial.cpp:362
yarp::os::Searchable::findGroup
virtual Bottle & findGroup(const std::string &key) const =0
Gets a list corresponding to a given keyword.
yarp::os::Property::write
bool write(ConnectionWriter &writer) const override
Write this object to a network connection.
Definition: Property.cpp:1117
yarp::os::Searchable::toString
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
yarp::os::Property::fromString
void fromString(const std::string &txt, bool wipe=true)
Interprets a string as a list of properties.
Definition: Property.cpp:1046
yarp::dev::PolyDriverList::size
int size() const
Definition: PolyDriverList.cpp:39
IPreciselyTimed.h
YARP_LOG_COMPONENT
#define YARP_LOG_COMPONENT(name,...)
Definition: LogComponent.h:80
yarp::rosmsg::geometry_msgs::Vector3::y
yarp::conf::float64_t y
Definition: Vector3.h:41
yarp::rosmsg::std_msgs::Header::frame_id
std::string frame_id
Definition: Header.h:49
ROS_enabled
@ ROS_enabled
Definition: yarpRosHelper.h:22
yarp::rosmsg::sensor_msgs::Imu::linear_acceleration_covariance
std::vector< yarp::conf::float64_t > linear_acceleration_covariance
Definition: Imu.h:64
yarp::rosmsg::sensor_msgs::Imu::orientation
yarp::rosmsg::geometry_msgs::Quaternion orientation
Definition: Imu.h:59
yarp::rosmsg::geometry_msgs::Vector3::x
yarp::conf::float64_t x
Definition: Vector3.h:40
SERVERINERTIAL
const yarp::os::LogComponent & SERVERINERTIAL()
Definition: ServerInertial.cpp:29
yarp::rosmsg::geometry_msgs::Quaternion::x
yarp::conf::float64_t x
Definition: Quaternion.h:37
yarp::dev::DeviceDriver::view
bool view(T *&x)
Get an interface to the device driver.
Definition: DeviceDriver.h:77
ServerInertial.h
yarp::os::Property::find
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
Definition: Property.cpp:1034
yarp::dev::PolyDriverList
Definition: PolyDriverList.h:22
yarp::os::Bottle::addFloat64
void addFloat64(yarp::conf::float64_t x)
Places a 64-bit floating point number in the bottle, at the end of the list.
Definition: Bottle.cpp:161
yarp::rosmsg::sensor_msgs::Imu::angular_velocity
yarp::rosmsg::geometry_msgs::Vector3 angular_velocity
Definition: Imu.h:61
yarp::os::Bottle::find
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
Definition: Bottle.cpp:290
yarp::os::Time::now
double now()
Return the current time in seconds, relative to an arbitrary starting point.
Definition: Time.cpp:124
yarp::dev
An interface for the device drivers.
Definition: audioBufferSizeData.cpp:17
yarp::sig::VectorOf< double >
yarp::os::Bottle::check
bool check(const std::string &key) const override
Check if there exists a property of the given name.
Definition: Bottle.cpp:280
Log.h
yarp::rosmsg::std_msgs::Header::seq
std::uint32_t seq
Definition: Header.h:47
yarp::os::Value::isString
virtual bool isString() const
Checks if value is a string.
Definition: Value.cpp:159
ServerInertial::detach
bool detach() override
Detach the object (you must have first called attach).
Definition: ServerInertial.cpp:543
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::Property::toString
std::string toString() const override
Return a standard text representation of the content of the object.
Definition: Property.cpp:1052
PolyDriver.h
yarp::rosmsg::sensor_msgs::Imu
Definition: Imu.h:56
yarp::os::Value::asString
virtual std::string asString() const
Get string value.
Definition: Value.cpp:237
yarp::dev::PolyDriver
A container for a device driver.
Definition: PolyDriver.h:27
ServerInertial
inertial: Export an inertial sensor.
Definition: ServerInertial.h:115
ROS_disabled
@ ROS_disabled
Definition: yarpRosHelper.h:21
ServerInertial::calibrate
bool calibrate(int ch, double v) override
Calibrate the sensor, single channel.
Definition: ServerInertial.cpp:510
yarp::os::Searchable::check
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
ServerInertial::detachAll
bool detachAll() override
Detach the object (you must have first called attach).
Definition: ServerInertial.cpp:559
Thread.h
yarp::rosmsg::sensor_msgs::Imu::linear_acceleration
yarp::rosmsg::geometry_msgs::Vector3 linear_acceleration
Definition: Imu.h:63
rosNode
yarp::os::Node * rosNode
Definition: laserFromPointCloud.cpp:72
yarp::os::Searchable::find
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
yarp::os::Node
The Node class.
Definition: Node.h:27
yarp::os::Stamp::getCount
int getCount() const
Get the sequence number.
Definition: Stamp.cpp:32
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
ServerInertial::close
bool close() override
Close the DeviceDriver.
Definition: ServerInertial.cpp:342
ServerInertial::attachAll
bool attachAll(const yarp::dev::PolyDriverList &p) override
IMultipleWrapper interface Attach to a list of objects.
Definition: ServerInertial.cpp:548
yarp::rosmsg::geometry_msgs::Quaternion::w
yarp::conf::float64_t w
Definition: Quaternion.h:40
BufferedPort.h
ServerInertial::run
void run() override
Main body of the new thread.
Definition: ServerInertial.cpp:394
yarp::os::Bottle::isNull
bool isNull() const override
Checks if the object is invalid.
Definition: Bottle.cpp:373
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
ServerInertial::getChannels
bool getChannels(int *nc) override
Get the number of channels of the sensor.
Definition: ServerInertial.cpp:504
yarp::os::Stamp
An abstraction for a time stamp and/or sequence number.
Definition: Stamp.h:25
yCError
#define yCError(component,...)
Definition: LogComponent.h:157
yarp::rosmsg::geometry_msgs::Quaternion::z
yarp::conf::float64_t z
Definition: Quaternion.h:39
convertEulerAngleYXZdegrees_to_quaternion
bool convertEulerAngleYXZdegrees_to_quaternion(double *eulerXYZ, double *quaternion)
Definition: yarpRosHelper.h:69
yarp::os::Stamp::update
void update()
Set the timestamp to the current time, and increment the sequence number (wrapping to 0 if the sequen...
Definition: Stamp.cpp:113
yCInfo
#define yCInfo(component,...)
Definition: LogComponent.h:135
ServerInertial::open
bool open(yarp::os::Searchable &config) override
Open the device driver.
Definition: ServerInertial.cpp:274
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::rosmsg::sensor_msgs::Imu::orientation_covariance
std::vector< yarp::conf::float64_t > orientation_covariance
Definition: Imu.h:60
IGenericSensor.h
Vocab.h
yarp::os::Bottle::read
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
Definition: Bottle.cpp:243
yarp::os::Node::interrupt
void interrupt()
interrupt delegates the call to the Node port interrupt.
Definition: Node.cpp:600
Time.h
yarp::rosmsg::sensor_msgs::Imu::header
yarp::rosmsg::std_msgs::Header header
Definition: Imu.h:58
yCTrace
#define yCTrace(component,...)
Definition: LogComponent.h:88
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
ROS_config_error
@ ROS_config_error
Definition: yarpRosHelper.h:20
yarp::os::Value::asFloat64
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
Definition: Value.cpp:225
yarp::rosmsg::std_msgs::Header::stamp
yarp::rosmsg::TickTime stamp
Definition: Header.h:48
ServerInertial::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: ServerInertial.cpp:488
yarp::os::Time::delay
void delay(double seconds)
Wait for a certain number of seconds.
Definition: Time.cpp:114
Bottle.h
yarp::os::Property
A class for storing options and configuration information.
Definition: Property.h:37