YARP
Yet Another Robot Platform
Rangefinder2DClient Class Reference

The client side of any ILaserRangefinder2D capable device. More...

#include <Rangefinder2DClient/Rangefinder2DClient.h>

+ Inheritance diagram for Rangefinder2DClient:

Detailed Description

The client side of any ILaserRangefinder2D capable device.

Still single thread! concurrent access is unsafe.

Definition at line 81 of file Rangefinder2DClient.h.

Public Member Functions

bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver. More...
 
bool close () override
 Close the DeviceDriver. More...
 
yarp::os::Stamp getLastInputStamp () override
 Get the time stamp for the last read data. More...
 
bool getLaserMeasurement (std::vector< yarp::dev::LaserMeasurementData > &data) override
 Get the device measurements. More...
 
bool getRawData (yarp::sig::Vector &data) override
 Get the device measurements. More...
 
bool getDeviceStatus (Device_status &status) override
 get the device status More...
 
bool getDistanceRange (double &min, double &max) override
 get the device detection range More...
 
bool setDistanceRange (double min, double max) override
 set the device detection range. More...
 
bool getScanLimits (double &min, double &max) override
 get the scan angular range. More...
 
bool setScanLimits (double min, double max) override
 set the scan angular range. More...
 
bool getHorizontalResolution (double &step) override
 get the angular step between two measurments. More...
 
bool setHorizontalResolution (double step) override
 get the angular step between two measurments (if available) More...
 
bool getScanRate (double &rate) override
 get the scan rate (scans per seconds) More...
 
bool setScanRate (double rate) override
 set the scan rate (scans per seconds) More...
 
bool getDeviceInfo (std::string &device_info) override
 get the device hardware charactestics More...
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
virtual ~DeviceDriver ()
 Destructor. More...
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver. More...
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others. More...
 
- Public Member Functions inherited from yarp::os::IConfig
virtual ~IConfig ()
 Destructor. More...
 
virtual bool configure (Searchable &config)
 Change online parameters. More...
 
- Public Member Functions inherited from yarp::dev::IPreciselyTimed
virtual ~IPreciselyTimed ()
 
- Public Member Functions inherited from yarp::dev::IRangefinder2D
virtual ~IRangefinder2D ()
 

Protected Attributes

Rangefinder2DInputPortProcessor inputPort
 
yarp::os::Port rpcPort
 
std::string local
 
std::string remote
 
yarp::os::Stamp lastTs
 
std::string deviceId
 
double scan_angle_min
 
double scan_angle_max
 
double device_position_x
 
double device_position_y
 
double device_position_theta
 
std::string laser_frame_name
 
std::string robot_frame_name
 

Additional Inherited Members

- Public Types inherited from yarp::dev::IRangefinder2D
enum  Device_status {
  DEVICE_OK_STANBY = 0,
  DEVICE_OK_IN_USE = 1,
  DEVICE_GENERAL_ERROR = 2,
  DEVICE_TIMEOUT = 3
}
 

Member Function Documentation

◆ close()

bool Rangefinder2DClient::close ( void  )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 295 of file Rangefinder2DClient.cpp.

◆ getDeviceInfo()

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

get the device hardware charactestics

Parameters
device_infostring containing the device infos
Returns
true/false.

Implements yarp::dev::IRangefinder2D.

Definition at line 448 of file Rangefinder2DClient.cpp.

◆ getDeviceStatus()

bool Rangefinder2DClient::getDeviceStatus ( Device_status status)
overridevirtual

get the device status

Parameters
statusthe device status
Returns
true/false.

Implements yarp::dev::IRangefinder2D.

Definition at line 442 of file Rangefinder2DClient.cpp.

◆ getDistanceRange()

bool Rangefinder2DClient::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 329 of file Rangefinder2DClient.cpp.

◆ getHorizontalResolution()

bool Rangefinder2DClient::getHorizontalResolution ( double &  step)
overridevirtual

get the angular step between two measurments.

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

Implements yarp::dev::IRangefinder2D.

Definition at line 390 of file Rangefinder2DClient.cpp.

◆ getLaserMeasurement()

bool Rangefinder2DClient::getLaserMeasurement ( std::vector< yarp::dev::LaserMeasurementData > &  data)
overridevirtual

Get the device measurements.

Parameters
dataa vector containing the measurement data, expressed in cartesian/polar format
Returns
true/false..

Implements yarp::dev::IRangefinder2D.

Definition at line 308 of file Rangefinder2DClient.cpp.

◆ getLastInputStamp()

Stamp Rangefinder2DClient::getLastInputStamp ( )
overridevirtual

Get the time stamp for the last read data.

Returns
last time stamp.

Implements yarp::dev::IPreciselyTimed.

Definition at line 463 of file Rangefinder2DClient.cpp.

◆ getRawData()

bool Rangefinder2DClient::getRawData ( yarp::sig::Vector data)
overridevirtual

Get the device measurements.

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

Implements yarp::dev::IRangefinder2D.

Definition at line 302 of file Rangefinder2DClient.cpp.

◆ getScanLimits()

bool Rangefinder2DClient::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 362 of file Rangefinder2DClient.cpp.

◆ getScanRate()

bool Rangefinder2DClient::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 416 of file Rangefinder2DClient.cpp.

◆ open()

bool Rangefinder2DClient::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 173 of file Rangefinder2DClient.cpp.

◆ setDistanceRange()

bool Rangefinder2DClient::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 345 of file Rangefinder2DClient.cpp.

◆ setHorizontalResolution()

bool Rangefinder2DClient::setHorizontalResolution ( double  step)
overridevirtual

get the angular step between two measurments (if available)

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

Implements yarp::dev::IRangefinder2D.

Definition at line 405 of file Rangefinder2DClient.cpp.

◆ setScanLimits()

bool Rangefinder2DClient::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 378 of file Rangefinder2DClient.cpp.

◆ setScanRate()

bool Rangefinder2DClient::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 431 of file Rangefinder2DClient.cpp.

Member Data Documentation

◆ device_position_theta

double Rangefinder2DClient::device_position_theta
protected

Definition at line 98 of file Rangefinder2DClient.h.

◆ device_position_x

double Rangefinder2DClient::device_position_x
protected

Definition at line 96 of file Rangefinder2DClient.h.

◆ device_position_y

double Rangefinder2DClient::device_position_y
protected

Definition at line 97 of file Rangefinder2DClient.h.

◆ deviceId

std::string Rangefinder2DClient::deviceId
protected

Definition at line 92 of file Rangefinder2DClient.h.

◆ inputPort

Rangefinder2DInputPortProcessor Rangefinder2DClient::inputPort
protected

Definition at line 87 of file Rangefinder2DClient.h.

◆ laser_frame_name

std::string Rangefinder2DClient::laser_frame_name
protected

Definition at line 99 of file Rangefinder2DClient.h.

◆ lastTs

yarp::os::Stamp Rangefinder2DClient::lastTs
protected

Definition at line 91 of file Rangefinder2DClient.h.

◆ local

std::string Rangefinder2DClient::local
protected

Definition at line 89 of file Rangefinder2DClient.h.

◆ remote

std::string Rangefinder2DClient::remote
protected

Definition at line 90 of file Rangefinder2DClient.h.

◆ robot_frame_name

std::string Rangefinder2DClient::robot_frame_name
protected

Definition at line 100 of file Rangefinder2DClient.h.

◆ rpcPort

yarp::os::Port Rangefinder2DClient::rpcPort
protected

Definition at line 88 of file Rangefinder2DClient.h.

◆ scan_angle_max

double Rangefinder2DClient::scan_angle_max
protected

Definition at line 95 of file Rangefinder2DClient.h.

◆ scan_angle_min

double Rangefinder2DClient::scan_angle_min
protected

Definition at line 94 of file Rangefinder2DClient.h.


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