YARP
Yet Another Robot Platform
yarp::dev::IAnalogSensor Class Referenceabstract

A generic interface to sensors (gyro, a/d converters). More...

#include <yarp/dev/IAnalogSensor.h>

+ Inheritance diagram for yarp::dev::IAnalogSensor:

Detailed Description

A generic interface to sensors (gyro, a/d converters).

Similar to IGenerisSensor, but includes error handling.

Definition at line 32 of file IAnalogSensor.h.

Public Types

enum  {
  AS_OK =0,
  AS_ERROR =1,
  AS_OVF =2,
  AS_TIMEOUT =3
}
 

Public Member Functions

virtual ~IAnalogSensor ()
 
virtual int read (yarp::sig::Vector &out)=0
 Read a vector from the sensor. More...
 
virtual int getState (int ch)=0
 Check the state value of a given channel. More...
 
virtual int getChannels ()=0
 Get the number of channels of the sensor. More...
 
virtual int calibrateSensor ()=0
 Calibrates the whole sensor. More...
 
virtual int calibrateSensor (const yarp::sig::Vector &value)=0
 Calibrates the whole sensor, using an vector of calibration values. More...
 
virtual int calibrateChannel (int ch)=0
 Calibrates one single channel. More...
 
virtual int calibrateChannel (int ch, double value)=0
 Calibrates one single channel, using a calibration value. More...
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
AS_OK 
AS_ERROR 
AS_OVF 
AS_TIMEOUT 

Definition at line 35 of file IAnalogSensor.h.

Constructor & Destructor Documentation

◆ ~IAnalogSensor()

virtual yarp::dev::IAnalogSensor::~IAnalogSensor ( )
inlinevirtual

Definition at line 43 of file IAnalogSensor.h.

Member Function Documentation

◆ calibrateChannel() [1/2]

virtual int yarp::dev::IAnalogSensor::calibrateChannel ( int  ch)
pure virtual

Calibrates one single channel.

Parameters
chchannel number.
Returns
status.

Implemented in yarp::dev::AnalogSensorClient, and FakeAnalogSensor.

◆ calibrateChannel() [2/2]

virtual int yarp::dev::IAnalogSensor::calibrateChannel ( int  ch,
double  value 
)
pure virtual

Calibrates one single channel, using a calibration value.

Parameters
chchannel number.
valuecalibration value.
Returns
status.

Implemented in yarp::dev::AnalogSensorClient, and FakeAnalogSensor.

◆ calibrateSensor() [1/2]

virtual int yarp::dev::IAnalogSensor::calibrateSensor ( )
pure virtual

Calibrates the whole sensor.

Returns
status.

Implemented in yarp::dev::AnalogSensorClient, and FakeAnalogSensor.

◆ calibrateSensor() [2/2]

virtual int yarp::dev::IAnalogSensor::calibrateSensor ( const yarp::sig::Vector value)
pure virtual

Calibrates the whole sensor, using an vector of calibration values.

Parameters
valuea vector of calibration values.
Returns
status.

Implemented in yarp::dev::AnalogSensorClient, and FakeAnalogSensor.

◆ getChannels()

virtual int yarp::dev::IAnalogSensor::getChannels ( )
pure virtual

Get the number of channels of the sensor.

Returns
number of channels (0 in case of errors).

Implemented in yarp::dev::AnalogSensorClient, and FakeAnalogSensor.

◆ getState()

virtual int yarp::dev::IAnalogSensor::getState ( int  ch)
pure virtual

Check the state value of a given channel.

Parameters
chchannel number.
Returns
status.

Implemented in yarp::dev::AnalogSensorClient, and FakeAnalogSensor.

◆ read()

virtual int yarp::dev::IAnalogSensor::read ( yarp::sig::Vector out)
pure virtual

Read a vector from the sensor.

Parameters
outa vector containing the sensor's last readings.
Returns
AS_OK or return code. AS_TIMEOUT if the sensor timed-out.

Implemented in yarp::dev::AnalogSensorClient, and FakeAnalogSensor.


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