Work record: , 3 minute read

Every measurement is about the past

A position fix describes where the vehicle was when the shutter opened. Apply it as if it were now and you drag the estimate backwards, and sideways in a turn. The fix is to put the correction where it belongs.

Mongla estimates its own position with a right-invariant extended Kalman filter. It predicts forward on the board’s IMU, and corrects with whatever cheap measurement arrives: depth from pressure, velocity from the floor, heading, and occasional position fixes from recognising a prop.

That last kind of correction has a problem nobody writes on the box. A camera exposes a frame, the Hailo-8 finds the prop, the result crosses two processes and a queue, and it lands in the filter. By then the vehicle has moved. The fix is perfectly correct about where the vehicle was.

The chord

If the vehicle is going straight at speed v, a fix that’s τ seconds old pulls the estimate straight back along the path by v·τ. In a turn at rate ω it’s worse: the old position sits on an arc behind you, and the correction yanks the estimate along the chord 2(v/ω)·sin(ωτ/2), back and sideways. Drag the latency, the speed and the turn rate:

fig 1A late fix, applied now vs replayeddrag the numbers

Loading the diagram. It needs JavaScript; the text around it says the same thing in words.

Applied on arrival, the stale fix pulls the estimate back along the chord. Replayed at its own timestamp, it lands on the state it was about, and the present follows from it.

Set the speed to zero and both tracks agree exactly. Latency times zero speed is zero error. That’s why the bug survives every bench test, every dry run and every “we checked it in the lab”: the condition that reveals it (moving, turning, and being corrected at the same time) is the one you can’t create indoors.

A late measurement is not noise. It’s a true statement, applied to the wrong moment.

Putting it where it belongs

The filter keeps a short buffer of its own recent states. When a measurement arrives carrying the instant it describes, the filter winds back to that instant, applies the correction there, and replays every motion input since. The vehicle’s present position becomes a consequence of the correction rather than an override.

That only works if the timestamp is real. A message that says the prop is here is a rumour. One that says the prop was here, at this instant on the board’s clock is a measurement. The board stamps its own messages, which is what makes the rewind possible at all.

Why invariant

A vehicle’s orientation lives on a curved space: rotations don’t add like numbers. An ordinary EKF linearises around its current guess, and after a fast turn it can become confidently wrong, which is the worst way to be wrong. The invariant form keeps the filter’s error behaviour independent of where the vehicle happens to be pointing. In practice that means it doesn’t get overconfident after a turn, which is exactly when the late fixes above do their damage.

The Mongla site's panel of what the vehicle sees, believes and does
See, believe, do: the estimator is the middle column, and every input to it has a different age.Open image to inspect at full size.

The DVL question

Does Mongla need the expensive sensor? A spec sheet can’t answer that. Only whether the cheap estimate clears the bar the mission needs, measured in water, can. The camera’s three 30 cm manual slides in air reached a maximum distance-magnitude error of 1.09 cm; that is not the same as validated underwater velocity accuracy. At the time of that record, the board could not accept an external velocity measurement. A promising bench result still needed an integration path and an in-water evaluation.

That’s the end of Time for now. The next series is about whether any of these numbers can be trusted at all: Measuring honestly.