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

#include <yarp/dev/ImplementVelocityDirect.h>

+ Inheritance diagram for yarp::dev::ImplementVelocityDirect:

Public Member Functions

 ImplementVelocityDirect (yarp::dev::IVelocityDirectRaw *y)
 Constructor.
 
virtual ~ImplementVelocityDirect ()
 Destructor.
 
yarp::dev::ReturnValue getAxes (size_t &axes) override
 Get the number of controlled axes.
 
yarp::dev::ReturnValue setRefVelocity (int jnt, double vel) override
 Set the velocity of single joint.
 
yarp::dev::ReturnValue setRefVelocity (const std::vector< double > &vels) override
 Set the velocity of all joints.
 
yarp::dev::ReturnValue setRefVelocity (const std::vector< int > &jnts, const std::vector< double > &vels) override
 Set the velocity of a subset of joints.
 
yarp::dev::ReturnValue getRefVelocity (const int jnt, double &vel) override
 Get the last reference velocity set by setRefVelocity() for a single joint.
 
yarp::dev::ReturnValue getRefVelocity (std::vector< double > &vels) override
 Get the last reference velocity set by setRefVelocity() for all joints.
 
yarp::dev::ReturnValue getRefVelocity (const std::vector< int > &jnts, std::vector< double > &vels) override
 Get the last reference velocity set by setRefVelocity() for a group of joints.
 
- Public Member Functions inherited from yarp::dev::IVelocityDirect
virtual ~IVelocityDirect ()
 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

IVelocityDirectRaw * m_iVelocityDirectRaw =nullptr
 
void * m_helper =nullptr
 
std::vector< int > m_buffer_ints
 
std::vector< double > m_buffer_doubles
 
std::mutex m_imp_mutex
 

Detailed Description

Definition at line 17 of file ImplementVelocityDirect.h.

Constructor & Destructor Documentation

◆ ImplementVelocityDirect()

ImplementVelocityDirect::ImplementVelocityDirect ( yarp::dev::IVelocityDirectRaw *  y)

Constructor.

Parameters
yis the pointer to the class instance inheriting from this implementation.

Definition at line 22 of file ImplementVelocityDirect.cpp.

◆ ~ImplementVelocityDirect()

ImplementVelocityDirect::~ImplementVelocityDirect ( )
virtual

Destructor.

Definition at line 26 of file ImplementVelocityDirect.cpp.

Member Function Documentation

◆ getAxes()

yarp::dev::ReturnValue ImplementVelocityDirect::getAxes ( size_t &  axes)
overridevirtual

Get the number of controlled axes.

Parameters
axesreturned number of controllable axes
Returns
true on success

Implements yarp::dev::IVelocityDirect.

Definition at line 57 of file ImplementVelocityDirect.cpp.

◆ getRefVelocity() [1/3]

yarp::dev::ReturnValue ImplementVelocityDirect::getRefVelocity ( const int  jnt,
double &  vel 
)
overridevirtual

Get the last reference velocity set by setRefVelocity() for a single joint.

Parameters
jntjoint number
velreturns the velocity reference for the specified joint.
Returns
true on success

Implements yarp::dev::IVelocityDirect.

Definition at line 103 of file ImplementVelocityDirect.cpp.

◆ getRefVelocity() [2/3]

yarp::dev::ReturnValue ImplementVelocityDirect::getRefVelocity ( const std::vector< int > &  jnts,
std::vector< double > &  vels 
)
overridevirtual

Get the last reference velocity set by setRefVelocity() for a group of joints.

Parameters
jntsvector containing the ids of the joints to control.
velsvector containing the velocity references of the joints belonging to the required subset.
Returns
true on success

Implements yarp::dev::IVelocityDirect.

Definition at line 126 of file ImplementVelocityDirect.cpp.

◆ getRefVelocity() [3/3]

yarp::dev::ReturnValue ImplementVelocityDirect::getRefVelocity ( std::vector< double > &  vels)
overridevirtual

Get the last reference velocity set by setRefVelocity() for all joints.

Parameters
velsvector containing the velocity references of all joints.
Returns
true on success

Implements yarp::dev::IVelocityDirect.

Definition at line 115 of file ImplementVelocityDirect.cpp.

◆ initialize()

bool ImplementVelocityDirect::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. respect to the control/output values of the driver.
Returns
true if initialized succeeded, false if it wasn't executed, or assert.

Definition at line 31 of file ImplementVelocityDirect.cpp.

◆ setRefVelocity() [1/3]

yarp::dev::ReturnValue ImplementVelocityDirect::setRefVelocity ( const std::vector< double > &  vels)
overridevirtual

Set the velocity of all joints.

Parameters
velsvector containing joint velocities for all joints
Returns
true on success

Implements yarp::dev::IVelocityDirect.

Definition at line 76 of file ImplementVelocityDirect.cpp.

◆ setRefVelocity() [2/3]

yarp::dev::ReturnValue ImplementVelocityDirect::setRefVelocity ( const std::vector< int > &  jnts,
const std::vector< double > &  vels 
)
overridevirtual

Set the velocity of a subset of joints.

Parameters
jntsvector containing the ids of the joints to control.
velsvector containing the joint velocities for the required subset.
Returns
true on success

Implements yarp::dev::IVelocityDirect.

Definition at line 86 of file ImplementVelocityDirect.cpp.

◆ setRefVelocity() [3/3]

yarp::dev::ReturnValue ImplementVelocityDirect::setRefVelocity ( int  jnt,
double  vel 
)
overridevirtual

Set the velocity of single joint.

Parameters
jntjoint number
velspeed value
Returns
true on success

Implements yarp::dev::IVelocityDirect.

Definition at line 65 of file ImplementVelocityDirect.cpp.

◆ uninitialize()

bool ImplementVelocityDirect::uninitialize ( )
protected

Clean up internal data and memory.

Returns
true if uninitialization is executed, false otherwise.

Definition at line 46 of file ImplementVelocityDirect.cpp.

Member Data Documentation

◆ m_buffer_doubles

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

Definition at line 23 of file ImplementVelocityDirect.h.

◆ m_buffer_ints

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

Definition at line 22 of file ImplementVelocityDirect.h.

◆ m_helper

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

Definition at line 21 of file ImplementVelocityDirect.h.

◆ m_imp_mutex

std::mutex yarp::dev::ImplementVelocityDirect::m_imp_mutex
protected

Definition at line 24 of file ImplementVelocityDirect.h.

◆ m_iVelocityDirectRaw

IVelocityDirectRaw* yarp::dev::ImplementVelocityDirect::m_iVelocityDirectRaw =nullptr
protected

Definition at line 20 of file ImplementVelocityDirect.h.


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