movement_primitives.data.generate_minimum_jerk#
- movement_primitives.data.generate_minimum_jerk(start, goal, execution_time=1.0, dt=0.01)#
Create a minimum jerk trajectory.
A minimum jerk trajectory from \(x_0\) to \(g\) minimizes the third time derivative of the positions:
\[\arg \min_{x_0, \ldots, x_T} \int_{t=0}^T \dddot{x}(t)^2 dt\]The trajectory will have
n_steps = 1 + execution_time / dt
steps because we start at 0 seconds and end at execution_time seconds.
- Parameters:
- startarray-like, shape (n_dims,)
Initial state
- goalarray-like, shape (n_dims,)
Goal state
- execution_timefloat, optional (default: 1)
Execution time in seconds
- dtfloat, optional (default: 0.01)
Time between successive steps in seconds
- Returns:
- Xarray, shape (n_steps, n_dims)
The positions of the trajectory
- Xdarray, shape (n_steps, n_dims)
The velocities of the trajectory
- Xddarray, shape (n_steps, n_dims)
The accelerations of the trajectory
- Raises:
- ValueError
If the shapes of the initial and goal state do not match.