|
using | dev_index_t = std::tuple< const RawDevice *, int > |
| Tuple of a raw device pointer and either an offset or a local index.
|
|
using | dev_group_t = std::tuple< const RawDevice *, std::vector< int >, int > |
| Tuple of a raw device pointer, its local indices and the global index.
|
|
template<typename T , typename... T_ref> |
using | motor_single_joint_fn = bool(T::*)(int, T_ref...) |
| Alias for a single-joint command. See class description.
|
|
template<typename T , typename... T_refs> |
using | motor_all_joints_fn = bool(T::*)(T_refs *...) |
| Alias for a full-joint command. See class description.
|
|
template<typename T , typename... T_refs> |
using | motor_multi_joints_fn = bool(T::*)(int, const int *, T_refs *...) |
| Alias for a joint-group command. See class description.
|
|
template<typename T , typename T_out > |
using | sensor_status_fn = T_out(T::*)(std::size_t) const |
|
template<typename T > |
using | sensor_size_fn = std::size_t(T::*)(std::size_t) const |
|
template<typename T , typename... T_out_params> |
using | sensor_output_fn = bool(T::*)(std::size_t, T_out_params &...) const |
|
|
| DeviceMapper () |
| Constructor.
|
|
| ~DeviceMapper () |
| Destructor.
|
|
void | enableParallelization (unsigned int concurrentTasks) |
| Whether to enable parallel mappings and on how many concurrent threads.
|
|
bool | registerDevice (yarp::dev::PolyDriver *driver) |
| Extract interface handles and perform sanity checks.
|
|
void | clear () |
| Delete all internal handles.
|
|
std::unique_ptr< FutureTask > | createTask () const |
| Create an instance of a deferred task.
|
|
const std::vector< std::unique_ptr< const RawDevice > > & | getDevices () const |
| Retrieve all registered raw devices, regardless of type. More...
|
|
dev_index_t | getMotorDevice (int globalAxis) const |
| Retrieve a motor device handle and its local index given a global index. More...
|
|
std::vector< dev_index_t > | getMotorDevicesWithOffsets () const |
| Retrieve all registered motor subdevices and their associated offsets. More...
|
|
std::vector< dev_group_t > | getMotorDevicesWithIndices (int globalAxesCount, const int *globalAxes) const |
| Retrieve motor subdevices that map to the specified global axes. More...
|
|
int | getControlledAxes () const |
| Retrieve the number of controlled axes across all subdevices.
|
|
template<typename T , typename... T_ref> |
bool | mapSingleJoint (motor_single_joint_fn< T, T_ref... > fn, int j, T_ref... ref) |
| Single-joint command mapping. See class description.
|
|
template<typename T , typename... T_refs> |
bool | mapAllJoints (motor_all_joints_fn< T, T_refs... > fn, T_refs *... refs) |
| Full-joint command mapping. See class description.
|
|
template<typename T , typename... T_refs> |
bool | mapJointGroup (motor_multi_joints_fn< T, T_refs... > fn, int n_joint, const int *joints, T_refs *... refs) |
| Joint-group command mapping. See class description.
|
|
template<typename T > |
int | getConnectedSensors () const |
| Retrieve the number of connected sensors of the specified type across all subdevices.
|
|
template<typename T > |
dev_index_t | getSensorDevice (int globalIndex) const |
| Retrieve a sensor device handle and its local index given a global index. More...
|
|
template<typename T , typename T_out > |
T_out | getSensorStatus (sensor_status_fn< T, T_out > fn, std::size_t index) const |
| Retrieve the status of the sensor device at the specified global index. More...
|
|
template<typename T > |
std::size_t | getSensorArraySize (sensor_size_fn< T > fn, std::size_t index) const |
| Retrieve the size of the sensor array at the specified global index. More...
|
|
template<typename T , typename... T_out_params> |
bool | getSensorOutput (sensor_output_fn< T, T_out_params... > fn, std::size_t index, T_out_params &... params) const |
| Retrieve information from the sensor device at the specified global index. More...
|
|
Some raw subdevices might control several axes. This class knows how to map YARP commands to the right controlled motor axis or sensor of the correct subdevice given one or more indices, and forwards the call either in a sequential or parallel manner (see FutureTask).
For example, given three raw subdevices that manage one, two and three axes, respectively, a YARP command that requests global index '2' (zero-based) must be mapped to the second axis of the second subdevice and conveniently forwarded.
Terminology:
- global index the joint id exposed by the control board to the YARP network and used as input in most motor interfaces; '3' in the above example
- local index the joint id of the requested axis within the specific subdevice context; '1' in the above example (the second axis of the second device)
- subdevice offset the global index at which local indices of a subdevice start; '0', '1' and '3' for the subdevices in the above example, respectively
- parameter offset the starting index at which array values pointed to by the array parameter (see
values
in the following examples) refer to the given subdevice
- single-joint mapping:
command(int globalId, type value)
- full-joint mapping:
command(type * values)
- joint-group mapping:
command(int n, const int * globalIds, type * values)