YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches

Rangefinder2DTransformer: A device which acts a virtual laser, it attaches to another lidar, which provides a stream a measurements, and reclocates them in the space. More...

#include <Rangefinder2DTransformer/Rangefinder2DTransformer.h>

+ Inheritance diagram for Rangefinder2DTransformer:

Public Member Functions

bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver.
 
bool close () override
 Close the DeviceDriver.
 
bool getLaserMeasurement (std::vector< yarp::sig::LaserMeasurementData > &data, double *timestamp=nullptr) override
 Get the device measurements.
 
bool getRawData (yarp::sig::Vector &data, double *timestamp=nullptr) override
 Get the device measurements.
 
bool getDeviceStatus (Device_status &status) override
 get the device status
 
bool getDistanceRange (double &min, double &max) override
 get the device detection range
 
bool setDistanceRange (double min, double max) override
 set the device detection range.
 
bool getScanLimits (double &min, double &max) override
 get the scan angular range.
 
bool setScanLimits (double min, double max) override
 set the scan angular range.
 
bool getHorizontalResolution (double &step) override
 get the angular step between two measurements.
 
bool setHorizontalResolution (double step) override
 get the angular step between two measurements (if available)
 
bool getScanRate (double &rate) override
 get the scan rate (scans per seconds)
 
bool setScanRate (double rate) override
 set the scan rate (scans per seconds)
 
bool getDeviceInfo (std::string &device_info) override
 get the device hardware characteristics
 
bool attach (yarp::dev::PolyDriver *driver) override
 Attach to another object.
 
bool detach () override
 Detach the object (you must have first called attach).
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 DeviceDriver ()
 
 DeviceDriver (const DeviceDriver &other)=delete
 
 DeviceDriver (DeviceDriver &&other) noexcept=delete
 
DeviceDriveroperator= (const DeviceDriver &other)=delete
 
DeviceDriveroperator= (DeviceDriver &&other) noexcept=delete
 
virtual ~DeviceDriver ()
 
virtual std::string id () const
 Return the id assigned to the PolyDriver.
 
virtual void setId (const std::string &id)
 Set the id for this device.
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver.
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others.
 
- Public Member Functions inherited from yarp::dev::IRangefinder2D
virtual ~IRangefinder2D ()
 
- Public Member Functions inherited from yarp::dev::WrapperSingle
 ~WrapperSingle () override
 Destructor.
 
bool attachAll (const yarp::dev::PolyDriverList &drivers) final
 Attach to a list of objects.
 
bool detachAll () final
 Detach the object (you must have first called attach).
 
- Public Member Functions inherited from yarp::dev::IWrapper
virtual ~IWrapper ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::IMultipleWrapper
virtual ~IMultipleWrapper ()
 Destructor.
 
- Public Member Functions inherited from Rangefinder2DTransformer_ParamsParser
 Rangefinder2DTransformer_ParamsParser ()
 
 ~Rangefinder2DTransformer_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
std::string getDocumentationOfDeviceParams () const override
 Get the documentation of the DeviceDriver's parameters.
 
std::vector< std::string > getListOfParams () const override
 Return a list of all params used by the device.
 
std::string getDocumentationOfRangefinder2DTransformer () const
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Protected Attributes

yarp::dev::IRangefinder2Dsens_p =nullptr
 
double m_scan_angle_min = std::nan("1")
 
double m_scan_angle_max = std::nan("1")
 

Additional Inherited Members

- Public Types inherited from yarp::dev::IRangefinder2D
enum  Device_status {
  DEVICE_OK_STANDBY = 0 ,
  DEVICE_OK_IN_USE = 1 ,
  DEVICE_GENERAL_ERROR = 2 ,
  DEVICE_TIMEOUT = 3
}
 
- Public Attributes inherited from Rangefinder2DTransformer_ParamsParser
const std::string m_device_classname = {"Rangefinder2DTransformer"}
 
const std::string m_device_name = {"rangefinder2DTransformer"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
const std::string m_device_position_x_defaultValue = {"0"}
 
const std::string m_device_position_y_defaultValue = {"0"}
 
const std::string m_device_position_theta_defaultValue = {"0"}
 
const std::string m_laser_frame_name_defaultValue = {""}
 
const std::string m_robot_frame_name_defaultValue = {""}
 
double m_device_position_x = {0}
 
double m_device_position_y = {0}
 
double m_device_position_theta = {0}
 
std::string m_laser_frame_name = {}
 
std::string m_robot_frame_name = {}
 

Detailed Description

Rangefinder2DTransformer: A device which acts a virtual laser, it attaches to another lidar, which provides a stream a measurements, and reclocates them in the space.

The new origin can be specified both manually, as a 2D point in space, or though a tranform.

Parameters required by this device are shown in class: Rangefinder2DTransformer_ParamsParser

Definition at line 39 of file Rangefinder2DTransformer.h.

Member Function Documentation

◆ attach()

bool Rangefinder2DTransformer::attach ( yarp::dev::PolyDriver driver)
overridevirtual

Attach to another object.

Parameters
driverthe polydriver that you want to attach to.
Returns
true/false on success failure.

Implements yarp::dev::IWrapper.

Definition at line 194 of file Rangefinder2DTransformer.cpp.

◆ close()

bool Rangefinder2DTransformer::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 84 of file Rangefinder2DTransformer.cpp.

◆ detach()

bool Rangefinder2DTransformer::detach ( )
overridevirtual

Detach the object (you must have first called attach).

Returns
true/false on success failure.

Implements yarp::dev::IWrapper.

Definition at line 214 of file Rangefinder2DTransformer.cpp.

◆ getDeviceInfo()

bool Rangefinder2DTransformer::getDeviceInfo ( std::string &  device_info)
overridevirtual

get the device hardware characteristics

Parameters
device_infostring containing the device infos
Returns
true/false.

Implements yarp::dev::IRangefinder2D.

Definition at line 189 of file Rangefinder2DTransformer.cpp.

◆ getDeviceStatus()

bool Rangefinder2DTransformer::getDeviceStatus ( Device_status status)
overridevirtual

get the device status

Parameters
statusthe device status
Returns
true/false.

Implements yarp::dev::IRangefinder2D.

Definition at line 184 of file Rangefinder2DTransformer.cpp.

◆ getDistanceRange()

bool Rangefinder2DTransformer::getDistanceRange ( double min,
double max 
)
overridevirtual

get the device detection range

Parameters
minthe minimum detection distance
maxthe maximum detection distance
Returns
true/false.

Implements yarp::dev::IRangefinder2D.

Definition at line 144 of file Rangefinder2DTransformer.cpp.

◆ getHorizontalResolution()

bool Rangefinder2DTransformer::getHorizontalResolution ( double step)
overridevirtual

get the angular step between two measurements.

Parameters
stepthe angular step between two measurements
Returns
true/false.

Implements yarp::dev::IRangefinder2D.

Definition at line 164 of file Rangefinder2DTransformer.cpp.

◆ getLaserMeasurement()

bool Rangefinder2DTransformer::getLaserMeasurement ( std::vector< yarp::sig::LaserMeasurementData > &  data,
double timestamp = nullptr 
)
overridevirtual

Get the device measurements.

Parameters
dataa vector containing the measurement data, expressed in Cartesian/polar format
timestampthe timestamp of the retrieved data.
Returns
true/false

Implements yarp::dev::IRangefinder2D.

Definition at line 106 of file Rangefinder2DTransformer.cpp.

◆ getRawData()

bool Rangefinder2DTransformer::getRawData ( yarp::sig::Vector data,
double timestamp = nullptr 
)
overridevirtual

Get the device measurements.

Parameters
rangesthe vector containing the raw measurement data, as acquired by the device.
timestampthe timestamp of the retrieved data.
Returns
true/false.

Implements yarp::dev::IRangefinder2D.

Definition at line 89 of file Rangefinder2DTransformer.cpp.

◆ getScanLimits()

bool Rangefinder2DTransformer::getScanLimits ( double min,
double max 
)
overridevirtual

get the scan angular range.

Parameters
minstart angle of the scan
maxend angle of the scan
Returns
true/false.

Implements yarp::dev::IRangefinder2D.

Definition at line 154 of file Rangefinder2DTransformer.cpp.

◆ getScanRate()

bool Rangefinder2DTransformer::getScanRate ( double rate)
overridevirtual

get the scan rate (scans per seconds)

Parameters
ratethe scan rate
Returns
true/false.

Implements yarp::dev::IRangefinder2D.

Definition at line 174 of file Rangefinder2DTransformer.cpp.

◆ open()

bool Rangefinder2DTransformer::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 31 of file Rangefinder2DTransformer.cpp.

◆ setDistanceRange()

bool Rangefinder2DTransformer::setDistanceRange ( double  min,
double  max 
)
overridevirtual

set the device detection range.

Invalid setting will be discarded.

Parameters
minthe minimum detection distance
maxthe maximum detection distance
Returns
true/false on success/failure.

Implements yarp::dev::IRangefinder2D.

Definition at line 149 of file Rangefinder2DTransformer.cpp.

◆ setHorizontalResolution()

bool Rangefinder2DTransformer::setHorizontalResolution ( double  step)
overridevirtual

get the angular step between two measurements (if available)

Parameters
stepthe angular step between two measurements
Returns
true/false on success/failure.

Implements yarp::dev::IRangefinder2D.

Definition at line 169 of file Rangefinder2DTransformer.cpp.

◆ setScanLimits()

bool Rangefinder2DTransformer::setScanLimits ( double  min,
double  max 
)
overridevirtual

set the scan angular range.

Parameters
minstart angle of the scan
maxend angle of the scan
Returns
true/false on success/failure.

Implements yarp::dev::IRangefinder2D.

Definition at line 159 of file Rangefinder2DTransformer.cpp.

◆ setScanRate()

bool Rangefinder2DTransformer::setScanRate ( double  rate)
overridevirtual

set the scan rate (scans per seconds)

Parameters
ratethe scan rate
Returns
true/false on success/failure.

Implements yarp::dev::IRangefinder2D.

Definition at line 179 of file Rangefinder2DTransformer.cpp.

Member Data Documentation

◆ m_scan_angle_max

double Rangefinder2DTransformer::m_scan_angle_max = std::nan("1")
protected

Definition at line 51 of file Rangefinder2DTransformer.h.

◆ m_scan_angle_min

double Rangefinder2DTransformer::m_scan_angle_min = std::nan("1")
protected

Definition at line 50 of file Rangefinder2DTransformer.h.

◆ sens_p

yarp::dev::IRangefinder2D* Rangefinder2DTransformer::sens_p =nullptr
protected

Definition at line 47 of file Rangefinder2DTransformer.h.


The documentation for this class was generated from the following files: