Trajectory utility module.

Package Contents



Trajectory Recorder utility class.


Trajectory player abstraction.

class reachy.trajectory.TrajectoryRecorder(motors, position_field='present_position', freq=100)

Bases: object

Trajectory Recorder utility class.

  • motors (list) – list of motors to record (eg. [reachy.right_arm.elbow_pitch, reachy.right_arm.shoulder_pitch])

  • position_field (str) – register to record as trajectories (default use the ‘present_position’, ‘goal_position’ can also be useful in some specific case)

  • freq (float) – record sample frequency (in Hz)


A same recorder can be used to record multiple trajectories.

Facilitates the recording of a full trajectory on multiple motors.

start(self, turn_compliant=False)

Start the record.


turn_compliant (bool) – whether or not to turn the motor compliant before starting the record.

stop(self, turn_stiff=False)

Stop the record.


turn_stiff (bool) – whether or not to turn the motor stiff at the end of the record.

property trajectories(self)

Retrieve a copy of the recorded trajectories.

class reachy.trajectory.TrajectoryPlayer(reachy, trajectories, freq=100)

Bases: object

Trajectory player abstraction.

  • reachy (Reachy) – robot which will play the trajectory

  • trajectories (dict) – Trajectory to play (such as {motor_name: list of positions})

  • freq (float) – Replay sample frequency (in Hz)

Provides high-level features to:
  • play a pre-defined trajectory

  • wait for the end of the replay

  • add fade in to smooth begining of motion

play(self, wait=False, fade_in_duration=0)

Play a given trajectory.

  • wait (bool) – whether or not to wait for the end of the trajectory replay

  • fade_in_duration (float) – time in seconds to reach the starting position (can be used to smooth the begining of the motion)


you can call play multiple times to replay the trajectory. You are responisble for handling the concurrency issue if you try to run multiple trajectories on the same motors.


Block until the end of a trajectory replay.