YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches

fakeMotionControlMicro: This device implements a minimal subset of mandatory interfaces to run with controlBoard_nws_yarp. More...

#include <fake/fakeMotionControlMicro/FakeMotionControlMicro.h>

+ Inheritance diagram for FakeMotionControlMicro:

Public Member Functions

 FakeMotionControlMicro ()
 
 ~FakeMotionControlMicro ()
 
bool open (yarp::os::Searchable &par) override
 Open the DeviceDriver.
 
bool close () override
 Close the DeviceDriver.
 
bool fromConfig (yarp::os::Searchable &config)
 
virtual bool initialised ()
 
bool alloc (int njoints)
 Allocated buffers.
 
void resizeBuffers ()
 Resize previously allocated buffers.
 
bool threadInit () override
 Initialization method.
 
void threadRelease () override
 Release method.
 
bool getLastJointFaultRaw (int j, int &fault, std::string &message) override
 
bool getNumberOfMotorEncodersRaw (int *num) override
 Get the number of available motor encoders.
 
bool resetMotorEncoderRaw (int j) override
 Reset motor encoder, single motor.
 
bool resetMotorEncodersRaw () override
 Reset motor encoders.
 
bool setMotorEncoderRaw (int j, double val) override
 Set the value of the motor encoder for a given motor.
 
bool setMotorEncodersRaw (const double *vals) override
 Set the value of all motor encoders.
 
bool getMotorEncoderRaw (int j, double *v) override
 Read the value of a motor encoder.
 
bool getMotorEncodersRaw (double *encs) override
 Read the position of all motor encoders.
 
bool getMotorEncoderSpeedRaw (int j, double *sp) override
 Read the istantaneous speed of a motor encoder.
 
bool getMotorEncoderSpeedsRaw (double *spds) override
 Read the instantaneous speed of all motor encoders.
 
bool getMotorEncoderAccelerationRaw (int j, double *spds) override
 Read the instantaneous acceleration of a motor encoder.
 
bool getMotorEncoderAccelerationsRaw (double *accs) override
 Read the instantaneous acceleration of all motor encoders.
 
bool getMotorEncodersTimedRaw (double *encs, double *stamps) override
 Read the instantaneous position of all motor encoders.
 
bool getMotorEncoderTimedRaw (int m, double *encs, double *stamp) override
 Read the instantaneous position of a motor encoder.
 
bool getMotorEncoderCountsPerRevolutionRaw (int m, double *v) override
 Gets number of counts per revolution for motor encoder m.
 
bool setMotorEncoderCountsPerRevolutionRaw (int m, const double cpr) override
 Sets number of counts per revolution for motor encoder m.
 
bool getAxes (int *ax) override
 Get the number of controlled axes.
 
bool resetEncoderRaw (int j) override
 Reset encoder, single joint.
 
bool resetEncodersRaw () override
 Reset encoders.
 
bool setEncoderRaw (int j, double val) override
 Set the value of the encoder for a given joint.
 
bool setEncodersRaw (const double *vals) override
 Set the value of all encoders.
 
bool getEncoderRaw (int j, double *v) override
 Read the value of an encoder.
 
bool getEncodersRaw (double *encs) override
 Read the position of all axes.
 
bool getEncoderSpeedRaw (int j, double *sp) override
 Read the instantaneous speed of an axis.
 
bool getEncoderSpeedsRaw (double *spds) override
 Read the instantaneous acceleration of an axis.
 
bool getEncoderAccelerationRaw (int j, double *spds) override
 Read the instantaneous acceleration of an axis.
 
bool getEncoderAccelerationsRaw (double *accs) override
 Read the instantaneous acceleration of all axes.
 
bool getEncodersTimedRaw (double *encs, double *stamps) override
 Read the instantaneous acceleration of all axes.
 
bool getEncoderTimedRaw (int j, double *encs, double *stamp) override
 Read the instantaneous acceleration of all axes.
 
bool getAxisNameRaw (int axis, std::string &name) override
 
bool getJointTypeRaw (int axis, yarp::dev::JointTypeEnum &type) override
 
void run () override
 Loop function.
 
- Public Member Functions inherited from yarp::os::PeriodicThread
 PeriodicThread (double period, ShouldUseSystemClock useSystemClock=ShouldUseSystemClock::No, PeriodicThreadClock clockAccuracy=PeriodicThreadClock::Relative)
 Constructor.
 
 PeriodicThread (double period, PeriodicThreadClock clockAccuracy)
 Constructor.
 
virtual ~PeriodicThread ()
 
bool start ()
 Call this to start the thread.
 
void step ()
 Call this to "step" the thread rather than starting it.
 
void stop ()
 Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() called).
 
void askToStop ()
 Stop the thread.
 
bool isRunning () const
 Returns true when the thread is started, false otherwise.
 
bool isSuspended () const
 Returns true when the thread is suspended, false otherwise.
 
bool setPeriod (double period)
 Set the (new) period of the thread.
 
double getPeriod () const
 Return the current period of the thread.
 
void suspend ()
 Suspend the thread, the thread keeps running by doLoop is never executed.
 
void resume ()
 Resume the thread if previously suspended.
 
void resetStat ()
 Reset thread statistics.
 
double getEstimatedPeriod () const
 Return estimated period since last reset.
 
void getEstimatedPeriod (double &av, double &std) const
 Return estimated period since last reset.
 
unsigned int getIterations () const
 Return the number of iterations performed since last reset.
 
double getEstimatedUsed () const
 Return the estimated duration of the run() function since last reset.
 
void getEstimatedUsed (double &av, double &std) const
 Return estimated duration of the run() function since last reset.
 
int setPriority (int priority, int policy=-1)
 Set the priority and scheduling policy of the thread, if the OS supports that.
 
int getPriority () const
 Query the current priority of the thread, if the OS supports that.
 
int getPolicy () const
 Query the current scheduling policy of the thread, if the OS supports that.
 
- Public Member Functions inherited from yarp::dev::DeviceDriver
 DeviceDriver ()
 
 DeviceDriver (const DeviceDriver &other)=delete
 
 DeviceDriver (DeviceDriver &&other) noexcept=delete
 
DeviceDriveroperator= (const DeviceDriver &other)=delete
 
DeviceDriveroperator= (DeviceDriver &&other) noexcept=delete
 
virtual ~DeviceDriver ()
 
virtual std::string id () const
 Return the id assigned to the PolyDriver.
 
virtual void setId (const std::string &id)
 Set the id for this device.
 
template<class T >
bool view (T *&x)
 Get an interface to the device driver.
 
virtual DeviceDrivergetImplementation ()
 Some drivers are bureaucrats, pointing at others.
 
- Public Member Functions inherited from yarp::dev::IEncodersTimedRaw
virtual ~IEncodersTimedRaw ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::IEncodersRaw
virtual ~IEncodersRaw ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::IMotorEncodersRaw
virtual ~IMotorEncodersRaw ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::IAxisInfoRaw
virtual ~IAxisInfoRaw ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::IJointFaultRaw
virtual ~IJointFaultRaw ()
 
- Public Member Functions inherited from yarp::dev::ImplementJointFault
 ImplementJointFault (yarp::dev::IJointFaultRaw *y)
 
virtual ~ImplementJointFault ()
 Destructor.
 
bool getLastJointFault (int j, int &fault, std::string &message) override
 
- Public Member Functions inherited from yarp::dev::IJointFault
virtual ~IJointFault ()
 
- Public Member Functions inherited from yarp::dev::ImplementAxisInfo
 ImplementAxisInfo (yarp::dev::IAxisInfoRaw *y)
 
virtual ~ImplementAxisInfo ()
 
bool getAxes (int *ax) override
 Get the number of controlled axes.
 
bool getAxisName (int axis, std::string &name) override
 
bool getJointType (int axis, yarp::dev::JointTypeEnum &type) override
 
- Public Member Functions inherited from yarp::dev::IAxisInfo
virtual ~IAxisInfo ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::ImplementEncodersTimed
 ImplementEncodersTimed (yarp::dev::IEncodersTimedRaw *y)
 
virtual ~ImplementEncodersTimed ()
 
bool getAxes (int *ax) override
 Get the number of controlled axes.
 
bool resetEncoder (int j) override
 Reset encoder, single joint.
 
bool resetEncoders () override
 Reset encoders.
 
bool setEncoder (int j, double val) override
 Set the value of the encoder for a given joint.
 
bool setEncoders (const double *vals) override
 Set the value of all encoders.
 
bool getEncoder (int j, double *v) override
 Read the value of an encoder.
 
bool getEncodersTimed (double *encs, double *time) override
 Read the instantaneous acceleration of all axes.
 
bool getEncoderTimed (int j, double *v, double *t) override
 Read the instantaneous acceleration of all axes.
 
bool getEncoders (double *encs) override
 Read the position of all axes.
 
bool getEncoderSpeed (int j, double *spds) override
 Read the istantaneous speed of an axis.
 
bool getEncoderSpeeds (double *spds) override
 Read the instantaneous speed of all axes.
 
bool getEncoderAcceleration (int j, double *spds) override
 Read the instantaneous acceleration of an axis.
 
bool getEncoderAccelerations (double *accs) override
 Read the instantaneous acceleration of all axes.
 
- Public Member Functions inherited from yarp::dev::IEncodersTimed
virtual ~IEncodersTimed ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::IEncoders
virtual ~IEncoders ()
 Destructor.
 
- Public Member Functions inherited from yarp::dev::ImplementMotorEncoders
 ImplementMotorEncoders (yarp::dev::IMotorEncodersRaw *y)
 
virtual ~ImplementMotorEncoders ()
 
bool getNumberOfMotorEncoders (int *num) override
 Get the number of available motor encoders.
 
bool resetMotorEncoder (int m) override
 Reset motor encoder, single motor.
 
bool resetMotorEncoders () override
 Reset motor encoders.
 
bool setMotorEncoder (int m, const double val) override
 Set the value of the motor encoder for a given motor.
 
bool setMotorEncoders (const double *vals) override
 Set the value of all motor encoders.
 
bool setMotorEncoderCountsPerRevolution (int m, const double cpr) override
 Sets number of counts per revolution for motor encoder m.
 
bool getMotorEncoderCountsPerRevolution (int m, double *cpr) override
 Gets number of counts per revolution for motor encoder m.
 
bool getMotorEncoder (int m, double *v) override
 Read the value of a motor encoder.
 
bool getMotorEncodersTimed (double *encs, double *time) override
 Read the instantaneous position of all motor encoders.
 
bool getMotorEncoderTimed (int m, double *v, double *t) override
 Read the instantaneous position of a motor encoder.
 
bool getMotorEncoders (double *encs) override
 Read the position of all motor encoders.
 
bool getMotorEncoderSpeed (int m, double *spds) override
 Read the istantaneous speed of a motor encoder.
 
bool getMotorEncoderSpeeds (double *spds) override
 Read the instantaneous speed of all motor encoders.
 
bool getMotorEncoderAcceleration (int m, double *spds) override
 Read the instantaneous acceleration of a motor encoder.
 
bool getMotorEncoderAccelerations (double *accs) override
 Read the instantaneous acceleration of all motor encoders.
 
- Public Member Functions inherited from yarp::dev::IMotorEncoders
virtual ~IMotorEncoders ()
 Destructor.
 
- Public Member Functions inherited from FakeMotionControlMicro_ParamsParser
 FakeMotionControlMicro_ParamsParser ()
 
 ~FakeMotionControlMicro_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
std::string getDocumentationOfDeviceParams () const override
 Get the documentation of the DeviceDriver's parameters.
 
std::vector< std::string > getListOfParams () const override
 Return a list of all params used by the device.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Additional Inherited Members

- Public Attributes inherited from FakeMotionControlMicro_ParamsParser
const std::string m_device_classname = {"FakeMotionControlMicro"}
 
const std::string m_device_name = {"fakeMotionControlMicro"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
const std::string m_GENERAL_Joints_defaultValue = {"1"}
 
const std::string m_GENERAL_AxisMap_defaultValue = {""}
 
const std::string m_GENERAL_AxisName_defaultValue = {""}
 
const std::string m_GENERAL_AxisType_defaultValue = {""}
 
const std::string m_GENERAL_Encoder_defaultValue = {""}
 
int m_GENERAL_Joints = {1}
 
std::vector< int > m_GENERAL_AxisMap = {}
 
std::vector< std::string > m_GENERAL_AxisName = {}
 
std::vector< std::string > m_GENERAL_AxisType = {}
 
std::vector< int > m_GENERAL_Encoder = {}
 
- Protected Member Functions inherited from yarp::os::PeriodicThread
virtual void beforeStart ()
 Called just before a new thread starts.
 
virtual void afterStart (bool success)
 Called just after a new thread starts (or fails to start), this is executed by the same thread that calls start().
 
- Protected Member Functions inherited from yarp::dev::ImplementJointFault
bool initialize (int size, const int *amap)
 Initialize the internal data and alloc memory.
 
bool uninitialize ()
 Clean up internal data and memory.
 
- Protected Member Functions inherited from yarp::dev::ImplementAxisInfo
bool initialize (int size, const int *amap)
 Initialize the internal data and alloc memory.
 
bool uninitialize ()
 Clean up internal data and memory.
 
- Protected Member Functions inherited from yarp::dev::ImplementEncodersTimed
bool initialize (int size, const int *amap, const double *enc, const double *zos)
 Initialize the internal data and alloc memory.
 
bool uninitialize ()
 Clean up internal data and memory.
 
- Protected Member Functions inherited from yarp::dev::ImplementMotorEncoders
bool initialize (int size, const int *amap, const double *enc, const double *zos)
 Initialize the internal data and alloc memory.
 
bool uninitialize ()
 Clean up internal data and memory.
 
- Protected Attributes inherited from yarp::dev::ImplementJointFault
yarp::dev::IJointFaultRawraw
 
void * helper
 
- Protected Attributes inherited from yarp::dev::ImplementAxisInfo
IAxisInfoRawiinfo
 
void * helper
 
double * temp1
 
double * temp2
 
- Protected Attributes inherited from yarp::dev::ImplementEncodersTimed
IEncodersTimedRawiEncoders
 
void * helper
 
yarp::dev::impl::FixedSizeBuffersManager< double > * buffManager
 
- Protected Attributes inherited from yarp::dev::ImplementMotorEncoders
IMotorEncodersRawiMotorEncoders
 
void * helper
 
yarp::dev::impl::FixedSizeBuffersManager< double > * buffManager
 

Detailed Description

fakeMotionControlMicro: This device implements a minimal subset of mandatory interfaces to run with controlBoard_nws_yarp.

It is thus a smaller, limited version than fakeMotionControl.

Parameters required by this device are shown in class: FakeMotionControlMicro_ParamsParser

Definition at line 30 of file FakeMotionControlMicro.h.

Constructor & Destructor Documentation

◆ FakeMotionControlMicro()

FakeMotionControlMicro::FakeMotionControlMicro ( )

Definition at line 145 of file FakeMotionControlMicro.cpp.

◆ ~FakeMotionControlMicro()

FakeMotionControlMicro::~FakeMotionControlMicro ( )

Definition at line 169 of file FakeMotionControlMicro.cpp.

Member Function Documentation

◆ alloc()

bool FakeMotionControlMicro::alloc ( int  njoints)

Allocated buffers.

Definition at line 112 of file FakeMotionControlMicro.cpp.

◆ close()

bool FakeMotionControlMicro::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 330 of file FakeMotionControlMicro.cpp.

◆ fromConfig()

bool FakeMotionControlMicro::fromConfig ( yarp::os::Searchable config)

Definition at line 247 of file FakeMotionControlMicro.cpp.

◆ getAxes()

bool FakeMotionControlMicro::getAxes ( int 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::IEncodersRaw.

Definition at line 602 of file FakeMotionControlMicro.cpp.

◆ getAxisNameRaw()

bool FakeMotionControlMicro::getAxisNameRaw ( int  axis,
std::string &  name 
)
overridevirtual

Implements yarp::dev::IAxisInfoRaw.

Definition at line 566 of file FakeMotionControlMicro.cpp.

◆ getEncoderAccelerationRaw()

bool FakeMotionControlMicro::getEncoderAccelerationRaw ( int  j,
double spds 
)
overridevirtual

Read the instantaneous acceleration of an axis.

Parameters
jaxis number
spdspointer to the array that will contain the output

Implements yarp::dev::IEncodersRaw.

Definition at line 414 of file FakeMotionControlMicro.cpp.

◆ getEncoderAccelerationsRaw()

bool FakeMotionControlMicro::getEncoderAccelerationsRaw ( double accs)
overridevirtual

Read the instantaneous acceleration of all axes.

Parameters
accspointer to the array that will contain the output
Returns
true if all goes well, false if anything bad happens.

Implements yarp::dev::IEncodersRaw.

Definition at line 422 of file FakeMotionControlMicro.cpp.

◆ getEncoderRaw()

bool FakeMotionControlMicro::getEncoderRaw ( int  j,
double v 
)
overridevirtual

Read the value of an encoder.

Parameters
jencoder number
vpointer to storage for the return value
Returns
true/false, upon success/failure (you knew it, uh?)

Implements yarp::dev::IEncodersRaw.

Definition at line 374 of file FakeMotionControlMicro.cpp.

◆ getEncoderSpeedRaw()

bool FakeMotionControlMicro::getEncoderSpeedRaw ( int  j,
double sp 
)
overridevirtual

Read the instantaneous speed of an axis.

Parameters
jaxis number
sppointer to storage for the output
Returns
true if successful, false ... otherwise.

Implements yarp::dev::IEncodersRaw.

Definition at line 397 of file FakeMotionControlMicro.cpp.

◆ getEncoderSpeedsRaw()

bool FakeMotionControlMicro::getEncoderSpeedsRaw ( double spds)
overridevirtual

Read the instantaneous acceleration of an axis.

Parameters
spdspointer to storage for the output values
Returns
guess what? (true/false on success or failure).

Implements yarp::dev::IEncodersRaw.

Definition at line 404 of file FakeMotionControlMicro.cpp.

◆ getEncodersRaw()

bool FakeMotionControlMicro::getEncodersRaw ( double encs)
overridevirtual

Read the position of all axes.

Parameters
encspointer to the array that will contain the output
Returns
true/false on success/failure

Implements yarp::dev::IEncodersRaw.

Definition at line 385 of file FakeMotionControlMicro.cpp.

◆ getEncodersTimedRaw()

bool FakeMotionControlMicro::getEncodersTimedRaw ( double encs,
double stamps 
)
overridevirtual

Read the instantaneous acceleration of all axes.

Parameters
encspointer to the array that will contain the output
stampspointer to the array that will contain individual timestamps
Returns
return true if all goes well, false if anything bad happens.

Implements yarp::dev::IEncodersTimedRaw.

Definition at line 434 of file FakeMotionControlMicro.cpp.

◆ getEncoderTimedRaw()

bool FakeMotionControlMicro::getEncoderTimedRaw ( int  j,
double encs,
double stamp 
)
overridevirtual

Read the instantaneous acceleration of all axes.

Parameters
jaxis index
encsencoder value
stampcorresponding timestamp
Returns
true if all goes well, false if anything bad happens.

Implements yarp::dev::IEncodersTimedRaw.

Definition at line 445 of file FakeMotionControlMicro.cpp.

◆ getJointTypeRaw()

bool FakeMotionControlMicro::getJointTypeRaw ( int  axis,
yarp::dev::JointTypeEnum type 
)
overridevirtual

Reimplemented from yarp::dev::IAxisInfoRaw.

Definition at line 580 of file FakeMotionControlMicro.cpp.

◆ getLastJointFaultRaw()

bool FakeMotionControlMicro::getLastJointFaultRaw ( int  j,
int fault,
std::string &  message 
)
overridevirtual

Implements yarp::dev::IJointFaultRaw.

Definition at line 593 of file FakeMotionControlMicro.cpp.

◆ getMotorEncoderAccelerationRaw()

bool FakeMotionControlMicro::getMotorEncoderAccelerationRaw ( int  m,
double spds 
)
overridevirtual

Read the instantaneous acceleration of a motor encoder.

Parameters
mmotor number
accpointer to the array that will contain the output
Returns
true if successful, false otherwise.

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 526 of file FakeMotionControlMicro.cpp.

◆ getMotorEncoderAccelerationsRaw()

bool FakeMotionControlMicro::getMotorEncoderAccelerationsRaw ( double accs)
overridevirtual

Read the instantaneous acceleration of all motor encoders.

Parameters
accspointer to the array that will contain the output
Returns
true if successful, false otherwise.

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 532 of file FakeMotionControlMicro.cpp.

◆ getMotorEncoderCountsPerRevolutionRaw()

bool FakeMotionControlMicro::getMotorEncoderCountsPerRevolutionRaw ( int  m,
double cpr 
)
overridevirtual

Gets number of counts per revolution for motor encoder m.

Parameters
mmotor number
cprvals pointer to the new value
Returns
true/false

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 478 of file FakeMotionControlMicro.cpp.

◆ getMotorEncoderRaw()

bool FakeMotionControlMicro::getMotorEncoderRaw ( int  m,
double v 
)
overridevirtual

Read the value of a motor encoder.

Parameters
mmotor encoder number
vpointer to storage for the return value
Returns
true/false

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 493 of file FakeMotionControlMicro.cpp.

◆ getMotorEncoderSpeedRaw()

bool FakeMotionControlMicro::getMotorEncoderSpeedRaw ( int  m,
double sp 
)
overridevirtual

Read the istantaneous speed of a motor encoder.

Parameters
mmotor number
sppointer to storage for the output
Returns
true if successful, false otherwise.

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 510 of file FakeMotionControlMicro.cpp.

◆ getMotorEncoderSpeedsRaw()

bool FakeMotionControlMicro::getMotorEncoderSpeedsRaw ( double spds)
overridevirtual

Read the instantaneous speed of all motor encoders.

Parameters
spdspointer to storage for the output values
Returns
true if successful, false otherwise.

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 516 of file FakeMotionControlMicro.cpp.

◆ getMotorEncodersRaw()

bool FakeMotionControlMicro::getMotorEncodersRaw ( double encs)
overridevirtual

Read the position of all motor encoders.

Parameters
encspointer to the array that will contain the output
Returns
true/false

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 499 of file FakeMotionControlMicro.cpp.

◆ getMotorEncodersTimedRaw()

bool FakeMotionControlMicro::getMotorEncodersTimedRaw ( double encs,
double stamps 
)
overridevirtual

Read the instantaneous position of all motor encoders.

Parameters
encspointer to the array that will contain the output
timepointer to the array that will contain individual timestamps
Returns
true if successful, false otherwise.

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 542 of file FakeMotionControlMicro.cpp.

◆ getMotorEncoderTimedRaw()

bool FakeMotionControlMicro::getMotorEncoderTimedRaw ( int  m,
double encs,
double stamp 
)
overridevirtual

Read the instantaneous position of a motor encoder.

Parameters
mmotor index
encsencoder value (pointer to)
timecorresponding timestamp (pointer to)
Returns
true if successful, false otherwise.

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 554 of file FakeMotionControlMicro.cpp.

◆ getNumberOfMotorEncodersRaw()

bool FakeMotionControlMicro::getNumberOfMotorEncodersRaw ( int num)
overridevirtual

Get the number of available motor encoders.

Parameters
mpointer to a value representing the number of available motor encoders.
Returns
true/false

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 457 of file FakeMotionControlMicro.cpp.

◆ initialised()

bool FakeMotionControlMicro::initialised ( )
virtual

Definition at line 175 of file FakeMotionControlMicro.cpp.

◆ open()

bool FakeMotionControlMicro::open ( yarp::os::Searchable config)
overridevirtual

Open the DeviceDriver.

Parameters
configis a list of parameters for the device. Which parameters are effective for your device can vary. See device invocation examples. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 195 of file FakeMotionControlMicro.cpp.

◆ resetEncoderRaw()

bool FakeMotionControlMicro::resetEncoderRaw ( int  j)
overridevirtual

Reset encoder, single joint.

Set the encoder value to zero

Parameters
jencoder number
Returns
true/false

Implements yarp::dev::IEncodersRaw.

Definition at line 364 of file FakeMotionControlMicro.cpp.

◆ resetEncodersRaw()

bool FakeMotionControlMicro::resetEncodersRaw ( )
overridevirtual

Reset encoders.

Set the encoders value to zero

Returns
true/false

Implements yarp::dev::IEncodersRaw.

Definition at line 369 of file FakeMotionControlMicro.cpp.

◆ resetMotorEncoderRaw()

bool FakeMotionControlMicro::resetMotorEncoderRaw ( int  m)
overridevirtual

Reset motor encoder, single motor.

Set the encoder value to zero.

Parameters
mmotor number
Returns
true/false

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 483 of file FakeMotionControlMicro.cpp.

◆ resetMotorEncodersRaw()

bool FakeMotionControlMicro::resetMotorEncodersRaw ( )
overridevirtual

Reset motor encoders.

Set the motor encoders value to zero.

Returns
true/false

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 488 of file FakeMotionControlMicro.cpp.

◆ resizeBuffers()

void FakeMotionControlMicro::resizeBuffers ( )

Resize previously allocated buffers.

Definition at line 93 of file FakeMotionControlMicro.cpp.

◆ run()

void FakeMotionControlMicro::run ( )
overridevirtual

Loop function.

This is the thread itself. The thread calls the run() function every <period> ms. At the end of each run, the thread will sleep the amounth of time required, taking into account the time spent inside the loop function. Example: requested period is 10ms, the run() function take 3ms to be executed, the thread will sleep for 7ms.

Note: after each run is completed, the thread will call a yield() in order to facilitate other threads to run.

Implements yarp::os::PeriodicThread.

Definition at line 34 of file FakeMotionControlMicro.cpp.

◆ setEncoderRaw()

bool FakeMotionControlMicro::setEncoderRaw ( int  j,
double  val 
)
overridevirtual

Set the value of the encoder for a given joint.

Parameters
jencoder number
valnew value
Returns
true/false

Implements yarp::dev::IEncodersRaw.

Definition at line 354 of file FakeMotionControlMicro.cpp.

◆ setEncodersRaw()

bool FakeMotionControlMicro::setEncodersRaw ( const double vals)
overridevirtual

Set the value of all encoders.

Parameters
valspointer to the new values
Returns
true/false

Implements yarp::dev::IEncodersRaw.

Definition at line 359 of file FakeMotionControlMicro.cpp.

◆ setMotorEncoderCountsPerRevolutionRaw()

bool FakeMotionControlMicro::setMotorEncoderCountsPerRevolutionRaw ( int  m,
const double  cpr 
)
overridevirtual

Sets number of counts per revolution for motor encoder m.

Parameters
mmotor number
cprnew value
Returns
true/false

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 473 of file FakeMotionControlMicro.cpp.

◆ setMotorEncoderRaw()

bool FakeMotionControlMicro::setMotorEncoderRaw ( int  m,
double  val 
)
overridevirtual

Set the value of the motor encoder for a given motor.

Parameters
mmotor number
valnew value
Returns
true/false

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 463 of file FakeMotionControlMicro.cpp.

◆ setMotorEncodersRaw()

bool FakeMotionControlMicro::setMotorEncodersRaw ( const double vals)
overridevirtual

Set the value of all motor encoders.

Parameters
valspointer to the new values
Returns
true/false

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 468 of file FakeMotionControlMicro.cpp.

◆ threadInit()

bool FakeMotionControlMicro::threadInit ( )
overridevirtual

Initialization method.

The thread executes this function when it starts and before "run". This is a good place to perform initialization tasks that need to be done by the thread itself (device drivers initialization, memory allocation etc). If the function returns false the thread quits and never calls "run". The return value of threadInit() is notified to the class and passed as a parameter to afterStart(). Note that afterStart() is called by the same thread that is executing the "start" method.

Reimplemented from yarp::os::PeriodicThread.

Definition at line 180 of file FakeMotionControlMicro.cpp.

◆ threadRelease()

void FakeMotionControlMicro::threadRelease ( )
overridevirtual

Release method.

The thread executes this function once when it exits, after the last "run". This is a good place to release resources that were initialized in threadInit() (release memory, and device driver resources).

Reimplemented from yarp::os::PeriodicThread.

Definition at line 191 of file FakeMotionControlMicro.cpp.


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