YARP
Yet Another Robot Platform
IRangefinder2D.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef YARP_DEV_IRANGEFINDER2D_H
7 #define YARP_DEV_IRANGEFINDER2D_H
8 
9 #include <yarp/os/Vocab.h>
10 #include <yarp/dev/api.h>
11 #include <yarp/sig/Vector.h>
13 #include <vector>
14 #include <string>
15 
22 
23 namespace yarp {
24  namespace dev {
25  class IRangefinder2D;
26  }
27 }
28 
35 {
36 public:
38  {
39  DEVICE_OK_STANBY = 0,
40  DEVICE_OK_IN_USE = 1,
41  DEVICE_GENERAL_ERROR = 2,
42  DEVICE_TIMEOUT = 3
43  };
44 
45  virtual ~IRangefinder2D();
46 
52  virtual bool getLaserMeasurement(std::vector<LaserMeasurementData> &data) = 0;
53 
59  virtual bool getRawData(yarp::sig::Vector &data) = 0;
60 
66  virtual bool getDeviceStatus(Device_status& status) = 0;
67 
74  virtual bool getDistanceRange(double& min, double& max) = 0;
75 
82  virtual bool setDistanceRange(double min, double max) = 0;
83 
90  virtual bool getScanLimits(double& min, double& max) = 0;
91 
98  virtual bool setScanLimits(double min, double max) = 0;
99 
105  virtual bool getHorizontalResolution(double& step) = 0;
106 
112  virtual bool setHorizontalResolution(double step) = 0;
113 
119  virtual bool getScanRate(double& rate) = 0;
120 
126  virtual bool setScanRate(double rate) = 0;
127 
133  virtual bool getDeviceInfo(std::string &device_info) = 0;
134 };
135 
136 #endif // YARP_DEV_IRANGEFINDER2D_H
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
contains the definition of a Vector type
A generic interface for planar laser range finders.
virtual bool setScanLimits(double min, double max)=0
set the scan angular range.
virtual bool setScanRate(double rate)=0
set the scan rate (scans per seconds)
virtual bool getDistanceRange(double &min, double &max)=0
get the device detection range
virtual bool getLaserMeasurement(std::vector< LaserMeasurementData > &data)=0
Get the device measurements.
virtual bool setHorizontalResolution(double step)=0
get the angular step between two measurments (if available)
virtual bool setDistanceRange(double min, double max)=0
set the device detection range.
virtual bool getDeviceInfo(std::string &device_info)=0
get the device hardware charactestics
virtual bool getScanRate(double &rate)=0
get the scan rate (scans per seconds)
virtual bool getScanLimits(double &min, double &max)=0
get the scan angular range.
virtual bool getHorizontalResolution(double &step)=0
get the angular step between two measurments.
virtual bool getRawData(yarp::sig::Vector &data)=0
Get the device measurements.
virtual bool getDeviceStatus(Device_status &status)=0
get the device status
std::int32_t vocab32_t
Definition: numeric.h:78
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.
Definition: Vocab.h:28
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18