YARP
Yet Another Robot Platform

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

#include <Rangefinder2DClient/Rangefinder2DClient.h>

+ Inheritance diagram for Rangefinder2DClient:

Public Member Functions

bool open (yarp::os::Searchable &config) override
 Open the DeviceDriver. More...
 
bool close () override
 Close the DeviceDriver. More...
 
bool getLaserMeasurement (std::vector< yarp::dev::LaserMeasurementData > &data, double *timestamp=nullptr) override
 Get the device measurements. More...
 
bool getRawData (yarp::sig::Vector &data, double *timestamp=nullptr) 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
 DeviceDriver ()
 
 DeviceDriver (const DeviceDriver &other)=delete
 
 DeviceDriver (DeviceDriver &&other) noexcept=delete
 
DeviceDriveroperator= (const DeviceDriver &other)=delete
 
DeviceDriveroperator= (DeviceDriver &&other) noexcept=delete
 
 ~DeviceDriver () override
 
virtual std::string id () const
 Return the id assigned to the PolyDriver. More...
 
virtual void setId (const std::string &id)
 Set the id for this device. 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::IRangefinder2D
virtual ~IRangefinder2D ()
 

Protected Attributes

Rangefinder2DInputPortProcessor inputPort
 
yarp::os::Port rpcPort
 
std::string local
 
std::string remote
 
std::string m_carrier
 
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
}
 

Detailed Description

Rangefinder2DClient: The client side of any ILaserRangefinder2D capable device.

Still single thread! concurrent access is unsafe.

Parameters required by this device are:

Parameter name SubParameter Type Units Default Value Required Description Notes
local - string - - Yes Full port name opened by the Rangefinder2DClient device.
remote - string - - Yes Full port name of the port opened on the server side, to which the Rangefinder2DClient connects to.
carrier - string - tcp No The carier used for the connection with the server.

Definition at line 76 of file Rangefinder2DClient.h.

Member Function Documentation

◆ close()

bool Rangefinder2DClient::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 278 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 443 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 437 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 324 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 385 of file Rangefinder2DClient.cpp.

◆ getLaserMeasurement()

bool Rangefinder2DClient::getLaserMeasurement ( std::vector< yarp::dev::LaserMeasurementData > &  data,
double *  timestamp = nullptr 
)
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 299 of file Rangefinder2DClient.cpp.

◆ getRawData()

bool Rangefinder2DClient::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.
Returns
true/false.

Implements yarp::dev::IRangefinder2D.

Definition at line 285 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 357 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 411 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 154 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 340 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 400 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 373 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 426 of file Rangefinder2DClient.cpp.

Member Data Documentation

◆ device_position_theta

double Rangefinder2DClient::device_position_theta
protected

Definition at line 93 of file Rangefinder2DClient.h.

◆ device_position_x

double Rangefinder2DClient::device_position_x
protected

Definition at line 91 of file Rangefinder2DClient.h.

◆ device_position_y

double Rangefinder2DClient::device_position_y
protected

Definition at line 92 of file Rangefinder2DClient.h.

◆ deviceId

std::string Rangefinder2DClient::deviceId
protected

Definition at line 87 of file Rangefinder2DClient.h.

◆ inputPort

Rangefinder2DInputPortProcessor Rangefinder2DClient::inputPort
protected

Definition at line 81 of file Rangefinder2DClient.h.

◆ laser_frame_name

std::string Rangefinder2DClient::laser_frame_name
protected

Definition at line 94 of file Rangefinder2DClient.h.

◆ lastTs

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

Definition at line 86 of file Rangefinder2DClient.h.

◆ local

std::string Rangefinder2DClient::local
protected

Definition at line 83 of file Rangefinder2DClient.h.

◆ m_carrier

std::string Rangefinder2DClient::m_carrier
protected

Definition at line 85 of file Rangefinder2DClient.h.

◆ remote

std::string Rangefinder2DClient::remote
protected

Definition at line 84 of file Rangefinder2DClient.h.

◆ robot_frame_name

std::string Rangefinder2DClient::robot_frame_name
protected

Definition at line 95 of file Rangefinder2DClient.h.

◆ rpcPort

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

Definition at line 82 of file Rangefinder2DClient.h.

◆ scan_angle_max

double Rangefinder2DClient::scan_angle_max
protected

Definition at line 90 of file Rangefinder2DClient.h.

◆ scan_angle_min

double Rangefinder2DClient::scan_angle_min
protected

Definition at line 89 of file Rangefinder2DClient.h.


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