This file implements the serial user-interface task. It inherits command-handling behavior from UserCmds and provides the live runtime interface used for tuning gains, calibrating sensors, printing diagnostic values, starting or stopping line-follow mode, and controlling estimator streaming.
This task is the main human-facing interface to the robot. It makes the robot much easier to test and tune because many settings can be changed at runtime rather than by repeatedly editing code.
| Name | Description |
|---|---|
_ser | USB serial interface object used for user interaction. |
_leftMotorGo, _rightMotorGo | Shares used to control motor enable from the UI. |
_Kp, _Ki | Gain Shares edited through the UI. |
_vBase | Line-follow base speed Share. |
_lfEnable | Share used to toggle line-follow mode. |
_estStreamEnable | Share used to enable observer streaming. |
_sens | Line sensor object used for calibration and printout commands. |
_imu | IMU object used for calibration and IMU printout commands. |
_courseEnable | Share used to start or stop the full course task. |
_buf, _mode, _num_str | Internal state used while collecting typed user input. |
| State | Description |
|---|---|
S0_INIT | Prints the help menu and prompt at startup. |
S1_CMD | Waits for user commands. |
S2_GET | Collects multi-character numeric input. |
S3_COL | Waits until log queues are ready to dump data. |
S4_DIS | Displays buffered data over the serial interface. |
This file made the full development process dramatically easier by turning many tuning and diagnostic tasks into serial commands rather than manual source edits. It is one of the most practical files in the project.