roboticslab-uc3m / yarp-devices

A place for YARP devices
https://robots.uc3m.es/yarp-devices/
9 stars 7 forks source link

Implement PVT mode through IRemoteVariables #208

Closed PeterBowman closed 5 years ago

PeterBowman commented 5 years ago

Stemming from https://github.com/roboticslab-uc3m/yarp-devices/issues/198, this issue aims to "restore" and enhance support for iPOS-specific interpolation modes. Restore: PT mode used to be accessed via yarp::dev::IPositionDirect, the external reference position mode has taken its place. Enhance: PVT looks better than PT, so let's go for it.

Ideas and roadmap (from https://github.com/roboticslab-uc3m/yarp-devices/issues/198#issuecomment-487386797):

Pointers given by Technosoft support: https://github.com/roboticslab-uc3m/yarp-devices/issues/198#issuecomment-487279910.

Mind this issue (from https://github.com/roboticslab-uc3m/yarp-devices/issues/198):

It takes ages to switch to position direct mode ("seems like a must"). Certain applications start sending targets asynchronously right away after the mode change (e.g. keyboardController), thus the first actually commanded position happens after said delay and makes the robot jump too far away.

PeterBowman commented 5 years ago

This might be the right time to increase the size of TX/RX CAN buffers, see https://github.com/roboticslab-uc3m/yarp-devices/issues/159.

PeterBowman commented 5 years ago

Note: check velocities against the minVel/maxVel configuration parameters (https://github.com/roboticslab-uc3m/yarp-devices/issues/188).

PeterBowman commented 5 years ago

Proposed PVT message protocol (single waypoint): (time) ((pos_0) (vel_0)) ((pos_1) (vel_1))....

Example: ( ( t 50 ) ( ( p 2.0 ) ( v 3.5 ) ) ( ( p 3.0 ) ( v 1.5 ) ) ) ( ...next waypoint... )

Implications:

Alternatively: (t <time>) (p <pos0> <pos1>...) (v <vel0> <vel1>...) where v is optional.

PeterBowman commented 5 years ago

Mostly implemented:

PeterBowman commented 5 years ago

not sure whether the time property (expressed in milliseconds) should be of integer type

Per 9.2.7, "Object 207Ah: Interpolated position 1st order time":

It is given in IU which is by default 0.8ms for steppers and 1ms for the other configurations.

Data type is UNSIGNED16. This means that we (for most cases) won't achieve a better resolution than 1 millisecond (shall I take into account a stepper configuration?), therefore the time property as described above, as well as all derived C/C++ variables used to store this representation in memory, can fit into an integer-type object which could be narrowed down to uint16_t, even.

jgvictores commented 5 years ago

shall I take into account a stepper configuration?

I do not think this is necessary.

PeterBowman commented 5 years ago

Closing as WONTFIX. PVT mode and custom buffer sizes are now supported thanks to https://github.com/roboticslab-uc3m/yarp-devices/pull/220. Users are encouraged to loop over recorded targets and send them individually, either in a fixed or arbitrary period, via VOCAB_CM_POSITION_DIRECT mode.

Additional notes: