task_reflectance module

task_reflectance.py

Cooperative scheduler task that wraps the Reflectance_Sensor driver. The task progresses through four states driven by the reflectanceMode share:

  • S0_IDLE: Wait for a mode command.

  • S1_CALIB_DARK: Run the dark-surface calibration sequence.

  • S2_CALIB_LIGHT: Run the light-surface calibration sequence.

  • S3_RUN: Continuously read the sensor, publish the line centroid

    and line-found flag to shares, and log centroid + elapsed time to queues.

class task_reflectance.task_reflectance(reflectanceSensor, reflectanceMode, lineCentroid, lineFound, centroidValues, centroidTimeValues)[source]

Bases: object

Scheduler task that controls the reflectance sensor through calibration and line-following states.

run()[source]

Cooperative function for scheduler