step.calibration.state

Runtime “has distance calibration run yet?” flag + stored-IR application.

These helpers used to live in calibrate_distance. That step (which rewrote the odometry ticks_to_rad baseline) is gone — distance error is now corrected on the trim layer by the setup CalibrationGate. The lightweight gate flag survives here so distance-based drives can keep warning when no calibration has run, and the gate marks it done when it finalizes.

Exceptions

CalibrationRequiredError

Raised when an operation requires calibration but none has been performed.

Functions

is_distance_calibrated(→ bool)

Check if distance calibration has been performed.

set_distance_calibrated(→ None)

Mark distance calibration as performed (called by the calibration gate).

check_distance_calibration(→ None)

Log a warning when distance calibration has not been performed yet.

reset_distance_calibration(→ None)

Reset the calibration flag (for testing).

load_stored_ir_calibration(→ None)

Apply stored IR thresholds from CalibrationStore to each sensor (used under --no-calibrate).

Module Contents

exception step.calibration.state.CalibrationRequiredError

Bases: Exception

Raised when an operation requires calibration but none has been performed.

step.calibration.state.is_distance_calibrated() bool

Check if distance calibration has been performed.

step.calibration.state.set_distance_calibrated() None

Mark distance calibration as performed (called by the calibration gate).

step.calibration.state.check_distance_calibration() None

Log a warning when distance calibration has not been performed yet.

step.calibration.state.reset_distance_calibration() None

Reset the calibration flag (for testing).

step.calibration.state.load_stored_ir_calibration(ir_sensors: list, calibration_sets: list[str], debug_fn, warn_fn) None

Apply stored IR thresholds from CalibrationStore to each sensor (used under –no-calibrate).