rigid_body_motion.estimate_angular_velocity¶
- rigid_body_motion.estimate_angular_velocity(arr, dim=None, axis=None, timestamps=None, time_axis=None, mode='quaternion', outlier_thresh=None, cutoff=None)[source]¶
Estimate angular velocity from a time series of rotations.
- Parameters
- arr: array_like
Array of rotations, expressed in quaternions.
- dim: str, optional
If the array is a DataArray, the name of the dimension representing the spatial coordinates of the quaternions.
- axis: int, optional
The axis of the array representing the spatial coordinates of the quaternions. Defaults to the last axis of the array.
- timestamps: array_like or str, optional
The timestamps of the quaternions, 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 quaternions. Defaults to the first axis of the array.
- mode: str, default “quaternion”
If “quaternion”, compute the angular velocity from the quaternion derivative. If “rotation_vector”, compute the angular velocity from the gradient of the axis-angle representation of the rotations.
- outlier_thresh: float, optional
Suppress samples where the norm of the second-order differences of the rotation is above outlier_thresh and interpolate the missing values.
- cutoff: float, optional
Frequency of a low-pass filter applied to the angular velocity after the estimation as a fraction of the Nyquist frequency.
- Returns
- angular: array_like
Array of angular velocities.