Movement recording (and replay)

Hi all,

I would like to record movement of my poppy ergo jr using the rest api.

It seems when the compliant mode is set to ‘true’ i.e the motors are drivable by hand, the only available data is the register ‘present_position’ (no speed data at all).

Then I try to figure out how, next querying every x ms the ‘present_position’, to replay this movement.

Should I:

  • Set ‘goal_position’ of each motors with the recorded values every x ms,
  • Estimate the speed between 2 positions and set the ‘goal_speed’ too,
  • Others…

In a concise manner: which algo should I apply in order to replay a “movement” record (i.e. a set of positions) in accordance with the motor accurency/limits of a poppy ergo jr?

Thanks in advance,

It depends on the time between measurements and the minimal speed of your movement.
The speed measured by the servo is too noisy.
If recording every 1000 ms, you should command the position and the speed knowning the initial position of you movement.
If recording every 50ms (or lower), the time is so small that it is not useful to command speed. Setting speed to 0 (max speed) is sufficient.
Take care about the minimal speed. If you want to go from -45deg to 45deg in 1 hour, the computed speed will be close to 0.002deg/s, converted in int, it makes 0… the motor will not move at all.



Excatly kind of answer I expected about my question.

Thanks a lot,