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

#include <yarp/dev/ImplementMotor.h>

+ Inheritance diagram for yarp::dev::ImplementMotor:

Public Member Functions

 ImplementMotor (yarp::dev::IMotorRaw *y)
 
virtual ~ImplementMotor ()
 
yarp::dev::ReturnValue getNumberOfMotors (int *num) override
 Get the number of available motors.
 
yarp::dev::ReturnValue getTemperature (int m, double *val) override
 Get temperature of a motor.
 
yarp::dev::ReturnValue getTemperatures (double *vals) override
 Get temperature of all the motors.
 
yarp::dev::ReturnValue getTemperatureLimit (int m, double *val) override
 Retrieves the current temperature limit for a specific motor.
 
yarp::dev::ReturnValue setTemperatureLimit (int m, const double val) override
 Set the temperature limit for a specific motor.
 
yarp::dev::ReturnValue getGearboxRatio (int m, double *val) override
 Get the gearbox ratio for a specific motor.
 
yarp::dev::ReturnValue setGearboxRatio (int m, const double val) override
 Set the gearbox ratio for a specific motor.
 
- Public Member Functions inherited from yarp::dev::IMotor
virtual ~IMotor ()
 Destructor.
 

Protected Member Functions

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

Protected Attributes

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

Constructor & Destructor Documentation

◆ ImplementMotor()

ImplementMotor::ImplementMotor ( yarp::dev::IMotorRaw *  y)

Definition at line 19 of file ImplementMotor.cpp.

◆ ~ImplementMotor()

ImplementMotor::~ImplementMotor ( )
virtual

Definition at line 24 of file ImplementMotor.cpp.

Member Function Documentation

◆ getGearboxRatio()

ReturnValue ImplementMotor::getGearboxRatio ( int  m,
double *  val 
)
overridevirtual

Get the gearbox ratio for a specific motor.

Parameters
mmotor number
valretrieved gearbox ratio
Returns
true/false

Implements yarp::dev::IMotor.

Definition at line 109 of file ImplementMotor.cpp.

◆ getNumberOfMotors()

ReturnValue ImplementMotor::getNumberOfMotors ( int *  num)
overridevirtual

Get the number of available motors.

Parameters
numretrieved number of available motors
Returns
true/false

Implements yarp::dev::IMotor.

Definition at line 59 of file ImplementMotor.cpp.

◆ getTemperature()

ReturnValue ImplementMotor::getTemperature ( int  m,
double *  val 
)
overridevirtual

Get temperature of a motor.

Parameters
mmotor number
valretrieved motor temperature
Returns
true/false

Implements yarp::dev::IMotor.

Definition at line 68 of file ImplementMotor.cpp.

◆ getTemperatureLimit()

ReturnValue ImplementMotor::getTemperatureLimit ( int  m,
double *  temp 
)
overridevirtual

Retrieves the current temperature limit for a specific motor.

The specific behavior of the motor when the temperature limit is exceeded depends on the implementation (power off recommended)

Parameters
mmotor number
tempthe current temperature limit.
Returns
true/false

Implements yarp::dev::IMotor.

Definition at line 82 of file ImplementMotor.cpp.

◆ getTemperatures()

ReturnValue ImplementMotor::getTemperatures ( double *  vals)
overridevirtual

Get temperature of all the motors.

Parameters
valspointer to an array containing all motor temperatures
Returns
true/false

Implements yarp::dev::IMotor.

Definition at line 136 of file ImplementMotor.cpp.

◆ initialize()

bool ImplementMotor::initialize ( int  size,
const int *  amap 
)
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 ImplementMotor.cpp.

◆ setGearboxRatio()

ReturnValue ImplementMotor::setGearboxRatio ( int  m,
const double  val 
)
overridevirtual

Set the gearbox ratio for a specific motor.

Parameters
mmotor number
gearboxratio to be set
Returns
true/false

Implements yarp::dev::IMotor.

Definition at line 123 of file ImplementMotor.cpp.

◆ setTemperatureLimit()

ReturnValue ImplementMotor::setTemperatureLimit ( int  m,
const double  temp 
)
overridevirtual

Set the temperature limit for a specific motor.

The specific behavior of the motor when the temperature limit is exceeded depends on the implementation (power off recommended)

Parameters
mmotor number
tempthe temperature limit to be set
Returns
true/false

Implements yarp::dev::IMotor.

Definition at line 96 of file ImplementMotor.cpp.

◆ uninitialize()

bool ImplementMotor::uninitialize ( )
protected

Clean up internal data and memory.

Returns
true if uninitialization is executed, false otherwise.

Definition at line 48 of file ImplementMotor.cpp.

Member Data Documentation

◆ m_buffer_doubles

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

Definition at line 29 of file ImplementMotor.h.

◆ m_buffer_ints

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

Definition at line 28 of file ImplementMotor.h.

◆ m_helper

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

Definition at line 27 of file ImplementMotor.h.

◆ m_imp_mutex

std::mutex yarp::dev::ImplementMotor::m_imp_mutex
protected

Definition at line 30 of file ImplementMotor.h.

◆ m_iraw

yarp::dev::IMotorRaw* yarp::dev::ImplementMotor::m_iraw =nullptr
protected

Definition at line 26 of file ImplementMotor.h.


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