rigid_body_motion.lookup_twist¶
- rigid_body_motion.lookup_twist(frame, reference=None, represent_in=None, outlier_thresh=None, cutoff=None, mode='quaternion', as_dataset=False, return_timestamps=False)[source]¶
Estimate linear and angular velocity of a frame wrt a reference.
- Parameters
- frame: str or ReferenceFrame
The reference frame whose twist is estimated.
- reference: str or ReferenceFrame, optional
The reference frame wrt which the twist is estimated. Defaults to the parent frame of the moving frame.
- represent_in: str or ReferenceFrame, optional
The reference frame in which the twist is represented. Defaults to the reference frame.
- outlier_thresh: float, optional
Some SLAM-based trackers introduce position corrections when a new camera frame becomes available. This introduces outliers in the linear velocity estimate. The estimation algorithm used here can suppress these outliers by throwing out samples where the norm of the second-order differences of the position is above outlier_thresh and interpolating the missing values. For measurements from the Intel RealSense T265 tracker, set this value to 1e-3.
- cutoff: float, optional
Frequency of a low-pass filter applied to linear and angular velocity after the estimation as a fraction of the Nyquist frequency.
- 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.
- as_dataset: bool, default False
If True, return an xarray.Dataset. Otherwise, return a tuple of linear and angular velocity.
- return_timestamps: bool, default False
If True, and as_dataset is False, also return the timestamps of the lookup.
- Returns
- linear, angular: each numpy.ndarray
Linear and angular velocity of moving frame wrt reference frame, represented in representation frame, if as_dataset is False.
- timestamps: numpy.ndarray
Corresponding timestamps of the lookup if return_timestamps is True.
- ds: xarray.Dataset
The above arrays as an xarray.Dataset, if as_dataset is True.