Default implementation of the IPositionDirect interface. More...
#include <yarp/dev/ImplementPositionDirect.h>
Inheritance diagram for yarp::dev::ImplementPositionDirect:Public Member Functions | |
| ImplementPositionDirect (yarp::dev::IPositionDirectRaw *y) | |
| Constructor. | |
| virtual | ~ImplementPositionDirect () |
| Destructor. | |
| yarp::dev::ReturnValue | getAxes (size_t &axes) override |
| Get the number of controlled axes. | |
| yarp::dev::ReturnValue | setPosition (int j, double ref) override |
| Set new position for a single axis. | |
| yarp::dev::ReturnValue | setPositions (const int n_joint, const int *joints, const double *refs) override |
| Set new reference point for all axes. | |
| yarp::dev::ReturnValue | setPositions (const double *refs) override |
| Set new position for a set of axis. | |
| yarp::dev::ReturnValue | getRefPosition (const int joint, double *ref) override |
| Get the last position reference for the specified axis. | |
| yarp::dev::ReturnValue | getRefPositions (double *refs) override |
| Get the last position reference for all axes. | |
| yarp::dev::ReturnValue | getRefPositions (const int n_joint, const int *joints, double *refs) override |
| Get the last position reference for the specified group of axes. | |
Public Member Functions inherited from yarp::dev::IPositionDirect | |
| virtual | ~IPositionDirect () |
| Destructor. | |
Protected Member Functions | |
| 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 | |
| IPositionDirectRaw * | m_iraw =nullptr |
| void * | m_helper =nullptr |
| std::vector< int > | m_buffer_ints |
| std::vector< double > | m_buffer_doubles |
| std::mutex | m_imp_mutex |
Default implementation of the IPositionDirect interface.
This class can be used to easily provide an implementation of IPositionDirect.
Definition at line 29 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 27 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.
Definition at line 58 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 |
Implements yarp::dev::IPositionDirect.
Definition at line 106 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 |
Implements yarp::dev::IPositionDirect.
Definition at line 122 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 |
Implements yarp::dev::IPositionDirect.
Definition at line 144 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 32 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 66 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 95 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 77 of file ImplementPositionDirect.cpp.
|
protected |
Clean up internal data and memory.
Definition at line 47 of file ImplementPositionDirect.cpp.
|
protected |
Definition at line 35 of file ImplementPositionDirect.h.
|
protected |
Definition at line 34 of file ImplementPositionDirect.h.
|
protected |
Definition at line 33 of file ImplementPositionDirect.h.
|
protected |
Definition at line 36 of file ImplementPositionDirect.h.
|
protected |
Definition at line 32 of file ImplementPositionDirect.h.