rigid_body_motion.transform_angular_velocity

rigid_body_motion.transform_angular_velocity(arr, into, outof=None, what='reference_frame', dim=None, axis=None, timestamps=None, time_axis=None, cutoff=None, return_timestamps=False)[source]

Transform an array of angular velocities between frames.

The array represents the velocity of a moving body or frame wrt a reference frame, expressed in a representation frame.

The transformation changes either the reference frame, the moving frame or the representation frame of the velocity from this frame to another. In either case, it is assumed that the array is represented in the frame that is being changed and will be represented in the new frame after the transformation.

When transforming the reference frame R to a new frame R’ while keeping the moving frame M fixed, the transformed velocity is calculated according to the formula:

\[\omega_{M/R'} = \omega_{M/R} + \omega_{R/R'}\]

When transforming the moving frame M to a new frame M’ while keeping the reference frame R fixed, the transformed velocity is calculated according to the formula:

\[\omega_{M'/R} = \omega_{M/R} + \omega_{M'/M}\]
Parameters
arr: array_like

The array to transform.

into: str or ReferenceFrame

The target reference frame.

outof: str or ReferenceFrame, optional

The source reference frame. Can be omitted if the array is a DataArray whose attrs contain a “representation_frame”, “reference_frame” or “moving_frame” entry with the name of a registered frame (depending on what you want to transform, see what).

what: str

What frame of the velocity to transform. Can be “reference_frame”, “moving_frame” or “representation_frame”.

dim: str, optional

If the array is a DataArray, the name of the dimension representing the spatial coordinates of the velocities.

axis: int, optional

The axis of the array representing the spatial coordinates of the velocities. Defaults to the last axis of the array.

timestamps: array_like or str, optional

The timestamps of the velocities, corresponding to the time_axis of the array. If str and the array is a DataArray, the name of the coordinate with the timestamps. The axis defined by time_axis will be re-sampled to the timestamps for which the transformation is defined.

time_axis: int, optional

The axis of the array representing the timestamps of the velocities. Defaults to the first axis of the array.

cutoff: float, optional

Frequency of a low-pass filter applied to linear and angular velocity after the twist estimation as a fraction of the Nyquist frequency.

return_timestamps: bool, default False

If True, also return the timestamps after the transformation.

Returns
arr_transformed: array_like

The transformed array.

ts: array_like

The timestamps after the transformation.