API reference
API reference
Select your platform
No SDKs available
No versions available

RANSACVelocity Class

A helper class that uses an underlying RandomSampleConsensus<TModel> to select the best pair of linear and angular velocities from a buffer of recent timed poses.
RANSACVelocity allows for the stable estimation of velocity under noise-prone circumstances. This is particuarly important when throwing objects because of the unreliability of data around the moment of intended release: if the perceived moment of release is slightly too late, for example, the behavior of the throwing implement (hand, controller, etc.) should not impact the calculated velocity. RANSAC velocity estimation across several frames mitigates this problem.

Properties

Maximum speed (in m/s) allowed for synthetic poses.
This is used in internal calculations and should generally not need to be tuned. Synthetic poses are generated and used by RANSACVelocity to fill tracking gaps (when Input.IHand.IsHighConfidence for a tracked hand is false, for example). Capping the allowed speed mitigates the risk of generating nonsensical synthetic poses.

Member Functions

RANSACVelocity
( int samplesCount,
int samplesDeadZone,
int minHighConfidenceSamples )
Creates a new RANSACVelocity for estimating velocity.
Parameters
samplesCount
The size of the rolling sample buffer from which to seek consensus.
samplesDeadZone
The number of most recent samples to exclude from the consensus.
Initializes a RANSACVelocity calculator, clearing its state and preparing it to receive new data.
Can be called repeatedly to reset the state of an existing RANSACVelocity.
Consumes a new frame of Pose data for example, from the IGrabbable.Transform of a grabbed GrabInteractable.
The RANSACVelocity instance must be regularly supplied with such data so that velocities can be estimated when needed.
Parameters
pose
The Pose observed.
time
The time at which pose was observed.
isHighConfidence
Whether or not pose was observed with high confidence. For example, if pose is from an IGrabbable.Transform being held by an Input.IHand for which Input.IHand.IsHighConfidence is false, then pose might also be considered to be known with low confidence.
Estimates the current translational and rotational velocities based on the available data.
If there is insufficient data to produce an estimate, returns 0 trivial velocities.
Parameters
velocity
Output parameter for translational velocity.
torque
Output parameter for rotational velocity.

Protected Functions

virtual Vector3 PositionOffset
( Pose youngerPose,
Pose olderPose )
void GetSortedTimePoses
( int idx1,
int idx2,
out TimedPose older,
out TimedPose younger )

Object Data for protected-static-func

static Vector3 GetTorque
( TimedPose older,
TimedPose younger )
Did you find this page helpful?
Thumbs up icon
Thumbs down icon