YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
Rangefinder2DTransformer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024-2024 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6#ifndef YARP_DEV_RANGEFINDER2DTRANSFORMER
7#define YARP_DEV_RANGEFINDER2DTRANSFORMER
8
9
10#include <yarp/os/Network.h>
11#include <yarp/os/Stamp.h>
17#include <yarp/sig/Vector.h>
18#include <yarp/os/Time.h>
19#include <yarp/dev/PolyDriver.h>
21
23#include <mutex>
24
25
26#define DEFAULT_THREAD_PERIOD 20 //ms
27const int LASER_TIMEOUT=100; //ms
28
44{
45protected:
46 // interfaces
48
49 //data
50 double m_scan_angle_min = std::nan("1");
51 double m_scan_angle_max = std::nan("1");
52
53public:
54
55 /* DevideDriver methods */
56 bool open(yarp::os::Searchable& config) override;
57 bool close() override;
58
59 /* IRangefinder2D methods */
60 yarp::dev::ReturnValue getLaserMeasurement(std::vector<yarp::sig::LaserMeasurementData> &data, double* timestamp = nullptr) override;
61 yarp::dev::ReturnValue getRawData(yarp::sig::Vector &data, double* timestamp = nullptr) override;
63 yarp::dev::ReturnValue getDistanceRange(double& min, double& max) override;
64 yarp::dev::ReturnValue setDistanceRange(double min, double max) override;
65 yarp::dev::ReturnValue getScanLimits(double& min, double& max) override;
66 yarp::dev::ReturnValue setScanLimits(double min, double max) override;
69 yarp::dev::ReturnValue getScanRate(double& rate) override;
70 yarp::dev::ReturnValue setScanRate(double rate) override;
71 yarp::dev::ReturnValue getDeviceInfo(std::string &device_info) override;
72
73 /* WrapperSingle methods */
74 bool attach(yarp::dev::PolyDriver* driver) override;
75 bool detach() override;
76};
77
78#endif // YARP_DEV_RANGEFINDER2DCLIENT_RANGEFINDER2DCLIENT_H
define control board standard interfaces
const int LASER_TIMEOUT
contains the definition of a Vector type
This class is the parameters parser for class Rangefinder2DTransformer.
Rangefinder2DTransformer: A device which acts a virtual laser, it attaches to another lidar,...
bool attach(yarp::dev::PolyDriver *driver) override
Attach to another object.
yarp::dev::ReturnValue setDistanceRange(double min, double max) override
set the device detection range.
bool close() override
Close the DeviceDriver.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::dev::IRangefinder2D * sens_p
yarp::dev::ReturnValue getDistanceRange(double &min, double &max) override
get the device detection range
bool detach() override
Detach the object (you must have first called attach).
yarp::dev::ReturnValue getLaserMeasurement(std::vector< yarp::sig::LaserMeasurementData > &data, double *timestamp=nullptr) override
Get the device measurements.
yarp::dev::ReturnValue getHorizontalResolution(double &step) override
get the angular step between two measurements.
yarp::dev::ReturnValue setScanRate(double rate) override
set the scan rate (scans per seconds)
yarp::dev::ReturnValue getRawData(yarp::sig::Vector &data, double *timestamp=nullptr) override
Get the device measurements.
yarp::dev::ReturnValue setScanLimits(double min, double max) override
set the scan angular range.
yarp::dev::ReturnValue getScanRate(double &rate) override
get the scan rate (scans per seconds)
yarp::dev::ReturnValue getDeviceStatus(Device_status &status) override
get the device status
yarp::dev::ReturnValue getScanLimits(double &min, double &max) override
get the scan angular range.
yarp::dev::ReturnValue getDeviceInfo(std::string &device_info) override
get the device hardware characteristics
yarp::dev::ReturnValue setHorizontalResolution(double step) override
get the angular step between two measurements (if available)
Interface implemented by all device drivers.
A generic interface for planar laser range finders.
A container for a device driver.
Definition PolyDriver.h:23
Helper interface for an object that can wrap/or "attach" to a single other device.
A base class for nested structures that can be searched.
Definition Searchable.h:31