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

#include <yarp/dev/ImplementTorqueControl.h>

+ Inheritance diagram for yarp::dev::ImplementTorqueControl:

Public Member Functions

 ImplementTorqueControl (yarp::dev::ITorqueControlRaw *y)
 
virtual ~ImplementTorqueControl ()
 Destructor.
 
yarp::dev::ReturnValue getAxes (size_t &ax) override
 Get the number of controlled axes.
 
yarp::dev::ReturnValue getRefTorque (int j, double *) override
 Get the reference value of the torque for a given joint.
 
yarp::dev::ReturnValue getRefTorques (double *t) override
 Get the reference value of the torque for all joints.
 
yarp::dev::ReturnValue setRefTorques (const double *t) override
 Set the reference value of the torque for all joints.
 
yarp::dev::ReturnValue setRefTorque (int j, double t) override
 Set the reference value of the torque for a given joint.
 
yarp::dev::ReturnValue setRefTorques (const int n_joint, const int *joints, const double *t) override
 Set new torque reference for a subset of joints.
 
yarp::dev::ReturnValue getTorques (double *t) override
 Get the value of the torque for all joints (this is the feedback if you have torque sensors).
 
yarp::dev::ReturnValue getTorque (int j, double *t) override
 Get the value of the torque on a given joint (this is the feedback if you have a torque sensor).
 
yarp::dev::ReturnValue setMotorTorqueParams (int j, const yarp::dev::MotorTorqueParameters params) override
 Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
 
yarp::dev::ReturnValue getMotorTorqueParams (int j, yarp::dev::MotorTorqueParameters *params) override
 Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
 
yarp::dev::ReturnValue getTorqueRange (int j, double *min, double *max) override
 Get the full scale of the torque sensor of a given joint.
 
yarp::dev::ReturnValue getTorqueRanges (double *min, double *max) override
 Get the full scale of the torque sensors of all joints.
 
- Public Member Functions inherited from yarp::dev::ITorqueControl
virtual ~ITorqueControl ()
 Destructor.
 

Protected Member Functions

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

Protected Attributes

yarp::dev::ITorqueControlRaw * 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 23 of file ImplementTorqueControl.h.

Constructor & Destructor Documentation

◆ ImplementTorqueControl()

ImplementTorqueControl::ImplementTorqueControl ( yarp::dev::ITorqueControlRaw *  y)

Definition at line 19 of file ImplementTorqueControl.cpp.

◆ ~ImplementTorqueControl()

ImplementTorqueControl::~ImplementTorqueControl ( )
virtual

Destructor.

Perform uninitialize if needed.

Definition at line 24 of file ImplementTorqueControl.cpp.

Member Function Documentation

◆ getAxes()

ReturnValue ImplementTorqueControl::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::ITorqueControl.

Definition at line 56 of file ImplementTorqueControl.cpp.

◆ getMotorTorqueParams()

ReturnValue ImplementTorqueControl::getMotorTorqueParams ( int  j,
yarp::dev::MotorTorqueParameters *  params 
)
overridevirtual

Get a subset of motor parameters (bemf, ktau etc) useful for torque control.

Parameters
jjoint number
paramsa struct containing the motor parameters to be retrieved
Returns
true/false on success/failure

Implements yarp::dev::ITorqueControl.

Definition at line 100 of file ImplementTorqueControl.cpp.

◆ getRefTorque()

ReturnValue ImplementTorqueControl::getRefTorque ( int  j,
double *  t 
)
overridevirtual

Get the reference value of the torque for a given joint.

This is NOT the feedback (see getTorque instead).

Parameters
jjoint number
tthe returned reference torque of joint j
Returns
true/false on success/failure

Implements yarp::dev::ITorqueControl.

Definition at line 63 of file ImplementTorqueControl.cpp.

◆ getRefTorques()

ReturnValue ImplementTorqueControl::getRefTorques ( double *  t)
overridevirtual

Get the reference value of the torque for all joints.

This is NOT the feedback (see getTorques instead).

Parameters
tpointer to the array of torque values
Returns
true/false on success/failure

Implements yarp::dev::ITorqueControl.

Definition at line 128 of file ImplementTorqueControl.cpp.

◆ getTorque()

ReturnValue ImplementTorqueControl::getTorque ( int  j,
double *  t 
)
overridevirtual

Get the value of the torque on a given joint (this is the feedback if you have a torque sensor).

Parameters
jjoint number
tpointer to the result value
Returns
true/false on success/failure

Implements yarp::dev::ITorqueControl.

Definition at line 189 of file ImplementTorqueControl.cpp.

◆ getTorqueRange()

ReturnValue ImplementTorqueControl::getTorqueRange ( int  j,
double *  min,
double *  max 
)
overridevirtual

Get the full scale of the torque sensor of a given joint.

Parameters
jjoint number
minminimum torque of the joint j
maxmaximum torque of the joint j
Returns
true/false on success/failure

Implements yarp::dev::ITorqueControl.

Definition at line 213 of file ImplementTorqueControl.cpp.

◆ getTorqueRanges()

ReturnValue ImplementTorqueControl::getTorqueRanges ( double *  min,
double *  max 
)
overridevirtual

Get the full scale of the torque sensors of all joints.

Parameters
minpointer to the array that will store minimum torques of the joints
maxpointer to the array that will store maximum torques of the joints
Returns
true/false on success/failure

Implements yarp::dev::ITorqueControl.

Definition at line 200 of file ImplementTorqueControl.cpp.

◆ getTorques()

ReturnValue ImplementTorqueControl::getTorques ( double *  t)
overridevirtual

Get the value of the torque for all joints (this is the feedback if you have torque sensors).

Parameters
tpointer to the array that will store the output
Returns
true/false on success/failure

Implements yarp::dev::ITorqueControl.

Definition at line 161 of file ImplementTorqueControl.cpp.

◆ initialize()

bool ImplementTorqueControl::initialize ( int  size,
const int *  amap,
const double *  enc,
const double *  zos,
const double *  nw,
const double *  amps,
const double *  dutys,
const double *  bemfs,
const double *  ktaus 
)
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 29 of file ImplementTorqueControl.cpp.

◆ setMotorTorqueParams()

ReturnValue ImplementTorqueControl::setMotorTorqueParams ( int  j,
const yarp::dev::MotorTorqueParameters  params 
)
overridevirtual

Set a subset of motor parameters (bemf, ktau etc) useful for torque control.

Parameters
jjoint number
paramsa struct containing the motor parameters to be set
Returns
true/false on success/failure

Implements yarp::dev::ITorqueControl.

Definition at line 78 of file ImplementTorqueControl.cpp.

◆ setRefTorque()

ReturnValue ImplementTorqueControl::setRefTorque ( int  j,
double  t 
)
overridevirtual

Set the reference value of the torque for a given joint.

Parameters
jjoint number
tnew value
Returns
true/false on success/failure

Implements yarp::dev::ITorqueControl.

Definition at line 150 of file ImplementTorqueControl.cpp.

◆ setRefTorques() [1/2]

ReturnValue ImplementTorqueControl::setRefTorques ( const double *  t)
overridevirtual

Set the reference value of the torque for all joints.

Parameters
tpointer to the array of torque values
Returns
true/false on success/failure

Implements yarp::dev::ITorqueControl.

Definition at line 139 of file ImplementTorqueControl.cpp.

◆ setRefTorques() [2/2]

ReturnValue ImplementTorqueControl::setRefTorques ( const int  n_joint,
const int *  joints,
const double *  t 
)
overridevirtual

Set new torque reference for a subset of joints.

Parameters
jointspointer to the array of joint numbers
refspointer to the array specifying the new torque reference
Returns
true/false on success/failure

Implements yarp::dev::ITorqueControl.

Definition at line 172 of file ImplementTorqueControl.cpp.

◆ uninitialize()

bool ImplementTorqueControl::uninitialize ( )
protected

Clean up internal data and memory.

Returns
true if uninitialization is executed, false otherwise.

Definition at line 45 of file ImplementTorqueControl.cpp.

Member Data Documentation

◆ m_buffer_doubles

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

Definition at line 29 of file ImplementTorqueControl.h.

◆ m_buffer_doubles2

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

Definition at line 30 of file ImplementTorqueControl.h.

◆ m_buffer_ints

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

Definition at line 28 of file ImplementTorqueControl.h.

◆ m_helper

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

Definition at line 27 of file ImplementTorqueControl.h.

◆ m_imp_mutex

std::mutex yarp::dev::ImplementTorqueControl::m_imp_mutex
protected

Definition at line 31 of file ImplementTorqueControl.h.

◆ m_iraw

yarp::dev::ITorqueControlRaw* yarp::dev::ImplementTorqueControl::m_iraw =nullptr
protected

Definition at line 26 of file ImplementTorqueControl.h.


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