Prediction Filter
Node ID: prediction · Role: Filter · Realtime config: yes
Description
Latency compensation filter that extrapolates a FusedPose forward in time using angular velocity and optionally linear velocity. Used to reduce perceived tracking latency.
Algorithm notes
How it works
The Prediction Filter compensates for the delay between when a pose is measured and when it is finally displayed or acted on. It takes an incoming fused pose and rolls it forward in time by a short interval, using the angular velocity that comes with the pose to rotate the orientation ahead, and optionally the linear velocity and acceleration to move the position ahead. The result is a pose that is slightly “in the future”, so that by the time it reaches the renderer or consumer it lines up with where the object actually is. Nothing is smoothed or filtered - only extrapolated. The node passes everything else through untouched.
What you must configure
Nothing about this node is installation-specific in the mounting sense. The one thing you must get right is how much latency you are compensating for. Measure or estimate the delay of everything downstream of this node - rendering, display, network hop, consumer processing - and use that as your starting interval.
Tuning
- Rotation Interval (s) is the main setting. Start at your measured downstream latency, typically in the range of one to a few display frames. Increase it until the tracked object stops lagging behind fast head or body turns; decrease it if the object starts to overshoot and swim back on direction changes. Set it to 0 to turn orientation prediction off.
- Predict Position is off by default and should usually stay off for head tracking, where rotation dominates the perceived lag. Turn it on for fast-moving vehicles or platforms where translation lag is visible.
- Position Interval (s) only matters when Predict Position is on. It is separate from the rotation interval on purpose - position estimates are usually noisier, so a shorter interval here is often the better trade.
- Fixed Prediction Interval is on by default and predicts by the same configured amount on every pose. Turn it off if your input arrives with variable delay: the node then measures how old each incoming pose actually is and predicts by that amount instead, so late samples get more correction and fresh ones get less. In this mode the configured intervals are no longer used for the amount of prediction.
Troubleshooting
- Output looks identical to the input - the interval is still 0, or you enabled Predict Position but left Position Interval (s) at 0.
- Object jitters or overshoots on quick turns - the interval is too large, or the incoming angular velocity is noisy. Reduce the interval first.
- Position never moves ahead while orientation does - Predict Position is off; that is the default behaviour.
- Prediction seems inconsistent from frame to frame - Fixed Prediction Interval is off and the upstream timing is irregular. Switch it on for a constant amount.
- Vehicle poses are not predicted at all - vehicle-style input is only extrapolated when Fixed Prediction Interval is off; with it on, vehicle poses pass through unchanged.
Inputs / Outputs
- Inputs:
FusedPose - Outputs:
FusedPose
Config aliases
PredictionFilter, predictionFilter, prediction
Properties
Each row shows the setting’s label in the node’s Properties panel and, in code, its key in the node’s settings object in the config file. A setting omitted from the config file uses the default shown here.
| Property | Type | Default | Description |
|---|---|---|---|
Rotation Interval (s) rotationInterval | number | 0.0 | How far ahead, in seconds, to predict orientation by integrating the current angular velocity forward. Compensates for downstream latency (render/display). 0 disables orientation prediction. |
Position Interval (s) positionInterval | number | 0.0 | How far ahead, in seconds, to predict position by extrapolating the current linear velocity forward. Only applied when Predict Position is enabled. 0 disables position prediction. |
Predict Position predictPosition | boolean | false | Also extrapolate position forward by the Position Interval. When off, only orientation is predicted and position passes through unchanged. |
Fixed Prediction Interval fixedPredictionInterval | boolean | true | Predict by the fixed configured interval each frame. When off, the interval is measured from the timestamp of each input pose to the current time, so the prediction tracks the actual age of the incoming data. |
Example node definition
A minimal entry in config.json looks like the block below. Paste it under the sinks key, keyed by an instance name of your choice. All settings are optional: anything not listed under settings uses the default from the Properties table above. See The configuration file for how the sections and endpoint wiring work.
{
"sinks": {
"prediction": {
"dataEndpoint": "inproc://prediction_data",
"inputEndpoints": [
"inproc://fusedPose_data"
],
"inputDataFilter": [
"FusedPose"
],
"settings": {}
}
}
}