YARP
Yet Another Robot Platform
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. More...
 
bool getNumberOfMotors (int *ax) override
 Retrieves the number of controlled axes from the current physical interface. More...
 
bool getRefCurrent (int j, double *) override
 Get the reference value of the current for a single motor. More...
 
bool getRefCurrents (double *t) override
 Get the reference value of the currents for all motors. More...
 
bool setRefCurrents (const double *t) override
 Set the reference value of the currents for all motors. More...
 
bool setRefCurrent (int j, double t) override
 Set the reference value of the current for a single motor. More...
 
bool setRefCurrents (const int n_joint, const int *joints, const double *t) override
 Set the reference value of the current for a group of motors. More...
 
bool getCurrents (double *t) override
 Get the instantaneous current measurement for all motors. More...
 
bool getCurrent (int j, double *t) override
 Get the instantaneous current measurement for a single motor. More...
 
bool getCurrentRange (int j, double *min, double *max) override
 Get the full scale of the current measurement for a given motor (e.g. More...
 
bool getCurrentRanges (double *min, double *max) override
 Get the full scale of the current measurements for all motors motor (e.g. More...
 
- Public Member Functions inherited from yarp::dev::ICurrentControl
virtual ~ICurrentControl ()
 Destructor. More...
 

Protected Member Functions

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

Protected Attributes

yarp::dev::ICurrentControlRawiCurrentRaw
 
void * helper
 
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
 
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
 

Detailed Description

Definition at line 32 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 26 of file ImplementCurrentControl.cpp.

Member Function Documentation

◆ getCurrent()

bool 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 145 of file ImplementCurrentControl.cpp.

◆ getCurrentRange()

bool 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()

bool 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 157 of file ImplementCurrentControl.cpp.

◆ getCurrents()

bool 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 115 of file ImplementCurrentControl.cpp.

◆ getNumberOfMotors()

bool 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 71 of file ImplementCurrentControl.cpp.

◆ getRefCurrent()

bool 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 76 of file ImplementCurrentControl.cpp.

◆ getRefCurrents()

bool 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 88 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 31 of file ImplementCurrentControl.cpp.

◆ setRefCurrent()

bool 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 106 of file ImplementCurrentControl.cpp.

◆ setRefCurrents() [1/2]

bool 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 97 of file ImplementCurrentControl.cpp.

◆ setRefCurrents() [2/2]

bool 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 124 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 48 of file ImplementCurrentControl.cpp.

Member Data Documentation

◆ doubleBuffManager

yarp::dev::impl::FixedSizeBuffersManager<double>* yarp::dev::ImplementCurrentControl::doubleBuffManager
protected

Definition at line 38 of file ImplementCurrentControl.h.

◆ helper

void* yarp::dev::ImplementCurrentControl::helper
protected

Definition at line 36 of file ImplementCurrentControl.h.

◆ iCurrentRaw

yarp::dev::ICurrentControlRaw* yarp::dev::ImplementCurrentControl::iCurrentRaw
protected

Definition at line 35 of file ImplementCurrentControl.h.

◆ intBuffManager

yarp::dev::impl::FixedSizeBuffersManager<int>* yarp::dev::ImplementCurrentControl::intBuffManager
protected

Definition at line 37 of file ImplementCurrentControl.h.


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