ui.ui_imu module¶
IMU submenu for the Romi robot serial UI.
Presents a looping menu over the serial terminal for interacting with the
BNO055 IMU task. Each menu option sends a mode command to the IMU task via
a shared queue and then blocks (cooperatively, with yield) until the IMU
task clears the queue to signal completion.
- Menu options:
1 – Load calibration from persistent storage 2 – Save current calibration to persistent storage 3 – Tare (zero) accelerometer and gyroscope readings 4 – Read and display current heading and heading rate 5 – Display calibration status for all sensor axes (0 = uncal, 3 = fully cal) 0 – Exit submenu
- ui.ui_imu.run(ui)[source]¶
Generator implementing the IMU submenu interaction loop.
Draws the menu, reads a single-character command, sends it to the IMU task, waits for acknowledgement, and redraws. Exits when the user selects
0.Synchronisation: the UI puts a command code (1–5) into
ui._imuMode; the IMU task executes the command and writes0back when done. The UI spins withyielduntil it reads0.Calibration status (option 5) is returned as a packed byte from the BNO055 register: bits [7:6] = system, [5:4] = gyro, [3:2] = accel, [1:0] = magnetometer.
- Args:
- ui: UI context object exposing
_ser,_imuMode,_imuHeading, _imuHeadingRate, and_imuCalibshares/queues.
- ui: UI context object exposing
- Yields:
None: On every serial poll and while waiting for the IMU task to finish.