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.
 
yarp::dev::ReturnValue getLastJointFaultRaw (int j, int &fault, std::string &message) override
 
yarp::dev::ReturnValue getNumberOfMotorEncodersRaw (int *num) override
 Get the number of available motor encoders.
 
yarp::dev::ReturnValue resetMotorEncoderRaw (int j) override
 Reset motor encoder, single motor.
 
yarp::dev::ReturnValue resetMotorEncodersRaw () override
 Reset motor encoders.
 
yarp::dev::ReturnValue setMotorEncoderRaw (int j, double val) override
 Set the value of the motor encoder for a given motor.
 
yarp::dev::ReturnValue setMotorEncodersRaw (const double *vals) override
 Set the value of all motor encoders.
 
yarp::dev::ReturnValue getMotorEncoderRaw (int j, double *v) override
 Read the value of a motor encoder.
 
yarp::dev::ReturnValue getMotorEncodersRaw (double *encs) override
 Read the position of all motor encoders.
 
yarp::dev::ReturnValue getMotorEncoderSpeedRaw (int j, double *sp) override
 Read the instantaneous speed of a motor encoder.
 
yarp::dev::ReturnValue getMotorEncoderSpeedsRaw (double *spds) override
 Read the instantaneous speed of all motor encoders.
 
yarp::dev::ReturnValue getMotorEncoderAccelerationRaw (int j, double *spds) override
 Read the instantaneous acceleration of a motor encoder.
 
yarp::dev::ReturnValue getMotorEncoderAccelerationsRaw (double *accs) override
 Read the instantaneous acceleration of all motor encoders.
 
yarp::dev::ReturnValue getMotorEncodersTimedRaw (double *encs, double *stamps) override
 Read the instantaneous position of all motor encoders.
 
yarp::dev::ReturnValue getMotorEncoderTimedRaw (int m, double *encs, double *stamp) override
 Read the instantaneous position of a motor encoder.
 
yarp::dev::ReturnValue getMotorEncoderCountsPerRevolutionRaw (int m, double *v) override
 Gets number of counts per revolution for motor encoder m.
 
yarp::dev::ReturnValue setMotorEncoderCountsPerRevolutionRaw (int m, const double cpr) override
 Sets number of counts per revolution for motor encoder m.
 
yarp::dev::ReturnValue getAxes (size_t &ax) override
 Get the number of controlled axes.
 
yarp::dev::ReturnValue resetEncoderRaw (int j) override
 Reset encoder, single joint.
 
yarp::dev::ReturnValue resetEncodersRaw () override
 Reset encoders.
 
yarp::dev::ReturnValue setEncoderRaw (int j, double val) override
 Set the value of the encoder for a given joint.
 
yarp::dev::ReturnValue setEncodersRaw (const double *vals) override
 Set the value of all encoders.
 
yarp::dev::ReturnValue getEncoderRaw (int j, double *v) override
 Read the value of an encoder.
 
yarp::dev::ReturnValue getEncodersRaw (double *encs) override
 Read the position of all axes.
 
yarp::dev::ReturnValue getEncoderSpeedRaw (int j, double *sp) override
 Read the instantaneous speed of an axis.
 
yarp::dev::ReturnValue getEncoderSpeedsRaw (double *spds) override
 Read the instantaneous acceleration of an axis.
 
yarp::dev::ReturnValue getEncoderAccelerationRaw (int j, double *spds) override
 Read the instantaneous acceleration of an axis.
 
yarp::dev::ReturnValue getEncoderAccelerationsRaw (double *accs) override
 Read the instantaneous acceleration of all axes.
 
yarp::dev::ReturnValue getEncodersTimedRaw (double *encs, double *stamps) override
 Read the instantaneous acceleration of all axes.
 
yarp::dev::ReturnValue getEncoderTimedRaw (int j, double *encs, double *stamp) override
 Read the instantaneous acceleration of all axes.
 
yarp::dev::ReturnValue getAxisNameRaw (int axis, std::string &name) override
 
yarp::dev::ReturnValue 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
 
DeviceDriver & operator= (const DeviceDriver &other)=delete
 
DeviceDriver & operator= (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 DeviceDriver * getImplementation ()
 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.
 
yarp::dev::ReturnValue 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 ()
 
yarp::dev::ReturnValue getAxes (size_t &ax) override
 Get the number of controlled axes.
 
yarp::dev::ReturnValue getAxisName (int axis, std::string &name) override
 
yarp::dev::ReturnValue 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 ()
 
yarp::dev::ReturnValue getAxes (size_t &ax) override
 Get the number of controlled axes.
 
yarp::dev::ReturnValue resetEncoder (int j) override
 Reset encoder, single joint.
 
yarp::dev::ReturnValue resetEncoders () override
 Reset encoders.
 
yarp::dev::ReturnValue setEncoder (int j, double val) override
 Set the value of the encoder for a given joint.
 
yarp::dev::ReturnValue setEncoders (const double *vals) override
 Set the value of all encoders.
 
yarp::dev::ReturnValue getEncoder (int j, double *v) override
 Read the value of an encoder.
 
yarp::dev::ReturnValue getEncodersTimed (double *encs, double *time) override
 Read the instantaneous acceleration of all axes.
 
yarp::dev::ReturnValue getEncoderTimed (int j, double *v, double *t) override
 Read the instantaneous acceleration of all axes.
 
yarp::dev::ReturnValue getEncoders (double *encs) override
 Read the position of all axes.
 
yarp::dev::ReturnValue getEncoderSpeed (int j, double *spds) override
 Read the istantaneous speed of an axis.
 
yarp::dev::ReturnValue getEncoderSpeeds (double *spds) override
 Read the instantaneous speed of all axes.
 
yarp::dev::ReturnValue getEncoderAcceleration (int j, double *spds) override
 Read the instantaneous acceleration of an axis.
 
yarp::dev::ReturnValue 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 ()
 
yarp::dev::ReturnValue getNumberOfMotorEncoders (int *num) override
 Get the number of available motor encoders.
 
yarp::dev::ReturnValue resetMotorEncoder (int m) override
 Reset motor encoder, single motor.
 
yarp::dev::ReturnValue resetMotorEncoders () override
 Reset motor encoders.
 
yarp::dev::ReturnValue setMotorEncoder (int m, const double val) override
 Set the value of the motor encoder for a given motor.
 
yarp::dev::ReturnValue setMotorEncoders (const double *vals) override
 Set the value of all motor encoders.
 
yarp::dev::ReturnValue setMotorEncoderCountsPerRevolution (int m, const double cpr) override
 Sets number of counts per revolution for motor encoder m.
 
yarp::dev::ReturnValue getMotorEncoderCountsPerRevolution (int m, double *cpr) override
 Gets number of counts per revolution for motor encoder m.
 
yarp::dev::ReturnValue getMotorEncoder (int m, double *v) override
 Read the value of a motor encoder.
 
yarp::dev::ReturnValue getMotorEncodersTimed (double *encs, double *time) override
 Read the instantaneous position of all motor encoders.
 
yarp::dev::ReturnValue getMotorEncoderTimed (int m, double *v, double *t) override
 Read the instantaneous position of a motor encoder.
 
yarp::dev::ReturnValue getMotorEncoders (double *encs) override
 Read the position of all motor encoders.
 
yarp::dev::ReturnValue getMotorEncoderSpeed (int m, double *spds) override
 Read the instantaneous speed of a motor encoder.
 
yarp::dev::ReturnValue getMotorEncoderSpeeds (double *spds) override
 Read the instantaneous speed of all motor encoders.
 
yarp::dev::ReturnValue getMotorEncoderAcceleration (int m, double *spds) override
 Read the instantaneous acceleration of a motor encoder.
 
yarp::dev::ReturnValue 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.
 
bool getParamValue (const std::string &paramName, std::string &paramValue) const override
 Return the value (represented as a string) of the requested parameter.
 
std::string getConfiguration () const override
 Return the configuration of 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 = {}
 
std::string m_provided_configuration
 
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::IJointFaultRaw * m_iraw =nullptr
 
void * m_helper =nullptr
 
std::mutex m_imp_mutex
 
std::vector< int > m_buffer_ints
 
std::vector< double > m_buffer_doubles
 
- Protected Attributes inherited from yarp::dev::ImplementAxisInfo
IAxisInfoRaw * 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
 
- Protected Attributes inherited from yarp::dev::ImplementEncodersTimed
IEncodersTimedRaw * 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
 
- Protected Attributes inherited from yarp::dev::ImplementMotorEncoders
IMotorEncodersRaw * 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

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 146 of file FakeMotionControlMicro.cpp.

◆ ~FakeMotionControlMicro()

FakeMotionControlMicro::~FakeMotionControlMicro ( )

Definition at line 170 of file FakeMotionControlMicro.cpp.

Member Function Documentation

◆ alloc()

bool FakeMotionControlMicro::alloc ( int  njoints)

Allocated buffers.

Definition at line 113 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 331 of file FakeMotionControlMicro.cpp.

◆ fromConfig()

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

Definition at line 248 of file FakeMotionControlMicro.cpp.

◆ getAxes()

ReturnValue FakeMotionControlMicro::getAxes ( size_t &  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 589 of file FakeMotionControlMicro.cpp.

◆ getAxisNameRaw()

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

Implements yarp::dev::IAxisInfoRaw.

Definition at line 567 of file FakeMotionControlMicro.cpp.

◆ getEncoderAccelerationRaw()

ReturnValue 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 415 of file FakeMotionControlMicro.cpp.

◆ getEncoderAccelerationsRaw()

ReturnValue 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 423 of file FakeMotionControlMicro.cpp.

◆ getEncoderRaw()

ReturnValue 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 375 of file FakeMotionControlMicro.cpp.

◆ getEncoderSpeedRaw()

ReturnValue 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 398 of file FakeMotionControlMicro.cpp.

◆ getEncoderSpeedsRaw()

ReturnValue 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 405 of file FakeMotionControlMicro.cpp.

◆ getEncodersRaw()

ReturnValue 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 386 of file FakeMotionControlMicro.cpp.

◆ getEncodersTimedRaw()

ReturnValue 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 435 of file FakeMotionControlMicro.cpp.

◆ getEncoderTimedRaw()

ReturnValue 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 446 of file FakeMotionControlMicro.cpp.

◆ getJointTypeRaw()

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

Reimplemented from yarp::dev::IAxisInfoRaw.

Definition at line 574 of file FakeMotionControlMicro.cpp.

◆ getLastJointFaultRaw()

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

Implements yarp::dev::IJointFaultRaw.

Definition at line 580 of file FakeMotionControlMicro.cpp.

◆ getMotorEncoderAccelerationRaw()

ReturnValue 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 527 of file FakeMotionControlMicro.cpp.

◆ getMotorEncoderAccelerationsRaw()

ReturnValue 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 533 of file FakeMotionControlMicro.cpp.

◆ getMotorEncoderCountsPerRevolutionRaw()

ReturnValue 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 479 of file FakeMotionControlMicro.cpp.

◆ getMotorEncoderRaw()

ReturnValue 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 494 of file FakeMotionControlMicro.cpp.

◆ getMotorEncoderSpeedRaw()

ReturnValue FakeMotionControlMicro::getMotorEncoderSpeedRaw ( int  m,
double *  sp 
)
overridevirtual

Read the instantaneous 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 511 of file FakeMotionControlMicro.cpp.

◆ getMotorEncoderSpeedsRaw()

ReturnValue 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 517 of file FakeMotionControlMicro.cpp.

◆ getMotorEncodersRaw()

ReturnValue 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 500 of file FakeMotionControlMicro.cpp.

◆ getMotorEncodersTimedRaw()

ReturnValue 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 543 of file FakeMotionControlMicro.cpp.

◆ getMotorEncoderTimedRaw()

ReturnValue 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 555 of file FakeMotionControlMicro.cpp.

◆ getNumberOfMotorEncodersRaw()

ReturnValue 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 458 of file FakeMotionControlMicro.cpp.

◆ initialised()

bool FakeMotionControlMicro::initialised ( )
virtual

Definition at line 176 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. 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 196 of file FakeMotionControlMicro.cpp.

◆ resetEncoderRaw()

ReturnValue 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 365 of file FakeMotionControlMicro.cpp.

◆ resetEncodersRaw()

ReturnValue FakeMotionControlMicro::resetEncodersRaw ( )
overridevirtual

Reset encoders.

Set the encoders value to zero

Returns
true/false

Implements yarp::dev::IEncodersRaw.

Definition at line 370 of file FakeMotionControlMicro.cpp.

◆ resetMotorEncoderRaw()

ReturnValue 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 484 of file FakeMotionControlMicro.cpp.

◆ resetMotorEncodersRaw()

ReturnValue FakeMotionControlMicro::resetMotorEncodersRaw ( )
overridevirtual

Reset motor encoders.

Set the motor encoders value to zero.

Returns
true/false

Implements yarp::dev::IMotorEncodersRaw.

Definition at line 489 of file FakeMotionControlMicro.cpp.

◆ resizeBuffers()

void FakeMotionControlMicro::resizeBuffers ( )

Resize previously allocated buffers.

Definition at line 94 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 35 of file FakeMotionControlMicro.cpp.

◆ setEncoderRaw()

ReturnValue 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 355 of file FakeMotionControlMicro.cpp.

◆ setEncodersRaw()

ReturnValue 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 360 of file FakeMotionControlMicro.cpp.

◆ setMotorEncoderCountsPerRevolutionRaw()

ReturnValue 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 474 of file FakeMotionControlMicro.cpp.

◆ setMotorEncoderRaw()

ReturnValue 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 464 of file FakeMotionControlMicro.cpp.

◆ setMotorEncodersRaw()

ReturnValue 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 469 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 181 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 192 of file FakeMotionControlMicro.cpp.


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