Default implementation of the IPositionControl interface. More...
#include <yarp/dev/ImplementPositionControl.h>
Public Member Functions | |
ImplementPositionControl (yarp::dev::IPositionControlRaw *y) | |
Constructor. More... | |
virtual | ~ImplementPositionControl () |
Destructor. More... | |
bool | getAxes (int *axis) override |
Get the number of controlled axes. More... | |
bool | positionMove (int j, double ref) override |
Set new reference point for a single axis. 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 | 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 int n_joint, const int *joints, const double *deltas) override |
Set relative position for a subset of joints. More... | |
bool | relativeMove (const double *deltas) override |
Set relative position, all joints. More... | |
bool | checkMotionDone (bool *flag) override |
Check if the current trajectory is terminated. More... | |
bool | checkMotionDone (const int n_joint, const int *joints, bool *flags) override |
Check if the current trajectory is terminated. More... | |
bool | checkMotionDone (int j, 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 int n_joint, const int *joints, const double *spds) override |
Set reference speed on all joints. 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 int n_joint, const int *joints, const double *accs) override |
Set reference acceleration on all joints. 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 (const int n_joint, const int *joints, double *spds) override |
Get reference speed of all joints. 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 (const int n_joint, const int *joints, double *accs) 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 (const int n_joint, const int *joints) override |
Stop motion for subset of joints. More... | |
bool | stop () override |
Stop motion, multiple 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... | |
Public Member Functions inherited from yarp::dev::IPositionControl | |
virtual | ~IPositionControl () |
Destructor. More... | |
Protected Member Functions | |
bool | initialize (int size, const int *amap, const double *enc, const double *zos) |
Initialize the internal data and alloc memory. More... | |
bool | uninitialize () |
Clean up internal data and memory. More... | |
Protected Attributes | |
IPositionControlRaw * | iPosition |
void * | helper |
yarp::dev::impl::FixedSizeBuffersManager< int > * | intBuffManager |
yarp::dev::impl::FixedSizeBuffersManager< double > * | doubleBuffManager |
yarp::dev::impl::FixedSizeBuffersManager< bool > * | boolBuffManager |
Default implementation of the IPositionControl interface.
This class can be used to easily provide an implementation of IPositionControl.
Definition at line 38 of file ImplementPositionControl.h.
ImplementPositionControl::ImplementPositionControl | ( | yarp::dev::IPositionControlRaw * | y | ) |
Constructor.
y | is the pointer to the class instance inheriting from this implementation. |
Definition at line 20 of file ImplementPositionControl.cpp.
|
virtual |
Destructor.
Perform uninitialize if needed.
Definition at line 29 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 193 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 178 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 170 of file ImplementPositionControl.cpp.
|
overridevirtual |
Get the number of controlled axes.
This command asks the number of controlled axes for the current physical interface.
Implements yarp::dev::IPositionControl.
Reimplemented in FakeMotionControl.
Definition at line 388 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 348 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 325 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 316 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 270 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 284 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 307 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 396 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 419 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 410 of file ImplementPositionControl.cpp.
|
protected |
Initialize the internal data and alloc memory.
Allocate memory for internal data.
size | is the number of controlled axes the driver deals with. |
amap | is a lookup table mapping axes onto physical drivers. |
enc | is an array containing the encoder to angles conversion factors. |
zos | is an array containing the zeros of the encoders. respect to the control/output values of the driver. |
size | the number of joints |
amap | axis map for this device wrapper |
enc | encoder conversion factor, from high level to hardware |
zos | offset for setting the zero point. Units are relative to high level user interface (degrees) |
Definition at line 42 of file ImplementPositionControl.cpp.
|
overridevirtual |
Set new reference point for all axes.
refs | array, new reference points. |
Implements yarp::dev::IPositionControl.
Definition at line 123 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 103 of file ImplementPositionControl.cpp.
|
overridevirtual |
Set new reference point for a single axis.
j | joint number |
ref | specifies the new ref point |
Implements yarp::dev::IPositionControl.
Definition at line 94 of file ImplementPositionControl.cpp.
|
overridevirtual |
Set relative position, all joints.
deltas | pointer to the relative commands |
Implements yarp::dev::IPositionControl.
Definition at line 161 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 143 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 133 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 232 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 260 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 242 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 198 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 223 of file ImplementPositionControl.cpp.
|
overridevirtual |
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 207 of file ImplementPositionControl.cpp.
|
overridevirtual |
Stop motion, multiple joints.
Implements yarp::dev::IPositionControl.
Definition at line 383 of file ImplementPositionControl.cpp.
|
overridevirtual |
Stop motion for subset of joints.
joints | pointer to the array of joint numbers |
Implements yarp::dev::IPositionControl.
Definition at line 370 of file ImplementPositionControl.cpp.
|
overridevirtual |
Stop motion, single joint.
j | joint number |
Implements yarp::dev::IPositionControl.
Definition at line 361 of file ImplementPositionControl.cpp.
|
protected |
Clean up internal data and memory.
Definition at line 65 of file ImplementPositionControl.cpp.
|
protected |
Definition at line 45 of file ImplementPositionControl.h.
|
protected |
Definition at line 44 of file ImplementPositionControl.h.
|
protected |
Definition at line 42 of file ImplementPositionControl.h.
|
protected |
Definition at line 43 of file ImplementPositionControl.h.
|
protected |
Definition at line 41 of file ImplementPositionControl.h.