Skip to content

tof: reopen the sensor when it answers polls but never produces a frame - #272

Open
hadelan wants to merge 1 commit into
pollen-robotics:mainfrom
hadelan:tof-frame-watchdog
Open

tof: reopen the sensor when it answers polls but never produces a frame#272
hadelan wants to merge 1 commit into
pollen-robotics:mainfrom
hadelan:tof-frame-watchdog

Conversation

@hadelan

@hadelan hadelan commented Sep 12, 2026

Copy link
Copy Markdown

A wedged ranging engine still ACKs the I²C bus, so data_ready succeeds and answers false forever: tofd streams silence for the rest of the boot and nothing ever re-opens the sensor. The only "sensor is gone" signal today is a failed transaction, and this failure never produces one.

Put a clock on the answer: no frame for a few frame periods (2 s at the shipped 15 Hz, scaled so --hz 1 gets the same margin in frames) breaks the poll loop into the existing backoff-and-reopen path. Armed at open, so a sensor that never produces a first frame is reopened on the same bound.

Regression test pins the watchdog scaling. cargo test -p tof, clippy -D warnings, fmt --check all green.

A wedged ranging engine still ACKs the bus, so data_ready succeeds and
answers false forever: the daemon streamed silence for the rest of the
boot and nothing ever re-opened the sensor. Put a clock on the answer —
no frame for a few frame periods (2 s at the shipped 15 Hz, scaled so
--hz 1 gets the same margin in frames) breaks the poll loop into the
existing backoff-and-reopen path. Armed at open, so a sensor that never
produces a first frame is reopened on the same bound.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant