Default implementation of the IPositionDirect interface. More...
#include <yarp/dev/ImplementPositionDirect.h>
Public Member Functions | |
ImplementPositionDirect (yarp::dev::IPositionDirectRaw *y) | |
Constructor. More... | |
virtual | ~ImplementPositionDirect () |
Destructor. More... | |
bool | getAxes (int *axes) override |
Get the number of controlled axes. More... | |
bool | setPosition (int j, double ref) override |
Set new position for a single axis. More... | |
bool | setPositions (const int n_joint, const int *joints, const double *refs) override |
Set new reference point for all axes. More... | |
bool | setPositions (const double *refs) override |
Set new position for a set of axis. More... | |
bool | getRefPosition (const int joint, double *ref) override |
Get the last position reference for the specified axis. More... | |
bool | getRefPositions (double *refs) override |
Get the last position reference for all axes. More... | |
bool | getRefPositions (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::IPositionDirect | |
virtual | ~IPositionDirect () |
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 | |
IPositionDirectRaw * | iPDirect |
void * | helper |
yarp::dev::impl::FixedSizeBuffersManager< int > * | intBuffManager |
yarp::dev::impl::FixedSizeBuffersManager< double > * | doubleBuffManager |
Default implementation of the IPositionDirect interface.
This class can be used to easily provide an implementation of IPositionDirect.
Definition at line 38 of file ImplementPositionDirect.h.
ImplementPositionDirect::ImplementPositionDirect | ( | yarp::dev::IPositionDirectRaw * | y | ) |
Constructor.
y | is the pointer to the class instance inheriting from this implementation. |
Definition at line 21 of file ImplementPositionDirect.cpp.
|
virtual |
Destructor.
Perform uninitialize if needed.
Definition at line 29 of file ImplementPositionDirect.cpp.
|
overridevirtual |
Get the number of controlled axes.
This command asks the number of controlled axes for the current physical interface.
Implements yarp::dev::IPositionDirect.
Reimplemented in FakeMotionControl.
Definition at line 74 of file ImplementPositionDirect.cpp.
|
overridevirtual |
Get the last position reference for the specified axis.
This is the dual of setPositionsRaw and shall return only values sent using IPositionDirect interface. If other interfaces like IPositionControl are implemented by the device, this call must ignore their values, i.e. this call must never return a reference sent using IPositionControl::PositionMove.
ref | last reference sent using setPosition(s) functions |
Reimplemented from yarp::dev::IPositionDirect.
Definition at line 123 of file ImplementPositionDirect.cpp.
|
overridevirtual |
Get the last position reference for the specified group of axes.
This is the dual of setPositionsRaw and shall return only values sent using IPositionDirect interface. If other interfaces like IPositionControl are implemented by the device, this call must ignore their values, i.e. this call must never return a reference sent using IPositionControl::PositionMove.
ref | array containing last reference sent using setPosition(s) functions |
Reimplemented from yarp::dev::IPositionDirect.
Definition at line 136 of file ImplementPositionDirect.cpp.
|
overridevirtual |
Get the last position reference for all axes.
This is the dual of setPositionsRaw and shall return only values sent using IPositionDirect interface. If other interfaces like IPositionControl are implemented by the device, this call must ignore their values, i.e. this call must never return a reference sent using IPositionControl::PositionMove.
ref | array containing last reference sent using setPosition(s) functions |
Reimplemented from yarp::dev::IPositionDirect.
Definition at line 162 of file ImplementPositionDirect.cpp.
|
protected |
Initialize the internal data and alloc memory.
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. |
Definition at line 34 of file ImplementPositionDirect.cpp.
|
overridevirtual |
Set new position for a single axis.
j | joint number |
ref | specifies the new ref point |
Implements yarp::dev::IPositionDirect.
Definition at line 80 of file ImplementPositionDirect.cpp.
|
overridevirtual |
Set new position for a set of axis.
refs | specifies the new reference points |
Implements yarp::dev::IPositionDirect.
Definition at line 114 of file ImplementPositionDirect.cpp.
|
overridevirtual |
Set new reference point for all axes.
n_joint | how many joints this command is referring to |
joints | list of joints controlled. The size of this array is n_joints |
refs | array, new reference points, one value for each joint, the size 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 refs 10 30 40 |
Implements yarp::dev::IPositionDirect.
Definition at line 89 of file ImplementPositionDirect.cpp.
|
protected |
Clean up internal data and memory.
Definition at line 51 of file ImplementPositionDirect.cpp.
|
protected |
Definition at line 44 of file ImplementPositionDirect.h.
|
protected |
Definition at line 42 of file ImplementPositionDirect.h.
|
protected |
Definition at line 43 of file ImplementPositionDirect.h.
|
protected |
Definition at line 41 of file ImplementPositionDirect.h.