step.calibration.calibrate_wfl

Wait-for-light sensor calibration step using the new UI library.

Classes

WFLCalibrationResult

Result of wait-for-light sensor calibration.

CalibrateWaitForLight

Calibrate a wait-for-light sensor via interactive measurement.

Module Contents

class step.calibration.calibrate_wfl.WFLCalibrationResult

Result of wait-for-light sensor calibration.

light_off: float
light_on: float
threshold: float
class step.calibration.calibrate_wfl.CalibrateWaitForLight(sensor: raccoon.hal.AnalogSensor)

Bases: raccoon.ui.step.UIStep

Calibrate a wait-for-light sensor via interactive measurement.

Guides the operator through a two-step measurement flow: first cover the sensor (dark reading), then expose it to the start lamp (light reading). The midpoint threshold is computed and stored so the wait_for_light_legacy step can detect the lamp signal.

The operator can retry measurements if the values look wrong before confirming the calibration.

Parameters:

sensor – The AnalogSensor instance to calibrate.

Example:

from raccoon.step.calibration import calibrate_wait_for_light

calibrate_wait_for_light(robot.defs.wait_for_light_sensor)
sensor
calibration_result: WFLCalibrationResult | None = None