YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
yarp::dev::ImplementEncodersTimed Class Reference

#include <yarp/dev/ImplementEncodersTimed.h>

+ Inheritance diagram for yarp::dev::ImplementEncodersTimed:

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

IEncodersTimedRaw * m_iraw =nullptr
 
void * m_helper =nullptr
 
std::vector< int > m_buffer_ints
 
std::vector< double > m_buffer_doubles
 
std::vector< double > m_buffer_doubles2
 
std::mutex m_imp_mutex
 

Detailed Description

Definition at line 22 of file ImplementEncodersTimed.h.

Constructor & Destructor Documentation

◆ ImplementEncodersTimed()

ImplementEncodersTimed::ImplementEncodersTimed ( yarp::dev::IEncodersTimedRaw *  y)

Definition at line 22 of file ImplementEncodersTimed.cpp.

◆ ~ImplementEncodersTimed()

ImplementEncodersTimed::~ImplementEncodersTimed ( )
virtual

Definition at line 27 of file ImplementEncodersTimed.cpp.

Member Function Documentation

◆ getAxes()

ReturnValue ImplementEncodersTimed::getAxes ( size_t &  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 63 of file ImplementEncodersTimed.cpp.

◆ getEncoder()

ReturnValue ImplementEncodersTimed::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 113 of file ImplementEncodersTimed.cpp.

◆ getEncoderAcceleration()

ReturnValue ImplementEncodersTimed::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 173 of file ImplementEncodersTimed.cpp.

◆ getEncoderAccelerations()

ReturnValue ImplementEncodersTimed::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 192 of file ImplementEncodersTimed.cpp.

◆ getEncoders()

ReturnValue ImplementEncodersTimed::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 132 of file ImplementEncodersTimed.cpp.

◆ getEncoderSpeed()

ReturnValue ImplementEncodersTimed::getEncoderSpeed ( int  j,
double *  sp 
)
overridevirtual

Read the istantaneous speed of an axis.

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

Implements yarp::dev::IEncoders.

Definition at line 143 of file ImplementEncodersTimed.cpp.

◆ getEncoderSpeeds()

ReturnValue ImplementEncodersTimed::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 162 of file ImplementEncodersTimed.cpp.

◆ getEncodersTimed()

ReturnValue ImplementEncodersTimed::getEncodersTimed ( double *  encs,
double *  time 
)
overridevirtual

Read the instantaneous acceleration of all axes.

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

Implements yarp::dev::IEncodersTimed.

Definition at line 224 of file ImplementEncodersTimed.cpp.

◆ getEncoderTimed()

ReturnValue ImplementEncodersTimed::getEncoderTimed ( int  j,
double *  encs,
double *  time 
)
overridevirtual

Read the instantaneous acceleration of all axes.

Parameters
jaxis index
encsencoder value (pointer to)
timecorresponding timestamp (pointer to)
Returns
true if all goes well, false if anything bad happens.

Implements yarp::dev::IEncodersTimed.

Definition at line 203 of file ImplementEncodersTimed.cpp.

◆ initialize()

bool ImplementEncodersTimed::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 ImplementEncodersTimed.cpp.

◆ resetEncoder()

ReturnValue ImplementEncodersTimed::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 71 of file ImplementEncodersTimed.cpp.

◆ resetEncoders()

ReturnValue ImplementEncodersTimed::resetEncoders ( )
overridevirtual

Reset encoders.

Set the encoders value to zero

Returns
true/false

Implements yarp::dev::IEncoders.

Definition at line 82 of file ImplementEncodersTimed.cpp.

◆ setEncoder()

ReturnValue ImplementEncodersTimed::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 89 of file ImplementEncodersTimed.cpp.

◆ setEncoders()

ReturnValue ImplementEncodersTimed::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 102 of file ImplementEncodersTimed.cpp.

◆ uninitialize()

bool ImplementEncodersTimed::uninitialize ( )
protected

Clean up internal data and memory.

Returns
true if uninitialization is executed, false otherwise.

Definition at line 52 of file ImplementEncodersTimed.cpp.

Member Data Documentation

◆ m_buffer_doubles

std::vector<double> yarp::dev::ImplementEncodersTimed::m_buffer_doubles
protected

Definition at line 28 of file ImplementEncodersTimed.h.

◆ m_buffer_doubles2

std::vector<double> yarp::dev::ImplementEncodersTimed::m_buffer_doubles2
protected

Definition at line 29 of file ImplementEncodersTimed.h.

◆ m_buffer_ints

std::vector<int> yarp::dev::ImplementEncodersTimed::m_buffer_ints
protected

Definition at line 27 of file ImplementEncodersTimed.h.

◆ m_helper

void* yarp::dev::ImplementEncodersTimed::m_helper =nullptr
protected

Definition at line 26 of file ImplementEncodersTimed.h.

◆ m_imp_mutex

std::mutex yarp::dev::ImplementEncodersTimed::m_imp_mutex
protected

Definition at line 30 of file ImplementEncodersTimed.h.

◆ m_iraw

IEncodersTimedRaw* yarp::dev::ImplementEncodersTimed::m_iraw =nullptr
protected

Definition at line 25 of file ImplementEncodersTimed.h.


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