ui.ui_linefollow module

Line-following activation screen for the Romi robot UI.

Starts the autonomous line-following mode by enabling the reflectance sensor array, both motors, and the line-following controller. While running, sensor telemetry is streamed between CSV_BEGIN / CSV_END markers so the host can log data. The user presses Enter to stop, at which point all actuators and the controller are disabled and setpoints are zeroed.

ui.ui_linefollow.run(ui)[source]

Generator that manages the full lifecycle of one line-following session.

Sequence:
  1. Enable reflectance sensor (mode 3) and both motors.

  2. Yield once to let the sensor task pick up the mode change.

  3. Enable the line-following controller.

  4. Write CSV_BEGIN marker and enter a non-blocking wait loop.

  5. On Enter / Return: break, write CSV_END, disable everything.

Args:
ui: UI context object exposing _ser, _reflectanceMode,

_leftMotorGo, _rightMotorGo, _lineFollowGo, _leftMotorSetPoint, and _rightMotorSetPoint shares/queues.

Yields:

int: 0 on every loop iteration to cooperate with the scheduler.