gaitmap.utils.rotations: Helper to handle rotations#

A set of util functions that ease handling rotations.

All util functions use scipy.spatial.transform.Rotation to represent rotations.

Functions#

rotation_from_angle(axis, angle)

Create a rotation based on a rotation axis and a angle.

rotate_dataset(dataset, rotation)

Apply a rotation to acc and gyro data of a dataset.

flip_dataset(dataset, rotation)

Flip datasets around axis data of a dataset.

rotate_dataset_series(dataset, rotations)

Rotate data of a single sensor using a series of rotations.

find_shortest_rotation(v1, v2)

Find a quaternion that rotates v1 into v2 via the shortest way.

get_gravity_rotation(gravity_vector[, ...])

Find the rotation matrix needed to align z-axis with gravity.

find_unsigned_3d_angle(v1, v2)

Find the angle (in rad) between two 3D vectors.

find_signed_3d_angle(v1, v2, rotation_axis)

Find the signed angle (in rad) between two 3D vectors.

find_angle_between_orientations(ori, ref[, ...])

Get the required rotation angle between two orientations.

find_rotation_around_axis(rot, rotation_axis)

Calculate the rotation component of rot around the given rotation axis.