YARP
Yet Another Robot Platform
Rangefinder2DWrapper.cpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: LGPL-2.1-or-later
4  */
5 
6 #define _USE_MATH_DEFINES
7 
8 #include "Rangefinder2DWrapper.h"
10 #include <yarp/os/LogStream.h>
11 
12 #include <cmath>
13 #include <sstream>
14 
15 using namespace yarp::sig;
16 using namespace yarp::dev;
17 using namespace yarp::os;
18 
19 YARP_LOG_COMPONENT(RANGEFINDER2DWRAPPER, "yarp.devices.Rangefinder2DWrapper")
20 
21 
22 
28  partName("Rangefinder2DWrapper"),
29  sens_p(nullptr),
30  iTimed(nullptr),
31  _period(DEFAULT_THREAD_PERIOD),
32  minAngle(0),
33  maxAngle(0),
34  minDistance(0),
35  maxDistance(0),
36  resolution(0),
37  isDeviceOwned(false),
38  // init ROS data
39  useROS(ROS_disabled),
40  frame_id(""),
41  rosNodeName(""),
42  rosTopicName(""),
43  rosNode(nullptr),
44  rosMsgCounter(0)
45 {}
46 
48 {
49  sens_p = nullptr;
50 }
51 
52 bool Rangefinder2DWrapper::checkROSParams(yarp::os::Searchable &config)
53 {
54  // check for ROS parameter group
55  if (!config.check("ROS"))
56  {
57  useROS = ROS_disabled;
58  yCInfo(RANGEFINDER2DWRAPPER) << "No ROS group found in config file ... skipping ROS initialization.";
59  return true;
60  }
61 
62  yCInfo(RANGEFINDER2DWRAPPER) << "ROS group was FOUND in config file.";
63 
64  Bottle &rosGroup = config.findGroup("ROS");
65  if (rosGroup.isNull())
66  {
67  yCError(RANGEFINDER2DWRAPPER) << partName << "ROS group params is not a valid group or empty";
68  useROS = ROS_config_error;
69  return false;
70  }
71 
72  // check for useROS parameter
73  if (!rosGroup.check("useROS"))
74  {
75  yCError(RANGEFINDER2DWRAPPER) << partName << " cannot find useROS parameter, mandatory when using ROS message. \n \
76  Allowed values are true, false, ROS_only";
77  useROS = ROS_config_error;
78  return false;
79  }
80  std::string ros_use_type = rosGroup.find("useROS").asString();
81  if (ros_use_type == "false")
82  {
83  yCInfo(RANGEFINDER2DWRAPPER) << partName << "useROS topic if set to 'false'";
84  useROS = ROS_disabled;
85  return true;
86  }
87  else if (ros_use_type == "true")
88  {
89  yCInfo(RANGEFINDER2DWRAPPER) << partName << "useROS topic if set to 'true'";
90  useROS = ROS_enabled;
91  }
92  else if (ros_use_type == "only")
93  {
94  yCInfo(RANGEFINDER2DWRAPPER) << partName << "useROS topic if set to 'only";
95  useROS = ROS_only;
96  }
97  else
98  {
99  yCInfo(RANGEFINDER2DWRAPPER) << partName << "useROS parameter is set to invalid value ('" << ros_use_type << "'), supported values are 'true', 'false', 'only'";
100  useROS = ROS_config_error;
101  return false;
102  }
103 
104  // check for ROS_nodeName parameter
105  if (!rosGroup.check("ROS_nodeName"))
106  {
107  yCError(RANGEFINDER2DWRAPPER) << partName << " cannot find ROS_nodeName parameter, mandatory when using ROS message";
108  useROS = ROS_config_error;
109  return false;
110  }
111  rosNodeName = rosGroup.find("ROS_nodeName").asString();
112  yCInfo(RANGEFINDER2DWRAPPER) << partName << "rosNodeName is " << rosNodeName;
113  if(rosNodeName[0] != '/'){
114  yCError(RANGEFINDER2DWRAPPER) << "node name must begin with an initial /";
115  return false;
116  }
117  // check for ROS_topicName parameter
118  if (!rosGroup.check("ROS_topicName"))
119  {
120  yCError(RANGEFINDER2DWRAPPER) << partName << " cannot find ROS_topicName parameter, mandatory when using ROS message";
121  useROS = ROS_config_error;
122  return false;
123  }
124  rosTopicName = rosGroup.find("ROS_topicName").asString();
125  yCInfo(RANGEFINDER2DWRAPPER) << partName << "rosTopicName is " << rosTopicName;
126 
127  // check for frame_id parameter
128  if (!rosGroup.check("frame_id"))
129  {
130  yCError(RANGEFINDER2DWRAPPER) << partName << " cannot find frame_id parameter, mandatory when using ROS message";
131  useROS = ROS_config_error;
132  return false;
133  }
134  frame_id = rosGroup.find("frame_id").asString();
135  yCInfo(RANGEFINDER2DWRAPPER) << partName << "frame_id is " << frame_id;
136 
137  return true;
138 }
139 
140 bool Rangefinder2DWrapper::initialize_ROS()
141 {
142  bool success = false;
143  switch (useROS)
144  {
145  case ROS_enabled:
146  case ROS_only:
147  {
148  rosNode = new yarp::os::Node(rosNodeName); // add a ROS node
149  if (rosNode == nullptr)
150  {
151  yCError(RANGEFINDER2DWRAPPER) << " opening " << rosNodeName << " Node, check your yarp-ROS network configuration\n";
152  success = false;
153  break;
154  }
155  if (!rosPublisherPort.topic(rosTopicName))
156  {
157  yCError(RANGEFINDER2DWRAPPER) << " opening " << rosTopicName << " Topic, check your yarp-ROS network configuration\n";
158  success = false;
159  break;
160  }
161  success = true;
162  } break;
163 
164  case ROS_disabled:
165  {
166  yCInfo(RANGEFINDER2DWRAPPER) << partName << ": no ROS initialization required";
167  success = true;
168  } break;
169 
170  case ROS_config_error:
171  {
172  yCError(RANGEFINDER2DWRAPPER) << partName << " ROS parameter are not correct, check your configuration file";
173  success = false;
174  } break;
175 
176  default:
177  {
178  yCError(RANGEFINDER2DWRAPPER) << partName << " something went wrong with ROS configuration, we should never be here!!!";
179  success = false;
180  } break;
181  }
182  return success;
183 }
184 
190 {
191  if (device2attach.size() != 1)
192  {
193  yCError(RANGEFINDER2DWRAPPER, "Rangefinder2DWrapper: cannot attach more than one device");
194  return false;
195  }
196 
197  yarp::dev::PolyDriver * Idevice2attach = device2attach[0]->poly;
198 
199  if (Idevice2attach->isValid())
200  {
201  Idevice2attach->view(sens_p);
202  Idevice2attach->view(iTimed);
203  }
204 
205  if (nullptr == sens_p)
206  {
207  yCError(RANGEFINDER2DWRAPPER, "Rangefinder2DWrapper: subdevice passed to attach method is invalid");
208  return false;
209  }
210  attach(sens_p);
211 
212  if(!sens_p->getDistanceRange(minDistance, maxDistance))
213  {
214  yCError(RANGEFINDER2DWRAPPER) << "Laser device does not provide min & max distance range.";
215  return false;
216  }
217 
218  if(!sens_p->getScanLimits(minAngle, maxAngle))
219  {
220  yCError(RANGEFINDER2DWRAPPER) << "Laser device does not provide min & max angle scan range.";
221  return false;
222  }
223 
224  if (!sens_p->getHorizontalResolution(resolution))
225  {
226  yCError(RANGEFINDER2DWRAPPER) << "Laser device does not provide horizontal resolution ";
227  return false;
228  }
229 
230  PeriodicThread::setPeriod(_period);
231  return PeriodicThread::start();
232 }
233 
235 {
236  if (PeriodicThread::isRunning())
237  {
238  PeriodicThread::stop();
239  }
240  sens_p = nullptr;
241  return true;
242 }
243 
245 {
246  sens_p = s;
247 }
248 
250 {
251  if (PeriodicThread::isRunning())
252  {
253  PeriodicThread::stop();
254  }
255  sens_p = nullptr;
256 }
257 
258 bool Rangefinder2DWrapper::read(yarp::os::ConnectionReader& connection)
259 {
260  yarp::os::Bottle in;
261  yarp::os::Bottle out;
262  bool ok = in.read(connection);
263  if (!ok) {
264  return false;
265  }
266 
267  // parse in, prepare out
268  int action = in.get(0).asVocab32();
269  int inter = in.get(1).asVocab32();
270  bool ret = false;
271 
272  if (inter == VOCAB_ILASER2D)
273  {
274  if (action == VOCAB_GET)
275  {
276  int cmd = in.get(2).asVocab32();
277  if (cmd == VOCAB_DEVICE_INFO)
278  {
279  if (sens_p)
280  {
281  std::string info;
282  if (sens_p->getDeviceInfo(info))
283  {
284  out.addVocab32(VOCAB_IS);
285  out.addVocab32(cmd);
286  out.addString(info);
287  ret = true;
288  }
289  else
290  {
291  ret = false;
292  }
293  }
294  }
295  else if (cmd == VOCAB_LASER_DISTANCE_RANGE)
296  {
297  if (sens_p)
298  {
299  double max = 0;
300  double min = 0;
301  if (sens_p->getDistanceRange(min, max))
302  {
303  out.addVocab32(VOCAB_IS);
304  out.addVocab32(cmd);
305  out.addFloat64(min);
306  out.addFloat64(max);
307  ret = true;
308  }
309  else
310  {
311  ret = false;
312  }
313  }
314  }
315  else if (cmd == VOCAB_LASER_ANGULAR_RANGE)
316  {
317  if (sens_p)
318  {
319  double max = 0;
320  double min = 0;
321  if (sens_p->getScanLimits(min, max))
322  {
323  out.addVocab32(VOCAB_IS);
324  out.addVocab32(cmd);
325  out.addFloat64(min);
326  out.addFloat64(max);
327  ret = true;
328  }
329  else
330  {
331  ret = false;
332  }
333  }
334  }
335  else if (cmd == VOCAB_LASER_ANGULAR_STEP)
336  {
337  if (sens_p)
338  {
339  double step = 0;
340  if (sens_p->getHorizontalResolution(step))
341  {
342  out.addVocab32(VOCAB_IS);
343  out.addVocab32(cmd);
344  out.addFloat64(step);
345  ret = true;
346  }
347  else
348  {
349  ret = false;
350  }
351  }
352  }
353  else if (cmd == VOCAB_LASER_SCAN_RATE)
354  {
355  if (sens_p)
356  {
357  double rate = 0;
358  if (sens_p->getScanRate(rate))
359  {
360  out.addVocab32(VOCAB_IS);
361  out.addVocab32(cmd);
362  out.addFloat64(rate);
363  ret = true;
364  }
365  else
366  {
367  ret = false;
368  }
369  }
370  }
371  else
372  {
373  yCError(RANGEFINDER2DWRAPPER, "Invalid command received in Rangefinder2DWrapper");
374  }
375  }
376  else if (action == VOCAB_SET)
377  {
378  int cmd = in.get(2).asVocab32();
379  if (cmd == VOCAB_LASER_DISTANCE_RANGE)
380  {
381  if (sens_p)
382  {
383  double min = in.get(3).asInt32();
384  double max = in.get(4).asInt32();
385  sens_p->setDistanceRange(min, max);
386  ret = true;
387  }
388  }
389  else if (cmd == VOCAB_LASER_ANGULAR_RANGE)
390  {
391  if (sens_p)
392  {
393  double min = in.get(3).asInt32();
394  double max = in.get(4).asInt32();
395  sens_p->setScanLimits(min, max);
396  ret = true;
397  }
398  }
399  else if (cmd == VOCAB_LASER_SCAN_RATE)
400  {
401  if (sens_p)
402  {
403  double rate = in.get(3).asInt32();
404  sens_p->setScanRate(rate);
405  ret = true;
406  }
407  }
408  else if (cmd == VOCAB_LASER_ANGULAR_STEP)
409  {
410  if (sens_p)
411  {
412  double step = in.get(3).asFloat64();
413  sens_p->setHorizontalResolution(step);
414  ret = true;
415  }
416  }
417  else
418  {
419  yCError(RANGEFINDER2DWRAPPER, "Invalid command received in Rangefinder2DWrapper");
420  }
421  }
422  else
423  {
424  yCError(RANGEFINDER2DWRAPPER, "Invalid action received in Rangefinder2DWrapper");
425  }
426  }
427  else
428  {
429  yCError(RANGEFINDER2DWRAPPER, "Invalid interface vocab received in Rangefinder2DWrapper");
430  }
431 
432  if (!ret)
433  {
434  out.clear();
436  }
437 
438  yarp::os::ConnectionWriter *returnToSender = connection.getWriter();
439  if (returnToSender != nullptr) {
440  out.write(*returnToSender);
441  }
442  return true;
443 }
444 
446 {
447  return true;
448 }
449 
450 void Rangefinder2DWrapper::setId(const std::string &id)
451 {
452  sensorId=id;
453 }
454 
456 {
457  return sensorId;
458 }
459 
460 
462 {
463  yCWarning(RANGEFINDER2DWRAPPER) << "The 'Rangefinder2DWrapper' device is deprecated in favour of 'rangefinder2D_nws_yarp'.";
464  yCWarning(RANGEFINDER2DWRAPPER) << "The old device is no longer supported, and it will be deprecated in YARP 3.6 and removed in YARP 4.";
465  yCWarning(RANGEFINDER2DWRAPPER) << "Please update your scripts.";
466 
467  Property params;
468  params.fromString(config.toString());
469 
470  if (!config.check("period"))
471  {
472  yCError(RANGEFINDER2DWRAPPER) << "Rangefinder2DWrapper: missing 'period' parameter. Check you configuration file\n";
473  return false;
474  } else {
475  _period = config.find("period").asInt32() / 1000.0;
476  }
477 
478  if (!config.check("name"))
479  {
480  yCError(RANGEFINDER2DWRAPPER) << "Rangefinder2DWrapper: missing 'name' parameter. Check you configuration file; it must be like:";
481  yCError(RANGEFINDER2DWRAPPER) << " name: full name of the port, like /robotName/deviceId/sensorType:o";
482  return false;
483  }
484  else
485  {
486  streamingPortName = config.find("name").asString();
487  rpcPortName = streamingPortName + "/rpc:i";
488  setId("Rangefinder2DWrapper");
489  }
490 
491  checkROSParams(config);
492 
493  if(!initialize_YARP(config) )
494  {
495  yCError(RANGEFINDER2DWRAPPER) << sensorId << "Error initializing YARP ports";
496  return false;
497  }
498 
499 
500  // call ROS node/topic initialization, if needed
501  if (!initialize_ROS())
502  {
503  return false;
504  }
505 
506  if(config.check("subdevice"))
507  {
508  Property p;
509  PolyDriverList driverlist;
510  p.fromString(config.toString(), false);
511  p.put("device", config.find("subdevice").asString());
512 
513  if(!driver.open(p) || !driver.isValid())
514  {
515  yCError(RANGEFINDER2DWRAPPER) << "RangeFinder2DWrapper: failed to open subdevice.. check params";
516  return false;
517  }
518 
519  driverlist.push(&driver, "1");
520  if(!attachAll(driverlist))
521  {
522  yCError(RANGEFINDER2DWRAPPER) << "RangeFinder2DWrapper: failed to open subdevice.. check params";
523  return false;
524  }
525  isDeviceOwned = true;
526  }
527  return true;
528 }
529 
530 bool Rangefinder2DWrapper::initialize_YARP(yarp::os::Searchable &params)
531 {
532  if(useROS != ROS_only)
533  {
534  if (!streamingPort.open(streamingPortName))
535  {
536  yCError(RANGEFINDER2DWRAPPER, "Rangefinder2DWrapper: failed to open port %s", streamingPortName.c_str());
537  return false;
538  }
539  if (!rpcPort.open(rpcPortName))
540  {
541  yCError(RANGEFINDER2DWRAPPER, "Rangefinder2DWrapper: failed to open port %s", rpcPortName.c_str());
542  return false;
543  }
544  rpcPort.setReader(*this);
545  }
546  return true;
547 }
548 
550 {
551  streamingPort.interrupt();
552  streamingPort.close();
553  rpcPort.interrupt();
554  rpcPort.close();
555 }
556 
558 {
559  if (sens_p!=nullptr)
560  {
561  bool ret = true;
563  yarp::sig::Vector ranges;
564  ret &= sens_p->getRawData(ranges);
565  ret &= sens_p->getDeviceStatus(status);
566 
567  if (ret)
568  {
569  if (iTimed) {
570  lastStateStamp = iTimed->getLastInputStamp();
571  } else {
572  lastStateStamp.update(yarp::os::Time::now());
573  }
574 
575  int ranges_size = ranges.size();
576 
577  yarp::dev::LaserScan2D& b = streamingPort.prepare();
578  //b.clear();
579  b.scans=ranges;
580  b.angle_min= minAngle;
581  b.angle_max= maxAngle;
582  b.range_min= minDistance;
583  b.range_max= maxDistance;
584  b.status=status;
585  streamingPort.setEnvelope(lastStateStamp);
586  streamingPort.write();
587 
588  // publish ROS topic if required
589  if (useROS != ROS_disabled)
590  {
591  yarp::rosmsg::sensor_msgs::LaserScan &rosData = rosPublisherPort.prepare();
592  rosData.header.seq = rosMsgCounter++;
593  rosData.header.stamp = lastStateStamp.getTime();
594  rosData.header.frame_id = frame_id;
595 
596  rosData.angle_min = minAngle * M_PI / 180.0;
597  rosData.angle_max = maxAngle * M_PI / 180.0;
598  rosData.angle_increment = resolution * M_PI / 180.0;
599  rosData.time_increment = 0; // all points in a single scan are considered took at the very same time
600  rosData.scan_time = getPeriod(); // time elapsed between two successive readings
601  rosData.range_min = minDistance;
602  rosData.range_max = maxDistance;
603  rosData.ranges.resize(ranges_size);
604  rosData.intensities.resize(ranges_size);
605 
606  for (int i = 0; i < ranges_size; i++)
607  {
608  // in yarp, NaN is used when a scan value is missing. For example when the angular range of the rangefinder is smaller than 360.
609  // is ros, NaN is not used. Hence this check replaces NaN with inf.
610  if (std::isnan(ranges[i]))
611  {
612  rosData.ranges[i] = std::numeric_limits<double>::infinity();
613  rosData.intensities[i] = 0.0;
614  }
615  else
616  {
617  rosData.ranges[i] = ranges[i];
618  rosData.intensities[i] = 0.0;
619  }
620  }
621  rosPublisherPort.write();
622  }
623  }
624  else
625  {
626  yCError(RANGEFINDER2DWRAPPER, "Rangefinder2DWrapper: %s: Sensor returned error", sensorId.c_str());
627  }
628  }
629 }
630 
632 {
633  yCTrace(RANGEFINDER2DWRAPPER, "Rangefinder2DWrapper::Close");
634  if (PeriodicThread::isRunning())
635  {
636  PeriodicThread::stop();
637  }
638  if(rosNode!=nullptr) {
639  rosNode->interrupt();
640  delete rosNode;
641  rosNode = nullptr;
642  }
643 
644  detachAll();
645  return true;
646 }
define control board standard interfaces
constexpr yarp::conf::vocab32_t VOCAB_IS
Definition: GenericVocabs.h:14
constexpr yarp::conf::vocab32_t VOCAB_GET
Definition: GenericVocabs.h:13
constexpr yarp::conf::vocab32_t VOCAB_FAILED
Definition: GenericVocabs.h:16
constexpr yarp::conf::vocab32_t VOCAB_SET
Definition: GenericVocabs.h:12
constexpr yarp::conf::vocab32_t VOCAB_LASER_ANGULAR_RANGE
constexpr yarp::conf::vocab32_t VOCAB_LASER_SCAN_RATE
constexpr yarp::conf::vocab32_t VOCAB_ILASER2D
constexpr yarp::conf::vocab32_t VOCAB_LASER_DISTANCE_RANGE
constexpr yarp::conf::vocab32_t VOCAB_DEVICE_INFO
constexpr yarp::conf::vocab32_t VOCAB_LASER_ANGULAR_STEP
bool ret
constexpr double DEFAULT_THREAD_PERIOD
const yarp::os::LogComponent & RANGEFINDER2DWRAPPER()
Rangefinder2DWrapper deprecated: Documentation to be added
bool detachAll() override
Detach the object (you must have first called attach).
bool close() override
Close the DeviceDriver.
void setId(const std::string &id)
bool attachAll(const yarp::dev::PolyDriverList &p) override
Specify which sensor this thread has to read from.
bool open(yarp::os::Searchable &params) override
Open the DeviceDriver.
bool threadInit() override
Initialization method.
void attach(yarp::dev::IRangefinder2D *s)
void threadRelease() override
Release method.
void run() override
Loop function.
bool view(T *&x)
Get an interface to the device driver.
Definition: DeviceDriver.h:74
A generic interface for planar laser range finders.
yarp::sig::Vector scans
the scan data, measured in [m].
Definition: LaserScan2D.h:47
std::int32_t status
Definition: LaserScan2D.h:48
double angle_min
first angle of the scan [deg]
Definition: LaserScan2D.h:31
double angle_max
last angle of the scan [deg]
Definition: LaserScan2D.h:35
double range_min
the minimum distance of the scan [m]
Definition: LaserScan2D.h:39
double range_max
the maximum distance of the scan [m]
Definition: LaserScan2D.h:43
void push(PolyDriver *p, const char *k)
A container for a device driver.
Definition: PolyDriver.h:24
bool isValid() const
Check if device is valid.
Definition: PolyDriver.cpp:196
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:74
void addVocab32(yarp::conf::vocab32_t x)
Places a vocabulary item in the bottle, at the end of the list.
Definition: Bottle.cpp:164
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
Definition: Bottle.cpp:240
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:158
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
Definition: Bottle.cpp:246
bool check(const std::string &key) const override
Check if there exists a property of the given name.
Definition: Bottle.cpp:277
void clear()
Empties the bottle of any objects it contains.
Definition: Bottle.cpp:121
bool write(ConnectionWriter &writer) const override
Output a representation of the bottle to a network connection.
Definition: Bottle.cpp:230
bool isNull() const override
Checks if the object is invalid.
Definition: Bottle.cpp:370
void addString(const char *str)
Places a string in the bottle, at the end of the list.
Definition: Bottle.cpp:170
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
Definition: Bottle.cpp:287
An interface for reading from a network connection.
virtual ConnectionWriter * getWriter()=0
Gets a way to reply to the message, if possible.
An interface for writing to a network connection.
The Node class.
Definition: Node.h:24
void interrupt()
interrupt delegates the call to the Node port interrupt.
Definition: Node.cpp:597
An abstraction for a periodic thread.
A class for storing options and configuration information.
Definition: Property.h:34
void fromString(const std::string &txt, bool wipe=true)
Interprets a string as a list of properties.
Definition: Property.cpp:1063
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
Definition: Property.cpp:1015
A base class for nested structures that can be searched.
Definition: Searchable.h:66
virtual Value & find(const std::string &key) const =0
Gets a value corresponding to a given keyword.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
virtual Bottle & findGroup(const std::string &key) const =0
Gets a list corresponding to a given keyword.
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
Definition: Value.cpp:222
virtual yarp::conf::vocab32_t asVocab32() const
Get vocabulary identifier as an integer.
Definition: Value.cpp:228
virtual std::int32_t asInt32() const
Get 32-bit integer value.
Definition: Value.cpp:204
virtual std::string asString() const
Get string value.
Definition: Value.cpp:234
yarp::conf::float32_t range_min
Definition: LaserScan.h:64
yarp::conf::float32_t scan_time
Definition: LaserScan.h:63
yarp::conf::float32_t angle_min
Definition: LaserScan.h:59
yarp::conf::float32_t angle_increment
Definition: LaserScan.h:61
std::vector< yarp::conf::float32_t > intensities
Definition: LaserScan.h:67
std::vector< yarp::conf::float32_t > ranges
Definition: LaserScan.h:66
yarp::rosmsg::std_msgs::Header header
Definition: LaserScan.h:58
yarp::conf::float32_t time_increment
Definition: LaserScan.h:62
yarp::conf::float32_t range_max
Definition: LaserScan.h:65
yarp::conf::float32_t angle_max
Definition: LaserScan.h:60
yarp::rosmsg::TickTime stamp
Definition: Header.h:45
size_t size() const
Definition: Vector.h:323
#define M_PI
yarp::os::Node * rosNode
#define yCInfo(component,...)
Definition: LogComponent.h:132
#define yCError(component,...)
Definition: LogComponent.h:154
#define yCTrace(component,...)
Definition: LogComponent.h:85
#define yCWarning(component,...)
Definition: LogComponent.h:143
#define YARP_LOG_COMPONENT(name,...)
Definition: LogComponent.h:77
An interface for the device drivers.
double now()
Return the current time in seconds, relative to an arbitrary starting point.
Definition: Time.cpp:121
An interface to the operating system, including Port based communication.
Signal processing.
Definition: Image.h:22
@ ROS_only
Definition: yarpRosHelper.h:20
@ ROS_config_error
Definition: yarpRosHelper.h:17
@ ROS_enabled
Definition: yarpRosHelper.h:19
@ ROS_disabled
Definition: yarpRosHelper.h:18