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.
 
bool getNumberOfMotors (int *ax) override
 Retrieves the number of controlled axes from the current physical interface.
 
bool getRefCurrent (int j, double *) override
 Get the reference value of the current for a single motor.
 
bool getRefCurrents (double *t) override
 Get the reference value of the currents for all motors.
 
bool setRefCurrents (const double *t) override
 Set the reference value of the currents for all motors.
 
bool setRefCurrent (int j, double t) override
 Set the reference value of the current for a single motor.
 
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.
 
bool getCurrents (double *t) override
 Get the instantaneous current measurement for all motors.
 
bool getCurrent (int j, double *t) override
 Get the instantaneous current measurement for a single motor.
 
bool getCurrentRange (int j, double *min, double *max) override
 Get the full scale of the current measurement for a given motor (e.g.
 
bool 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::ICurrentControlRawiCurrentRaw
 
void * helper
 
yarp::dev::impl::FixedSizeBuffersManager< int > * intBuffManager
 
yarp::dev::impl::FixedSizeBuffersManager< double > * doubleBuffManager
 

Detailed Description

Definition at line 23 of file ImplementCurrentControl.h.

Constructor & Destructor Documentation

◆ ImplementCurrentControl()

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

Definition at line 16 of file ImplementCurrentControl.cpp.

◆ ~ImplementCurrentControl()

ImplementCurrentControl::~ImplementCurrentControl ( )
virtual

Destructor.

Perform uninitialize if needed.

Definition at line 23 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 144 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 168 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 156 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 113 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 69 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 74 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 86 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 28 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 104 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 95 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 122 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 46 of file ImplementCurrentControl.cpp.

Member Data Documentation

◆ doubleBuffManager

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

Definition at line 29 of file ImplementCurrentControl.h.

◆ helper

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

Definition at line 27 of file ImplementCurrentControl.h.

◆ iCurrentRaw

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

Definition at line 26 of file ImplementCurrentControl.h.

◆ intBuffManager

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

Definition at line 28 of file ImplementCurrentControl.h.


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