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 setDesiredVelocity (int jnt, double vel) override
 Set the velocity of single joint.
 
yarp::dev::ReturnValue setDesiredVelocity (const std::vector< double > &vels) override
 Set the velocity of all joints.
 
yarp::dev::ReturnValue setDesiredVelocity (const std::vector< int > &jnts, const std::vector< double > &vels) override
 Set the velocity of a subset of joints.
 
yarp::dev::ReturnValue getDesiredVelocity (const int jnt, double &vel) override
 Get the last reference velocity set by setDesiredVelocity() for a single joint.
 
yarp::dev::ReturnValue getDesiredVelocity (std::vector< double > &vels) override
 Get the last reference velocity set by setDesiredVelocity() for all joints.
 
yarp::dev::ReturnValue getDesiredVelocity (const std::vector< int > &jnts, std::vector< double > &vels) override
 Get the last reference velocity set by setDesiredVelocity() 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

IVelocityDirectRawm_iVelocityDirectRaw =nullptr
 
void * m_helper =nullptr
 
std::vector< int > m_buffer_ints
 
std::vector< double > m_buffer_doubles
 

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 16 of file ImplementVelocityDirect.cpp.

◆ ~ImplementVelocityDirect()

ImplementVelocityDirect::~ImplementVelocityDirect ( )
virtual

Destructor.

Definition at line 20 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 51 of file ImplementVelocityDirect.cpp.

◆ getDesiredVelocity() [1/3]

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

Get the last reference velocity set by setDesiredVelocity() 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 100 of file ImplementVelocityDirect.cpp.

◆ getDesiredVelocity() [2/3]

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

Get the last reference velocity set by setDesiredVelocity() 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 122 of file ImplementVelocityDirect.cpp.

◆ getDesiredVelocity() [3/3]

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

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

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

Implements yarp::dev::IVelocityDirect.

Definition at line 113 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 25 of file ImplementVelocityDirect.cpp.

◆ setDesiredVelocity() [1/3]

yarp::dev::ReturnValue ImplementVelocityDirect::setDesiredVelocity ( 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 69 of file ImplementVelocityDirect.cpp.

◆ setDesiredVelocity() [2/3]

yarp::dev::ReturnValue ImplementVelocityDirect::setDesiredVelocity ( 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 81 of file ImplementVelocityDirect.cpp.

◆ setDesiredVelocity() [3/3]

yarp::dev::ReturnValue ImplementVelocityDirect::setDesiredVelocity ( 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 57 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 40 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_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: