motion_generator

motion_generator#

snake.core.handlers.motion.utils.motion_generator(n_frames, t_std, r_std, time_res, rng)[source]#

Generate a motion trajectory.

Parameters:
  • n_frames (int) – Number of frames.

  • t_std (tuple[float, float, float]) – Translation standard deviation, in mm/s

  • r_std (tuple[float, float, float]) – Rotation standard deviation, in radians/s.

  • time_res (float) – Time resolution, in seconds.

  • rng (Generator) – Random number generator.

Returns:

Cumulative Motion trajectory.

Return type:

np.ndarray

Notes

The motion is generated by drawing from a normal distribution with standard deviation for the 6 motion parameters: 3 rotation (x,y,z) and 3 translations. Then the cumulative motion is computed by summing the motion at each frame, to derive the absolute displacement compared to the base reference.