← All notes

The exposure setting that capped my frame rate

A rover camera stuck at 13.7 fps, a setting that said nothing about frame rate, and the deploy script I wrote after the robot ran stale code twice.

During my internship at Raisen I owned the eyes of a small autonomous rover: an NVIDIA Jetson with a stereo camera that delivers both views side by side in one 3840×1200 frame. The camera was meant to stream at 30 frames per second. It streamed at 13.7, and stayed there.

The setting that was not about speed

Nothing in the configuration mentioned frame rate. What it did have was an upper limit for auto-exposure: how long the sensor may collect light for one frame when the scene is dark. That limit was 5000.

The unit is the catch. Exposure on this sensor is counted in row-times — the time it takes to read one row of pixels, about 14.57 µs at full resolution. 5000 row-times is 72.9 ms, and a frame cannot finish faster than its own exposure. 1 / 0.0729 s is 13.7 frames per second. The "maximum brightness" knob was quietly a frame-rate ceiling, and once auto-exposure walked up to it the stream never recovered.

# 30 fps leaves 33.3 ms per frame.
# 33.3 ms / 14.57 µs per row ≈ 2290 row-times.
auto_exposure_max: 2290

Capping exposure at the longest value that still fits a 30 fps frame period took the measured stream from 13.7 to 29.9 fps. In bright light the change does nothing, because exposure never gets near either limit — which is exactly why the problem hid during daytime testing and only showed up indoors.

"Committed" is not "running"

The second lesson was less technical and cost more time. Twice, a fix was committed to the repository and never actually copied to the Jetson. One of those was a gyro gate in the heading filter: the repo said the filter was gated, the robot ran the ungated version for days, and nobody could tell from the code. I found it by grepping the file on the robot itself and getting zero matches.

So deployment became a script that copies every file, computes an md5 on both ends, and refuses to report success on any mismatch.

Both bugs had the same shape: the thing you look at (a config value, a git log) describes something slightly different from what the machine is actually doing. Now I check the machine.