reachy.trajectory.mixer

Utility module to automatically merge trajectories.

You should always check the result of the combination of your trajectories before applying it to the robot. Indeed, the code below is by no mean safe. Artefacts could notably be introduced in the process.

Module Contents

Functions

sigmoid(x)

Compute sigmoid function.

norm_sigmoid(n, r)

Compute a normalized sigmoid function with specified range.

_combine(m1, m2, overlap, r)

traj_as_array(traj)

Transform a trajectory dict into a numpy 2D array.

combine(*trajs, overlap=0.1, r=5)

Combine multiple trajectory into a single one.

reachy.trajectory.mixer.sigmoid(x)

Compute sigmoid function.

reachy.trajectory.mixer.norm_sigmoid(n, r)

Compute a normalized sigmoid function with specified range.

Parameters
  • n (int) – number of samples to used

  • r (float) – X range [-r, r] where to compute the sigmoid

reachy.trajectory.mixer._combine(m1, m2, overlap, r)
reachy.trajectory.mixer.traj_as_array(traj)

Transform a trajectory dict into a numpy 2D array.

Parameters

traj (dict) – {motor_name: list of positions}

reachy.trajectory.mixer.combine(*trajs, overlap=0.1, r=5)

Combine multiple trajectory into a single one.

Parameters
  • trajs (list) – list of trajectories (as dict)

  • overlap (float) – overlap recovery percentage for combining trajectories

  • r (int) – sigmoid slope factor used to merge two trajectories