YARP
Yet Another Robot Platform
IRangefinder2D.h
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 #ifndef YARP_DEV_IRANGEFINDER2D_H
10 #define YARP_DEV_IRANGEFINDER2D_H
11 
12 #include <yarp/os/Vocab.h>
13 #include <yarp/dev/api.h>
14 #include <yarp/sig/Vector.h>
16 #include <vector>
17 #include <string>
18 
25 
26 namespace yarp {
27  namespace dev {
28  class IRangefinder2D;
29  }
30 }
31 
38 {
39 public:
41  {
42  DEVICE_OK_STANBY = 0,
43  DEVICE_OK_IN_USE = 1,
44  DEVICE_GENERAL_ERROR = 2,
45  DEVICE_TIMEOUT = 3
46  };
47 
48  virtual ~IRangefinder2D();
49 
55  virtual bool getLaserMeasurement(std::vector<LaserMeasurementData> &data) = 0;
56 
62  virtual bool getRawData(yarp::sig::Vector &data) = 0;
63 
69  virtual bool getDeviceStatus(Device_status& status) = 0;
70 
77  virtual bool getDistanceRange(double& min, double& max) = 0;
78 
85  virtual bool setDistanceRange(double min, double max) = 0;
86 
93  virtual bool getScanLimits(double& min, double& max) = 0;
94 
101  virtual bool setScanLimits(double min, double max) = 0;
102 
108  virtual bool getHorizontalResolution(double& step) = 0;
109 
115  virtual bool setHorizontalResolution(double step) = 0;
116 
122  virtual bool getScanRate(double& rate) = 0;
123 
129  virtual bool setScanRate(double rate) = 0;
130 
136  virtual bool getDeviceInfo(std::string &device_info) = 0;
137 };
138 
139 #endif // YARP_DEV_IRANGEFINDER2D_H
yarp::os::createVocab
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
VOCAB_ILASER2D
constexpr yarp::conf::vocab32_t VOCAB_ILASER2D
Definition: IRangefinder2D.h:19
Vector.h
contains the definition of a Vector type
yarp::dev::IRangefinder2D::getDeviceInfo
virtual bool getDeviceInfo(std::string &device_info)=0
get the device hardware charactestics
VOCAB_LASER_SCAN_RATE
constexpr yarp::conf::vocab32_t VOCAB_LASER_SCAN_RATE
Definition: IRangefinder2D.h:24
yarp::dev::IRangefinder2D::getScanLimits
virtual bool getScanLimits(double &min, double &max)=0
get the scan angular range.
yarp::dev::IRangefinder2D::getRawData
virtual bool getRawData(yarp::sig::Vector &data)=0
Get the device measurements.
yarp::dev::IRangefinder2D
A generic interface for planar laser range finders.
Definition: IRangefinder2D.h:38
yarp::dev::IRangefinder2D::setScanLimits
virtual bool setScanLimits(double min, double max)=0
set the scan angular range.
yarp::dev::IRangefinder2D::Device_status
Device_status
Definition: IRangefinder2D.h:41
yarp::dev::IRangefinder2D::getHorizontalResolution
virtual bool getHorizontalResolution(double &step)=0
get the angular step between two measurments.
yarp::dev::IRangefinder2D::setScanRate
virtual bool setScanRate(double rate)=0
set the scan rate (scans per seconds)
LaserMeasurementData.h
yarp::sig::VectorOf< double >
yarp::dev::IRangefinder2D::getDistanceRange
virtual bool getDistanceRange(double &min, double &max)=0
get the device detection range
VOCAB_LASER_DISTANCE_RANGE
constexpr yarp::conf::vocab32_t VOCAB_LASER_DISTANCE_RANGE
Definition: IRangefinder2D.h:21
VOCAB_LASER_ANGULAR_STEP
constexpr yarp::conf::vocab32_t VOCAB_LASER_ANGULAR_STEP
Definition: IRangefinder2D.h:23
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::IRangefinder2D::getDeviceStatus
virtual bool getDeviceStatus(Device_status &status)=0
get the device status
yarp::dev::IRangefinder2D::getLaserMeasurement
virtual bool getLaserMeasurement(std::vector< LaserMeasurementData > &data)=0
Get the device measurements.
yarp::dev::IRangefinder2D::~IRangefinder2D
virtual ~IRangefinder2D()
VOCAB_DEVICE_INFO
constexpr yarp::conf::vocab32_t VOCAB_DEVICE_INFO
Definition: IRangefinder2D.h:20
yarp::dev::IRangefinder2D::setDistanceRange
virtual bool setDistanceRange(double min, double max)=0
set the device detection range.
yarp::dev::IRangefinder2D::setHorizontalResolution
virtual bool setHorizontalResolution(double step)=0
get the angular step between two measurments (if available)
VOCAB_LASER_ANGULAR_RANGE
constexpr yarp::conf::vocab32_t VOCAB_LASER_ANGULAR_RANGE
Definition: IRangefinder2D.h:22
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::conf::vocab32_t
std::int32_t vocab32_t
Definition: numeric.h:52
Vocab.h
yarp::dev::IRangefinder2D::getScanRate
virtual bool getScanRate(double &rate)=0
get the scan rate (scans per seconds)
api.h