The Lidar2DDeviceBase class. More...
#include <yarp/dev/Lidar2DDeviceBase.h>
Public Member Functions | |
bool | parseConfiguration (yarp::os::Searchable &config) |
Lidar2DDeviceBase () | |
bool | getRawData (yarp::sig::Vector &data) override |
Get the device measurements. More... | |
bool | getLaserMeasurement (std::vector< LaserMeasurementData > &data) override |
Get the device measurements. More... | |
bool | getDeviceStatus (Device_status &status) override |
get the device status More... | |
bool | getDeviceInfo (std::string &device_info) override |
get the device hardware charactestics More... | |
bool | getDistanceRange (double &min, double &max) override |
get the device detection range More... | |
bool | getScanLimits (double &min, double &max) override |
get the scan angular range. More... | |
bool | getHorizontalResolution (double &step) override |
get the angular step between two measurments. More... | |
bool | getScanRate (double &rate) override |
get the scan rate (scans per seconds) More... | |
virtual yarp::os::Stamp | getLastInputStamp () override |
Return the time stamp relative to the last acquisition. More... | |
![]() | |
virtual | ~IRangefinder2D () |
virtual bool | setDistanceRange (double min, double max)=0 |
set the device detection range. More... | |
virtual bool | setScanLimits (double min, double max)=0 |
set the scan angular range. More... | |
virtual bool | setHorizontalResolution (double step)=0 |
get the angular step between two measurments (if available) More... | |
virtual bool | setScanRate (double rate)=0 |
set the scan rate (scans per seconds) More... | |
![]() | |
virtual | ~IPreciselyTimed () |
Protected Member Functions | |
virtual bool | updateLidarData () |
This utility method calls in sequence: grabDataFromHW(), updateTimestamp and applyLimitsOnLaserData(). More... | |
virtual bool | updateTimestamp () |
By default, it automatically updates the internal timestamp with the yarp time. More... | |
virtual bool | applyLimitsOnLaserData () |
Apply the limits on the internally stored lidar measurements. More... | |
virtual bool | acquireDataFromHW ()=0 |
This method should be implemented by the user, and contain the logic to grab data from the hardware. More... | |
Protected Attributes | |
yarp::sig::Vector | m_laser_data |
yarp::os::Stamp | m_timestamp |
yarp::dev::IRangefinder2D::Device_status | m_device_status |
std::mutex | m_mutex |
std::string | m_info |
double | m_scan_rate |
size_t | m_sensorsNum |
double | m_min_angle |
double | m_max_angle |
double | m_min_distance |
double | m_max_distance |
double | m_resolution |
bool | m_clip_max_enable |
bool | m_clip_min_enable |
bool | m_do_not_clip_and_allow_infinity_enable |
std::vector< Range_t > | m_range_skip_vector |
Additional Inherited Members | |
![]() | |
enum | Device_status { DEVICE_OK_STANBY = 0 , DEVICE_OK_IN_USE = 1 , DEVICE_GENERAL_ERROR = 2 , DEVICE_TIMEOUT = 3 } |
The Lidar2DDeviceBase class.
This class has been designed to uniform the parsing of lidar yarp devices.
Definition at line 30 of file Lidar2DDeviceBase.h.
Lidar2DDeviceBase::Lidar2DDeviceBase | ( | ) |
Definition at line 92 of file Lidar2DDeviceBase.cpp.
|
protectedpure virtual |
This method should be implemented by the user, and contain the logic to grab data from the hardware.
Implemented in RpLidar2, LaserFromRosTopic, LaserFromPointCloud, LaserFromExternalPort, LaserFromDepth, and FakeLaser.
|
protectedvirtual |
Apply the limits on the internally stored lidar measurements.
Definition at line 223 of file Lidar2DDeviceBase.cpp.
|
overridevirtual |
get the device hardware charactestics
device_info | string containing the device infos |
Implements yarp::dev::IRangefinder2D.
Definition at line 67 of file Lidar2DDeviceBase.cpp.
|
overridevirtual |
get the device status
status | the device status |
Implements yarp::dev::IRangefinder2D.
Definition at line 46 of file Lidar2DDeviceBase.cpp.
|
overridevirtual |
get the device detection range
min | the minimum detection distance |
max | the maximum detection distance |
Implements yarp::dev::IRangefinder2D.
Definition at line 31 of file Lidar2DDeviceBase.cpp.
|
overridevirtual |
get the angular step between two measurments.
step | the angular step between two measurments |
Implements yarp::dev::IRangefinder2D.
Definition at line 39 of file Lidar2DDeviceBase.cpp.
|
overridevirtual |
Get the device measurements.
data | a vector containing the measurement data, expressed in cartesian/polar format |
Implements yarp::dev::IRangefinder2D.
Definition at line 74 of file Lidar2DDeviceBase.cpp.
|
overridevirtual |
Return the time stamp relative to the last acquisition.
Implements yarp::dev::IPreciselyTimed.
Definition at line 265 of file Lidar2DDeviceBase.cpp.
|
overridevirtual |
Get the device measurements.
ranges | the vector containing the raw measurement data, as acquired by the device. |
Implements yarp::dev::IRangefinder2D.
Definition at line 53 of file Lidar2DDeviceBase.cpp.
|
overridevirtual |
get the scan angular range.
min | start angle of the scan |
max | end angle of the scan |
Implements yarp::dev::IRangefinder2D.
Definition at line 23 of file Lidar2DDeviceBase.cpp.
|
overridevirtual |
get the scan rate (scans per seconds)
rate | the scan rate |
Implements yarp::dev::IRangefinder2D.
Definition at line 60 of file Lidar2DDeviceBase.cpp.
bool Lidar2DDeviceBase::parseConfiguration | ( | yarp::os::Searchable & | config | ) |
Definition at line 106 of file Lidar2DDeviceBase.cpp.
|
protectedvirtual |
This utility method calls in sequence: grabDataFromHW(), updateTimestamp and applyLimitsOnLaserData().
It is recommended that the device driver implementation calls this method to perform the aforementioned three operations.
Definition at line 272 of file Lidar2DDeviceBase.cpp.
|
protectedvirtual |
By default, it automatically updates the internal timestamp with the yarp time.
It can be redefined by the user if the timestamp source is for example the hardware device.
Definition at line 287 of file Lidar2DDeviceBase.cpp.
|
protected |
Definition at line 51 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 52 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 38 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 53 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 43 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 36 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 47 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 49 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 46 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 48 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 39 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 54 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 50 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 44 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 45 of file Lidar2DDeviceBase.h.
|
protected |
Definition at line 37 of file Lidar2DDeviceBase.h.