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

#include <yarp/dev/ImplementCurrentControl.h>

+ Inheritance diagram for yarp::dev::ImplementCurrentControl:

Public Member Functions

 ImplementCurrentControl (yarp::dev::ICurrentControlRaw *y)
 
virtual ~ImplementCurrentControl ()
 Destructor.
 
yarp::dev::ReturnValue getNumberOfMotors (int *ax) override
 Retrieves the number of controlled axes from the current physical interface.
 
yarp::dev::ReturnValue getRefCurrent (int j, double *) override
 Get the reference value of the current for a single motor.
 
yarp::dev::ReturnValue getRefCurrents (double *t) override
 Get the reference value of the currents for all motors.
 
yarp::dev::ReturnValue setRefCurrents (const double *t) override
 Set the reference value of the currents for all motors.
 
yarp::dev::ReturnValue setRefCurrent (int j, double t) override
 Set the reference value of the current for a single motor.
 
yarp::dev::ReturnValue setRefCurrents (const int n_joint, const int *joints, const double *t) override
 Set the reference value of the current for a group of motors.
 
yarp::dev::ReturnValue getCurrents (double *t) override
 Get the instantaneous current measurement for all motors.
 
yarp::dev::ReturnValue getCurrent (int j, double *t) override
 Get the instantaneous current measurement for a single motor.
 
yarp::dev::ReturnValue getCurrentRange (int j, double *min, double *max) override
 Get the full scale of the current measurement for a given motor (e.g.
 
yarp::dev::ReturnValue getCurrentRanges (double *min, double *max) override
 Get the full scale of the current measurements for all motors motor (e.g.
 
- Public Member Functions inherited from yarp::dev::ICurrentControl
virtual ~ICurrentControl ()
 Destructor.
 

Protected Member Functions

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

Protected Attributes

yarp::dev::ICurrentControlRaw * 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 ImplementCurrentControl.h.

Constructor & Destructor Documentation

◆ ImplementCurrentControl()

ImplementCurrentControl::ImplementCurrentControl ( yarp::dev::ICurrentControlRaw *  y)

Definition at line 19 of file ImplementCurrentControl.cpp.

◆ ~ImplementCurrentControl()

ImplementCurrentControl::~ImplementCurrentControl ( )
virtual

Destructor.

Perform uninitialize if needed.

Definition at line 24 of file ImplementCurrentControl.cpp.

Member Function Documentation

◆ getCurrent()

ReturnValue ImplementCurrentControl::getCurrent ( int  m,
double *  curr 
)
overridevirtual

Get the instantaneous current measurement for a single motor.

Parameters
mmotor number
currpointer to the result value. Value is expressed in amperes.
Returns
true/false on success/failure

Implements yarp::dev::ICurrentControl.

Definition at line 141 of file ImplementCurrentControl.cpp.

◆ getCurrentRange()

ReturnValue ImplementCurrentControl::getCurrentRange ( int  m,
double *  min,
double *  max 
)
overridevirtual

Get the full scale of the current measurement for a given motor (e.g.

-20A +20A) Reference values set by user with methods such as setRefCurrent() should be in this range. This method is not related to the current overload protection methods belonging to the iAmplifierControl interface.

Parameters
mmotor number
minminimum current of the motor m
maxmaximum current of the motor m
Returns
true/false on success/failure

Implements yarp::dev::ICurrentControl.

Definition at line 169 of file ImplementCurrentControl.cpp.

◆ getCurrentRanges()

ReturnValue ImplementCurrentControl::getCurrentRanges ( double *  min,
double *  max 
)
overridevirtual

Get the full scale of the current measurements for all motors motor (e.g.

-20A +20A) Reference values set by user with methods such as setRefCurrent() should be in this range. This method is not related to the current overload protection methods belonging to the iAmplifierControl interface.

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

Implements yarp::dev::ICurrentControl.

Definition at line 156 of file ImplementCurrentControl.cpp.

◆ getCurrents()

ReturnValue ImplementCurrentControl::getCurrents ( double *  currs)
overridevirtual

Get the instantaneous current measurement for all motors.

Parameters
currspointer to the array that will store the output. Values are expressed in amperes.
Returns
true/false on success/failure

Implements yarp::dev::ICurrentControl.

Definition at line 112 of file ImplementCurrentControl.cpp.

◆ getNumberOfMotors()

ReturnValue ImplementCurrentControl::getNumberOfMotors ( int *  ax)
overridevirtual

Retrieves the number of controlled axes from the current physical interface.

Parameters
axreturns the number of controlled axes.
Returns
true/false on success/failure

Implements yarp::dev::ICurrentControl.

Definition at line 56 of file ImplementCurrentControl.cpp.

◆ getRefCurrent()

ReturnValue ImplementCurrentControl::getRefCurrent ( int  m,
double *  curr 
)
overridevirtual

Get the reference value of the current for a single motor.

Parameters
mmotor number
currthe current reference value for motor m. Value is expressed in amperes.
Returns
true/false on success/failure

Implements yarp::dev::ICurrentControl.

Definition at line 64 of file ImplementCurrentControl.cpp.

◆ getRefCurrents()

ReturnValue ImplementCurrentControl::getRefCurrents ( double *  currs)
overridevirtual

Get the reference value of the currents for all motors.

Parameters
currspointer to the array to be filled with reference current values. Values are expressed in amperes.
Returns
true/false on success/failure

Implements yarp::dev::ICurrentControl.

Definition at line 79 of file ImplementCurrentControl.cpp.

◆ initialize()

bool ImplementCurrentControl::initialize ( int  size,
const int *  amap,
const double *  ampsToSens 
)
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.
Returns
true if initialized succeeded, false if it wasn't executed, or assert.

Definition at line 29 of file ImplementCurrentControl.cpp.

◆ setRefCurrent()

ReturnValue ImplementCurrentControl::setRefCurrent ( int  m,
double  curr 
)
overridevirtual

Set the reference value of the current for a single motor.

Parameters
mmotor number
currthe current reference value for motor m. Value is expressed in amperes.
Returns
true/false on success/failure

Implements yarp::dev::ICurrentControl.

Definition at line 101 of file ImplementCurrentControl.cpp.

◆ setRefCurrents() [1/2]

ReturnValue ImplementCurrentControl::setRefCurrents ( const double *  currs)
overridevirtual

Set the reference value of the currents for all motors.

Parameters
currsthe array containing the reference current values. Values are expressed in amperes.
Returns
true/false on success/failure

Implements yarp::dev::ICurrentControl.

Definition at line 90 of file ImplementCurrentControl.cpp.

◆ setRefCurrents() [2/2]

ReturnValue ImplementCurrentControl::setRefCurrents ( const int  n_motor,
const int *  motors,
const double *  currs 
)
overridevirtual

Set the reference value of the current for a group of motors.

Parameters
n_motorsize of motors ans currs arrays
motorspointer to the array containing the list of motor numbers
currspointer to the array specifying the new current references
Returns
true/false on success/failure

Implements yarp::dev::ICurrentControl.

Definition at line 123 of file ImplementCurrentControl.cpp.

◆ uninitialize()

bool ImplementCurrentControl::uninitialize ( )
protected

Clean up internal data and memory.

Returns
true if uninitialization is executed, false otherwise.

Definition at line 45 of file ImplementCurrentControl.cpp.

Member Data Documentation

◆ m_buffer_doubles

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

Definition at line 29 of file ImplementCurrentControl.h.

◆ m_buffer_doubles2

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

Definition at line 30 of file ImplementCurrentControl.h.

◆ m_buffer_ints

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

Definition at line 28 of file ImplementCurrentControl.h.

◆ m_helper

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

Definition at line 27 of file ImplementCurrentControl.h.

◆ m_imp_mutex

std::mutex yarp::dev::ImplementCurrentControl::m_imp_mutex
protected

Definition at line 31 of file ImplementCurrentControl.h.

◆ m_iraw

yarp::dev::ICurrentControlRaw* yarp::dev::ImplementCurrentControl::m_iraw =nullptr
protected

Definition at line 26 of file ImplementCurrentControl.h.


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