rigid_body_motion.lookup_linear_velocity

rigid_body_motion.lookup_linear_velocity(frame, reference=None, represent_in=None, outlier_thresh=None, cutoff=None, as_dataarray=False, return_timestamps=False)[source]

Estimate linear velocity of a frame wrt a reference.

Parameters
frame: str or ReferenceFrame

The reference frame whose velocity is estimated.

reference: str or ReferenceFrame, optional

The reference frame wrt which the velocity 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.

as_dataarray: bool, default False

If True, return an xarray.DataArray.

return_timestamps: bool, default False

If True and as_dataarray is False, also return the timestamps of the lookup.

Returns
linear: numpy.ndarray or xarray.DataArray

Linear velocity of moving frame wrt reference frame, represented in representation frame.

timestamps: numpy.ndarray

Corresponding timestamps of the lookup if return_timestamps is True.