pytransform3d.batch_rotations
.smooth_quaternion_trajectory#
- pytransform3d.batch_rotations.smooth_quaternion_trajectory(Q, start_component_positive='x')[source]#
Smooth quaternion trajectory.
Quaternion q and -q represent the same rotation but cannot be interpolated well. This function guarantees that two successive quaternions q1 and q2 are closer than q1 and -q2.
- Parameters:
- Qarray-like, shape (n_steps, 4)
Unit quaternions to represent rotations: (w, x, y, z)
- start_component_positivestr, optional (default: ‘x’)
Start trajectory with quaternion that has this component positive. Allowed values: ‘w’ (scalar), ‘x’, ‘y’, and ‘z’.
- Returns:
- Qarray, shape (n_steps, 4)
Unit quaternions to represent rotations: (w, x, y, z)
- Raises:
- ValueError
If Q has length 0.