fakeMotor
: A fake motor control board for testing.
More...
#include <fakeMotor/FakeMotor.h>
Public Member Functions | |
FakeMotor ()=default | |
FakeMotor (const FakeMotor &)=delete | |
FakeMotor (FakeMotor &&)=delete | |
FakeMotor & | operator= (const FakeMotor &)=delete |
FakeMotor & | operator= (FakeMotor &&)=delete |
~FakeMotor () override=default | |
bool | getAxes (int *ax) override |
Get the number of controlled axes. More... | |
bool | open (yarp::os::Searchable &config) override |
Open the DeviceDriver. More... | |
bool | positionMove (int j, double ref) override |
Set new reference point for a single axis. More... | |
bool | positionMove (const double *refs) override |
Set new reference point for all axes. More... | |
bool | relativeMove (int j, double delta) override |
Set relative position. More... | |
bool | relativeMove (const double *deltas) override |
Set relative position, all joints. More... | |
bool | checkMotionDone (int j, bool *flag) override |
Check if the current trajectory is terminated. More... | |
bool | checkMotionDone (bool *flag) override |
Check if the current trajectory is terminated. More... | |
bool | setRefSpeed (int j, double sp) override |
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory. More... | |
bool | setRefSpeeds (const double *spds) override |
Set reference speed on all joints. More... | |
bool | setRefAcceleration (int j, double acc) override |
Set reference acceleration for a joint. More... | |
bool | setRefAccelerations (const double *accs) override |
Set reference acceleration on all joints. More... | |
bool | getRefSpeed (int j, double *ref) override |
Get reference speed for a joint. More... | |
bool | getRefSpeeds (double *spds) override |
Get reference speed of all joints. More... | |
bool | getRefAcceleration (int j, double *acc) override |
Get reference acceleration for a joint. More... | |
bool | getRefAccelerations (double *accs) override |
Get reference acceleration of all joints. More... | |
bool | stop (int j) override |
Stop motion, single joint. More... | |
bool | stop () override |
Stop motion, multiple joints. More... | |
bool | positionMove (const int n_joint, const int *joints, const double *refs) override |
Set new reference point for a subset of joints. More... | |
bool | relativeMove (const int n_joint, const int *joints, const double *deltas) override |
Set relative position for a subset of joints. More... | |
bool | checkMotionDone (const int n_joint, const int *joints, bool *flags) override |
Check if the current trajectory is terminated. More... | |
bool | setRefSpeeds (const int n_joint, const int *joints, const double *spds) override |
Set reference speed on all joints. More... | |
bool | setRefAccelerations (const int n_joint, const int *joints, const double *accs) override |
Set reference acceleration on all joints. More... | |
bool | getRefSpeeds (const int n_joint, const int *joints, double *spds) override |
Get reference speed of all joints. More... | |
bool | getRefAccelerations (const int n_joint, const int *joints, double *accs) override |
Get reference acceleration for a joint. More... | |
bool | stop (const int n_joint, const int *joints) override |
Stop motion for subset of joints. More... | |
bool | getTargetPosition (const int joint, double *ref) override |
Get the last position reference for the specified axis. More... | |
bool | getTargetPositions (double *refs) override |
Get the last position reference for all axes. More... | |
bool | getTargetPositions (const int n_joint, const int *joints, double *refs) override |
Get the last position reference for the specified group of axes. More... | |
bool | velocityMove (const int n_joint, const int *joints, const double *spds) override |
Start motion at a given speed for a subset of joints. More... | |
bool | close () override |
Close the DeviceDriver. More... | |
bool | resetEncoder (int j) override |
Reset encoder, single joint. More... | |
bool | resetEncoders () override |
Reset encoders. More... | |
bool | setEncoder (int j, double val) override |
Set the value of the encoder for a given joint. More... | |
bool | setEncoders (const double *vals) override |
Set the value of all encoders. More... | |
bool | getEncoder (int j, double *v) override |
Read the value of an encoder. More... | |
bool | getEncoders (double *encs) override |
Read the position of all axes. More... | |
bool | getEncoderTimed (int j, double *encs, double *time) override |
Read the instantaneous acceleration of all axes. More... | |
bool | getEncodersTimed (double *encs, double *time) override |
Read the instantaneous acceleration of all axes. More... | |
bool | getEncoderSpeed (int j, double *sp) override |
Read the istantaneous speed of an axis. More... | |
bool | getEncoderSpeeds (double *spds) override |
Read the instantaneous speed of all axes. More... | |
bool | getEncoderAcceleration (int j, double *spds) override |
Read the instantaneous acceleration of an axis. More... | |
bool | getEncoderAccelerations (double *accs) override |
Read the instantaneous acceleration of all axes. More... | |
bool | velocityMove (int j, double sp) override |
Start motion at a given speed, single joint. More... | |
bool | velocityMove (const double *sp) override |
Start motion at a given speed, multiple joints. More... | |
Public Member Functions inherited from yarp::dev::DeviceDriver | |
~DeviceDriver () override=default | |
Destructor. More... | |
template<class T > | |
bool | view (T *&x) |
Get an interface to the device driver. More... | |
virtual DeviceDriver * | getImplementation () |
Some drivers are bureaucrats, pointing at others. More... | |
Public Member Functions inherited from yarp::os::IConfig | |
virtual | ~IConfig () |
Destructor. More... | |
virtual bool | configure (Searchable &config) |
Change online parameters. More... | |
Public Member Functions inherited from yarp::dev::IPositionControl | |
virtual | ~IPositionControl () |
Destructor. More... | |
Public Member Functions inherited from yarp::dev::IEncodersTimed | |
virtual | ~IEncodersTimed () |
Destructor. More... | |
Public Member Functions inherited from yarp::dev::IEncoders | |
virtual | ~IEncoders () |
Destructor. More... | |
Public Member Functions inherited from yarp::dev::IVelocityControl | |
virtual | ~IVelocityControl () |
Destructor. More... | |
virtual bool | getRefVelocity (const int joint, double *vel) |
Get the last reference speed set by velocityMove for single joint. More... | |
virtual bool | getRefVelocities (double *vels) |
Get the last reference speed set by velocityMove for all joints. More... | |
virtual bool | getRefVelocities (const int n_joint, const int *joints, double *vels) |
Get the last reference speed set by velocityMove for a group of joints. More... | |
fakeMotor
: A fake motor control board for testing.
Implements the IPositionControl, IEncoders and IVelocityControl interfaces.
Definition at line 33 of file FakeMotor.h.
|
default |
|
delete |
|
delete |
|
overridedefault |
|
inlineoverridevirtual |
Check if the current trajectory is terminated.
Non blocking.
flag | is a pointer to return value ("and" of all joints) |
Implements yarp::dev::IPositionControl.
Definition at line 132 of file FakeMotor.h.
|
inlineoverridevirtual |
Check if the current trajectory is terminated.
Non blocking.
joints | pointer to the array of joint numbers |
flag | pointer to return value (logical "and" of all set of joints) |
Implements yarp::dev::IPositionControl.
Definition at line 231 of file FakeMotor.h.
|
inlineoverridevirtual |
Check if the current trajectory is terminated.
Non blocking.
j | is the axis number |
flag | is a pointer to return value |
Implements yarp::dev::IPositionControl.
Definition at line 125 of file FakeMotor.h.
|
inlineoverridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 281 of file FakeMotor.h.
|
inlineoverridevirtual |
Get the number of controlled axes.
This command asks the number of controlled axes for the current physical interface.
ax | pointer to storage |
Implements yarp::dev::IPositionControl.
Definition at line 59 of file FakeMotor.h.
|
inlineoverridevirtual |
Read the value of an encoder.
j | encoder number |
v | pointer to storage for the return value |
Implements yarp::dev::IEncoders.
Definition at line 321 of file FakeMotor.h.
|
inlineoverridevirtual |
Read the instantaneous acceleration of an axis.
j | axis number |
spds | pointer to the array that will contain the output |
Implements yarp::dev::IEncoders.
Definition at line 372 of file FakeMotor.h.
|
inlineoverridevirtual |
Read the instantaneous acceleration of all axes.
accs | pointer to the array that will contain the output |
Implements yarp::dev::IEncoders.
Definition at line 380 of file FakeMotor.h.
|
inlineoverridevirtual |
Read the position of all axes.
encs | pointer to the array that will contain the output |
Implements yarp::dev::IEncoders.
Definition at line 330 of file FakeMotor.h.
|
inlineoverridevirtual |
Read the istantaneous speed of an axis.
j | axis number |
sp | pointer to storage for the output |
Implements yarp::dev::IEncoders.
Definition at line 356 of file FakeMotor.h.
|
inlineoverridevirtual |
Read the instantaneous speed of all axes.
spds | pointer to storage for the output values |
Implements yarp::dev::IEncoders.
Definition at line 364 of file FakeMotor.h.
|
inlineoverridevirtual |
Read the instantaneous acceleration of all axes.
encs | pointer to the array that will contain the output |
time | pointer to the array that will contain individual timestamps |
Implements yarp::dev::IEncodersTimed.
Definition at line 347 of file FakeMotor.h.
|
inlineoverridevirtual |
Read the instantaneous acceleration of all axes.
j | axis index |
encs | encoder value (pointer to) |
time | corresponding timestamp (pointer to) |
Implements yarp::dev::IEncodersTimed.
Definition at line 340 of file FakeMotor.h.
|
inlineoverridevirtual |
Get reference acceleration for a joint.
Returns the acceleration used to generate the trajectory profile.
j | joint number |
acc | pointer to storage for the return value |
Implements yarp::dev::IPositionControl.
Definition at line 192 of file FakeMotor.h.
|
inlineoverridevirtual |
Get reference acceleration for a joint.
Returns the acceleration used to generate the trajectory profile.
joints | pointer to the array of joint numbers |
accs | pointer to the array that will store the acceleration values |
Implements yarp::dev::IPositionControl.
Definition at line 251 of file FakeMotor.h.
|
inlineoverridevirtual |
Get reference acceleration of all joints.
These are the values used during the interpolation of the trajectory.
accs | pointer to the array that will store the acceleration values. |
Implements yarp::dev::IPositionControl.
Definition at line 201 of file FakeMotor.h.
|
inlineoverridevirtual |
Get reference speed for a joint.
Returns the speed used to generate the trajectory profile.
j | joint number |
ref | pointer to storage for the return value |
Implements yarp::dev::IPositionControl.
Definition at line 174 of file FakeMotor.h.
|
inlineoverridevirtual |
Get reference speed of all joints.
These are the values used during the interpolation of the trajectory.
joints | pointer to the array of joint numbers |
spds | pointer to the array that will store the speed values. |
Implements yarp::dev::IPositionControl.
Definition at line 246 of file FakeMotor.h.
|
inlineoverridevirtual |
Get reference speed of all joints.
These are the values used during the interpolation of the trajectory.
spds | pointer to the array that will store the speed values. |
Implements yarp::dev::IPositionControl.
Definition at line 183 of file FakeMotor.h.
|
inlineoverridevirtual |
Get the last position reference for the specified axis.
This is the dual of PositionMove and shall return only values sent using IPositionControl interface. If other interfaces like IPositionDirect are implemented by the device, this call must ignore their values, i.e. this call must never return a reference sent using IPositionDirect::SetPosition
ref | last reference sent using PositionMove functions |
Reimplemented from yarp::dev::IPositionControl.
Definition at line 261 of file FakeMotor.h.
|
inlineoverridevirtual |
Get the last position reference for the specified group of axes.
This is the dual of PositionMove and shall return only values sent using IPositionControl interface. If other interfaces like IPositionDirect are implemented by the device, this call must ignore their values, i.e. this call must never return a reference sent using IPositionDirect::SetPosition
ref | last reference sent using PositionMove functions |
Reimplemented from yarp::dev::IPositionControl.
Definition at line 271 of file FakeMotor.h.
|
inlineoverridevirtual |
Get the last position reference for all axes.
This is the dual of PositionMove and shall return only values sent using IPositionControl interface. If other interfaces like IPositionDirect are implemented by the device, this call must ignore their values, i.e. this call must never return a reference sent using IPositionDirect::SetPosition
ref | last reference sent using PositionMove functions |
Reimplemented from yarp::dev::IPositionControl.
Definition at line 266 of file FakeMotor.h.
|
inlineoverridevirtual |
Open the DeviceDriver.
config | is 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). |
Reimplemented from yarp::dev::DeviceDriver.
Reimplemented in TestMotor.
Definition at line 66 of file FakeMotor.h.
|
inlineoverridevirtual |
Set new reference point for all axes.
refs | array, new reference points. |
Implements yarp::dev::IPositionControl.
Definition at line 95 of file FakeMotor.h.
|
inlineoverridevirtual |
Set new reference point for a subset of joints.
joints | pointer to the array of joint numbers |
refs | pointer to the array specifying the new reference points |
Implements yarp::dev::IPositionControl.
Definition at line 221 of file FakeMotor.h.
|
inlineoverridevirtual |
Set new reference point for a single axis.
j | joint number |
ref | specifies the new ref point |
Implements yarp::dev::IPositionControl.
Definition at line 85 of file FakeMotor.h.
|
inlineoverridevirtual |
Set relative position, all joints.
deltas | pointer to the relative commands |
Implements yarp::dev::IPositionControl.
Definition at line 115 of file FakeMotor.h.
|
inlineoverridevirtual |
Set relative position for a subset of joints.
joints | pointer to the array of joint numbers |
deltas | pointer to the array of relative commands |
Implements yarp::dev::IPositionControl.
Definition at line 226 of file FakeMotor.h.
|
inlineoverridevirtual |
Set relative position.
The command is relative to the current position of the axis.
j | joint axis number |
delta | relative command |
Implements yarp::dev::IPositionControl.
Definition at line 105 of file FakeMotor.h.
|
inlineoverridevirtual |
Reset encoder, single joint.
Set the encoder value to zero
j | encoder number |
Implements yarp::dev::IEncoders.
Definition at line 286 of file FakeMotor.h.
|
inlineoverridevirtual |
Reset encoders.
Set the encoders value to zero
Implements yarp::dev::IEncoders.
Definition at line 294 of file FakeMotor.h.
|
inlineoverridevirtual |
Set the value of the encoder for a given joint.
j | encoder number |
val | new value |
Implements yarp::dev::IEncoders.
Definition at line 303 of file FakeMotor.h.
|
inlineoverridevirtual |
Set the value of all encoders.
vals | pointer to the new values |
Implements yarp::dev::IEncoders.
Definition at line 312 of file FakeMotor.h.
|
inlineoverridevirtual |
Set reference acceleration for a joint.
This value is used during the trajectory generation.
j | joint number |
acc | acceleration value |
Implements yarp::dev::IPositionControl.
Definition at line 156 of file FakeMotor.h.
|
inlineoverridevirtual |
Set reference acceleration on all joints.
This is the valure that is used during the generation of the trajectory.
accs | pointer to the array of acceleration values |
Implements yarp::dev::IPositionControl.
Definition at line 165 of file FakeMotor.h.
|
inlineoverridevirtual |
Set reference acceleration on all joints.
This is the valure that is used during the generation of the trajectory.
joints | pointer to the array of joint numbers |
accs | pointer to the array with acceleration values |
Implements yarp::dev::IPositionControl.
Definition at line 241 of file FakeMotor.h.
|
inlineoverridevirtual |
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
j | joint number |
sp | speed value |
Implements yarp::dev::IPositionControl.
Definition at line 138 of file FakeMotor.h.
|
inlineoverridevirtual |
Set reference speed on all joints.
These values are used during the interpolation of the trajectory.
spds | pointer to the array of speed values. |
Implements yarp::dev::IPositionControl.
Definition at line 147 of file FakeMotor.h.
|
inlineoverridevirtual |
Set reference speed on all joints.
These values are used during the interpolation of the trajectory.
joints | pointer to the array of joint numbers |
spds | pointer to the array with speed values. |
Implements yarp::dev::IPositionControl.
Definition at line 236 of file FakeMotor.h.
|
inlineoverridevirtual |
Stop motion, multiple joints.
Implements yarp::dev::IPositionControl.
Definition at line 216 of file FakeMotor.h.
|
inlineoverridevirtual |
Stop motion for subset of joints.
joints | pointer to the array of joint numbers |
Implements yarp::dev::IPositionControl.
Definition at line 256 of file FakeMotor.h.
|
inlineoverridevirtual |
Stop motion, single joint.
j | joint number |
Implements yarp::dev::IPositionControl.
Definition at line 210 of file FakeMotor.h.
|
inlineoverridevirtual |
Start motion at a given speed, multiple joints.
sp | pointer to the array containing the new speed values |
Implements yarp::dev::IVelocityControl.
Definition at line 397 of file FakeMotor.h.
|
inlineoverridevirtual |
Start motion at a given speed for a subset of joints.
n_joint | how many joints this command is referring to |
joints | of joints controlled. The size of this array is n_joints |
spds | pointer to the array containing the new speed values, one value for each joint, the size of the array is n_joints. The first value will be the new reference for the joint joints[0]. for example: n_joint 3 joints 0 2 4 spds 10 30 40 |
Implements yarp::dev::IVelocityControl.
Definition at line 276 of file FakeMotor.h.
|
inlineoverridevirtual |
Start motion at a given speed, single joint.
j | joint number |
sp | speed value |
Implements yarp::dev::IVelocityControl.
Definition at line 388 of file FakeMotor.h.