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

#include <yarp/dev/ImplementVelocityControl.h>

+ Inheritance diagram for yarp::dev::ImplementVelocityControl:

Public Member Functions

 ImplementVelocityControl (yarp::dev::IVelocityControlRaw *y)
 Constructor.
 
virtual ~ImplementVelocityControl ()
 Destructor.
 
yarp::dev::ReturnValue getAxes (size_t &axes) override
 Get the number of controlled axes.
 
yarp::dev::ReturnValue velocityMove (int j, double sp) override
 Start motion at a given speed, single joint.
 
yarp::dev::ReturnValue velocityMove (const double *sp) override
 Start motion at a given speed, multiple joints.
 
yarp::dev::ReturnValue setTrajAcceleration (int j, double acc) override
 Set reference acceleration for a joint.
 
yarp::dev::ReturnValue setTrajAccelerations (const double *accs) override
 Set reference acceleration on all joints.
 
yarp::dev::ReturnValue getTrajAcceleration (int j, double *acc) override
 Get reference acceleration for a joint.
 
yarp::dev::ReturnValue getTrajAccelerations (double *accs) override
 Get reference acceleration of all joints.
 
yarp::dev::ReturnValue stop (int j) override
 Stop motion, single joint.
 
yarp::dev::ReturnValue stop () override
 Stop motion, multiple joints.
 
yarp::dev::ReturnValue velocityMove (const int n_joint, const int *joints, const double *spds) override
 Start motion at a given speed for a subset of joints.
 
yarp::dev::ReturnValue getTargetVelocity (const int joint, double *vel) override
 Get the last reference speed set by velocityMove for single joint.
 
yarp::dev::ReturnValue getTargetVelocities (double *vels) override
 Get the last reference speed set by velocityMove for all joints.
 
yarp::dev::ReturnValue getTargetVelocities (const int n_joint, const int *joints, double *vels) override
 Get the last reference speed set by velocityMove for a group of joints.
 
yarp::dev::ReturnValue setTrajAccelerations (const int n_joint, const int *joints, const double *accs) override
 Set reference acceleration for a subset of joints.
 
yarp::dev::ReturnValue getTrajAccelerations (const int n_joint, const int *joints, double *accs) override
 Get reference acceleration for a subset of joints.
 
yarp::dev::ReturnValue stop (const int n_joint, const int *joints) override
 Stop motion for a subset of joints.
 
- Public Member Functions inherited from yarp::dev::IVelocityControl
virtual ~IVelocityControl ()
 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

IVelocityControlRaw * m_iraw =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 26 of file ImplementVelocityControl.h.

Constructor & Destructor Documentation

◆ ImplementVelocityControl()

ImplementVelocityControl::ImplementVelocityControl ( yarp::dev::IVelocityControlRaw *  y)

Constructor.

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

Definition at line 21 of file ImplementVelocityControl.cpp.

◆ ~ImplementVelocityControl()

ImplementVelocityControl::~ImplementVelocityControl ( )
virtual

Destructor.

Definition at line 26 of file ImplementVelocityControl.cpp.

Member Function Documentation

◆ getAxes()

ReturnValue ImplementVelocityControl::getAxes ( size_t &  axes)
overridevirtual

Get the number of controlled axes.

This command asks the number of controlled axes for the current physical interface. param axes pointer to storage

Returns
true/false.

Implements yarp::dev::IVelocityControl.

Definition at line 57 of file ImplementVelocityControl.cpp.

◆ getTargetVelocities() [1/2]

ReturnValue ImplementVelocityControl::getTargetVelocities ( const int  n_joint,
const int *  joints,
double *  vels 
)
overridevirtual

Get the last reference speed set by velocityMove for a group of joints.

Parameters
n_jointhow many joints this command is referring to
jointsof joints controlled. The size of this array is n_joints
velspointer to the array containing the requested values, one value for each joint. The size of the array is n_joints.
Returns
true/false on success/failure

Implements yarp::dev::IVelocityControl.

Definition at line 128 of file ImplementVelocityControl.cpp.

◆ getTargetVelocities() [2/2]

ReturnValue ImplementVelocityControl::getTargetVelocities ( double *  vels)
overridevirtual

Get the last reference speed set by velocityMove for all joints.

Parameters
velspointer to the array containing the new speed values, one value for each joint
Returns
true/false on success/failure

Implements yarp::dev::IVelocityControl.

Definition at line 118 of file ImplementVelocityControl.cpp.

◆ getTargetVelocity()

ReturnValue ImplementVelocityControl::getTargetVelocity ( const int  joint,
double *  vel 
)
overridevirtual

Get the last reference speed set by velocityMove for single joint.

Parameters
jjoint number
velreturns the requested reference.
Returns
true/false on success/failure

Implements yarp::dev::IVelocityControl.

Definition at line 104 of file ImplementVelocityControl.cpp.

◆ getTrajAcceleration()

ReturnValue ImplementVelocityControl::getTrajAcceleration ( int  j,
double *  acc 
)
overridevirtual

Get reference acceleration for a joint.

Returns the acceleration used to generate the trajectory profile.

Parameters
jjoint number
accpointer to storage for the return value
Returns
true/false on success/failure

Implements yarp::dev::IVelocityControl.

Definition at line 193 of file ImplementVelocityControl.cpp.

◆ getTrajAccelerations() [1/2]

ReturnValue ImplementVelocityControl::getTrajAccelerations ( const int  n_joint,
const int *  joints,
double *  accs 
)
overridevirtual

Get reference acceleration for a subset of joints.

These are the values used during the interpolation of the trajectory.

Parameters
n_jointhow many joints this command is referring to
jointslist of joints controlled. The size of this array is n_joints
accspointer to the array containing acceleration values, one value for each joint, the size of the array is n_joints. The first value will be the new reference for the joint joints[0]. for example: n_joint 3 joints 0 2 4 accs 10 30 40
Returns
true/false on success/failure

Implements yarp::dev::IVelocityControl.

Definition at line 207 of file ImplementVelocityControl.cpp.

◆ getTrajAccelerations() [2/2]

ReturnValue ImplementVelocityControl::getTrajAccelerations ( double *  accs)
overridevirtual

Get reference acceleration of all joints.

These are the values used during the interpolation of the trajectory.

Parameters
accspointer to the array that will store the acceleration values.
Returns
true/false on success or failure

Implements yarp::dev::IVelocityControl.

Definition at line 233 of file ImplementVelocityControl.cpp.

◆ initialize()

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

◆ setTrajAcceleration()

ReturnValue ImplementVelocityControl::setTrajAcceleration ( int  j,
double  acc 
)
overridevirtual

Set reference acceleration for a joint.

This value is used during the trajectory generation.

Parameters
jjoint number
accacceleration value
Returns
true/false upon success/failure

Implements yarp::dev::IVelocityControl.

Definition at line 153 of file ImplementVelocityControl.cpp.

◆ setTrajAccelerations() [1/2]

ReturnValue ImplementVelocityControl::setTrajAccelerations ( const double *  accs)
overridevirtual

Set reference acceleration on all joints.

This is the value that is used during the generation of the trajectory.

Parameters
accspointer to the array of acceleration values
Returns
true/false upon success/failure

Implements yarp::dev::IVelocityControl.

Definition at line 183 of file ImplementVelocityControl.cpp.

◆ setTrajAccelerations() [2/2]

ReturnValue ImplementVelocityControl::setTrajAccelerations ( const int  n_joint,
const int *  joints,
const double *  accs 
)
overridevirtual

Set reference acceleration for a subset of joints.

This is the value that is used during the generation of the trajectory.

Parameters
n_jointhow many joints this command is referring to
jointslist of joints controlled. The size of this array is n_joints
accspointer to the array containing acceleration values, one value for each joint, the size of the array is n_joints. The first value will be the new reference for the joint joints[0]. for example: n_joint 3 joints 0 2 4 accs 10 30 40
Returns
true/false on success/failure

Implements yarp::dev::IVelocityControl.

Definition at line 164 of file ImplementVelocityControl.cpp.

◆ stop() [1/3]

ReturnValue ImplementVelocityControl::stop ( )
overridevirtual

Stop motion, multiple joints.

Returns
true/false on success or failure

Implements yarp::dev::IVelocityControl.

Definition at line 270 of file ImplementVelocityControl.cpp.

◆ stop() [2/3]

ReturnValue ImplementVelocityControl::stop ( const int  n_joint,
const int *  joints 
)
overridevirtual

Stop motion for a subset of joints.

Parameters
n_jointhow many joints this command is referring to
jointsjoints pointer to the array of joint numbers
Returns
true/false on success or failure

Implements yarp::dev::IVelocityControl.

Definition at line 255 of file ImplementVelocityControl.cpp.

◆ stop() [3/3]

ReturnValue ImplementVelocityControl::stop ( int  j)
overridevirtual

Stop motion, single joint.

Parameters
jjoint number
Returns
true/false on success or failure

Implements yarp::dev::IVelocityControl.

Definition at line 244 of file ImplementVelocityControl.cpp.

◆ uninitialize()

bool ImplementVelocityControl::uninitialize ( )
protected

Clean up internal data and memory.

Returns
true if uninitialization is executed, false otherwise.

Definition at line 46 of file ImplementVelocityControl.cpp.

◆ velocityMove() [1/3]

ReturnValue ImplementVelocityControl::velocityMove ( const double *  sp)
overridevirtual

Start motion at a given speed, multiple joints.

Parameters
sppointer to the array containing the new speed values
Returns
true/false upon success/failure

Implements yarp::dev::IVelocityControl.

Definition at line 94 of file ImplementVelocityControl.cpp.

◆ velocityMove() [2/3]

ReturnValue ImplementVelocityControl::velocityMove ( const int  n_joint,
const int *  joints,
const double *  spds 
)
overridevirtual

Start motion at a given speed for a subset of joints.

Parameters
n_jointhow many joints this command is referring to
jointsof joints controlled. The size of this array is n_joints
spdspointer to the array containing the new speed values, one value for each joint, the size of the array is n_joints. The first value will be the new reference for the joint joints[0]. for example: n_joint 3 joints 0 2 4 spds 10 30 40
Returns
true/false on success/failure

Implements yarp::dev::IVelocityControl.

Definition at line 74 of file ImplementVelocityControl.cpp.

◆ velocityMove() [3/3]

ReturnValue ImplementVelocityControl::velocityMove ( int  j,
double  sp 
)
overridevirtual

Start motion at a given speed, single joint.

Parameters
jjoint number
spspeed value
Returns
bool/false upon success/failure

Implements yarp::dev::IVelocityControl.

Definition at line 63 of file ImplementVelocityControl.cpp.

Member Data Documentation

◆ m_buffer_doubles

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

Definition at line 32 of file ImplementVelocityControl.h.

◆ m_buffer_ints

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

Definition at line 31 of file ImplementVelocityControl.h.

◆ m_helper

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

Definition at line 30 of file ImplementVelocityControl.h.

◆ m_imp_mutex

std::mutex yarp::dev::ImplementVelocityControl::m_imp_mutex
protected

Definition at line 33 of file ImplementVelocityControl.h.

◆ m_iraw

IVelocityControlRaw* yarp::dev::ImplementVelocityControl::m_iraw =nullptr
protected

Definition at line 29 of file ImplementVelocityControl.h.


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