YARP
Yet Another Robot Platform
yarp::dev::ImplementEncoders Class Reference

#include <yarp/dev/ImplementEncoders.h>

+ Inheritance diagram for yarp::dev::ImplementEncoders:

Public Member Functions

 ImplementEncoders (yarp::dev::IEncodersRaw *y)
 
virtual ~ImplementEncoders ()
 Destructor. More...
 
bool getAxes (int *ax) override
 Get the number of controlled axes. More...
 
bool resetEncoder (int j) override
 Reset encoder, single joint. More...
 
bool resetEncoders () override
 Reset encoders. More...
 
bool setEncoder (int j, double val) override
 Set the value of the encoder for a given joint. More...
 
bool setEncoders (const double *vals) override
 Set the value of all encoders. More...
 
bool getEncoder (int j, double *v) override
 Read the value of an encoder. More...
 
bool getEncoders (double *encs) override
 Read the position of all axes. More...
 
bool getEncoderSpeed (int j, double *spds) override
 Read the instantaneous speed of an axis. More...
 
bool getEncoderSpeeds (double *spds) override
 Read the instantaneous speed of all axes. More...
 
bool getEncoderAcceleration (int j, double *spds) override
 Read the instantaneous acceleration of an axis. More...
 
bool getEncoderAccelerations (double *accs) override
 Read the instantaneous acceleration of all axes. More...
 
- Public Member Functions inherited from yarp::dev::IEncoders
virtual ~IEncoders ()
 Destructor. More...
 

Protected Member Functions

bool initialize (int size, const int *amap, const double *enc, const double *zos)
 Initialize the internal data and alloc memory. More...
 
bool uninitialize ()
 Clean up internal data and memory. More...
 

Protected Attributes

IEncodersRawiEncoders
 
void * helper
 
double * temp
 

Detailed Description

Definition at line 16 of file ImplementEncoders.h.

Constructor & Destructor Documentation

◆ ImplementEncoders()

ImplementEncoders::ImplementEncoders ( yarp::dev::IEncodersRaw y)

Definition at line 20 of file ImplementEncoders.cpp.

◆ ~ImplementEncoders()

ImplementEncoders::~ImplementEncoders ( )
virtual

Destructor.

Perform uninitialize if needed.

Definition at line 27 of file ImplementEncoders.cpp.

Member Function Documentation

◆ getAxes()

bool ImplementEncoders::getAxes ( int *  ax)
overridevirtual

Get the number of controlled axes.

This command asks the number of controlled axes for the current physical interface.

Returns
the number of controlled axes.

Implements yarp::dev::IEncoders.

Definition at line 62 of file ImplementEncoders.cpp.

◆ getEncoder()

bool ImplementEncoders::getEncoder ( int  j,
double *  v 
)
overridevirtual

Read the value of an encoder.

Parameters
jencoder number
vpointer to storage for the return value
Returns
true/false, upon success/failure (you knew it, uh?)

Implements yarp::dev::IEncoders.

Definition at line 99 of file ImplementEncoders.cpp.

◆ getEncoderAcceleration()

bool ImplementEncoders::getEncoderAcceleration ( int  j,
double *  spds 
)
overridevirtual

Read the instantaneous acceleration of an axis.

Parameters
jaxis number
spdspointer to the array that will contain the output

Implements yarp::dev::IEncoders.

Definition at line 151 of file ImplementEncoders.cpp.

◆ getEncoderAccelerations()

bool ImplementEncoders::getEncoderAccelerations ( double *  accs)
overridevirtual

Read the instantaneous acceleration of all axes.

Parameters
accspointer to the array that will contain the output
Returns
true if all goes well, false if anything bad happens.

Implements yarp::dev::IEncoders.

Definition at line 166 of file ImplementEncoders.cpp.

◆ getEncoders()

bool ImplementEncoders::getEncoders ( double *  encs)
overridevirtual

Read the position of all axes.

Parameters
encspointer to the array that will contain the output
Returns
true/false on success/failure

Implements yarp::dev::IEncoders.

Definition at line 114 of file ImplementEncoders.cpp.

◆ getEncoderSpeed()

bool ImplementEncoders::getEncoderSpeed ( int  j,
double *  spds 
)
overridevirtual

Read the instantaneous speed of an axis.

Parameters
jaxis number
spdspointer to storage for the output
Returns
true if successful, false ... otherwise.

Implements yarp::dev::IEncoders.

Definition at line 126 of file ImplementEncoders.cpp.

◆ getEncoderSpeeds()

bool ImplementEncoders::getEncoderSpeeds ( double *  spds)
overridevirtual

Read the instantaneous speed of all axes.

Parameters
spdspointer to storage for the output values
Returns
guess what? (true/false on success or failure).

Implements yarp::dev::IEncoders.

Definition at line 141 of file ImplementEncoders.cpp.

◆ initialize()

bool ImplementEncoders::initialize ( int  size,
const int *  amap,
const double *  enc,
const double *  zos 
)
protected

Initialize the internal data and alloc memory.

Parameters
sizeis the number of controlled axes the driver deals with.
amapis a lookup table mapping axes onto physical drivers.
encis an array containing the encoder to angles conversion factors.
zosis an array containing the zeros of the encoders.
Returns
true if initialized succeeded, false if it wasn't executed, or assert.

Definition at line 32 of file ImplementEncoders.cpp.

◆ resetEncoder()

bool ImplementEncoders::resetEncoder ( int  j)
overridevirtual

Reset encoder, single joint.

Set the encoder value to zero

Parameters
jencoder number
Returns
true/false

Implements yarp::dev::IEncoders.

Definition at line 68 of file ImplementEncoders.cpp.

◆ resetEncoders()

bool ImplementEncoders::resetEncoders ( )
overridevirtual

Reset encoders.

Set the encoders value to zero

Returns
true/false

Implements yarp::dev::IEncoders.

Definition at line 77 of file ImplementEncoders.cpp.

◆ setEncoder()

bool ImplementEncoders::setEncoder ( int  j,
double  val 
)
overridevirtual

Set the value of the encoder for a given joint.

Parameters
jencoder number
valnew value
Returns
true/false

Implements yarp::dev::IEncoders.

Definition at line 82 of file ImplementEncoders.cpp.

◆ setEncoders()

bool ImplementEncoders::setEncoders ( const double *  vals)
overridevirtual

Set the value of all encoders.

Parameters
valspointer to the new values
Returns
true/false

Implements yarp::dev::IEncoders.

Definition at line 92 of file ImplementEncoders.cpp.

◆ uninitialize()

bool ImplementEncoders::uninitialize ( )
protected

Clean up internal data and memory.

Returns
true if uninitialization is executed, false otherwise.

Definition at line 49 of file ImplementEncoders.cpp.

Member Data Documentation

◆ helper

void* yarp::dev::ImplementEncoders::helper
protected

Definition at line 20 of file ImplementEncoders.h.

◆ iEncoders

IEncodersRaw* yarp::dev::ImplementEncoders::iEncoders
protected

Definition at line 19 of file ImplementEncoders.h.

◆ temp

double* yarp::dev::ImplementEncoders::temp
protected

Definition at line 21 of file ImplementEncoders.h.


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