BotUI

BotUI is the touchscreen app on the Raspberry Pi inside every RaccoonOS robot. It shows live sensor data, starts and stops your programs, manages the network, and shows the screens your program asks for while it runs. You can do all of this without a laptop or an SSH session.

It is a Flutter app (package name stpvelox) that runs on flutter-pi, directly on the Pi’s framebuffer. There is no desktop environment. The display is 800×480 and the app also works rotated (see Settings → Display ).

What BotUI Is (and Is Not)

BotUI does not contain any robot logic. It is a window into the services that already run on the robot, and a remote control for them:

  • Live hardware data (sensors, motors, servos, IMU, battery, camera) comes over the shared-memory transport (raccoon_ring). BotUI only subscribes and publishes on named channels.
  • Running programs, logs and versions go through the raccoon-server on localhost:8421. BotUI is a client of that server, like raccoon run on your laptop.
  • System settings (hostname, keyboard, Wi-Fi, services, reboot) are done by running OS commands (systemctl, hostnamectl, NetworkManager, …) with sudo. The settings live in the OS, not in BotUI.

How BotUI Talks to the Robot

graph LR
    subgraph "BotUI (Flutter)"
        W[Screens / Riverpod providers]
        TS[TransportService]
        EX[RaccoonExecutionClient]
    end
    subgraph "Shared memory"
        RING["raccoon_ring
(/dev/shm)"] end subgraph "Robot services" STM["stm32-data-reader
(sensors, motors, servos)"] LIB["raccoon-lib
(your program)"] CAM["raccoon-cam"] CALIB["raccoon-calib-bridge"] SRV["raccoon-server
:8421"] end W --> TS TS -->|"FFI: libraccoon_ring_bridge.so"| RING RING <--> STM RING <--> LIB RING <--> CAM RING <--> CALIB W --> EX EX -->|"HTTP + WebSocket"| SRV SRV -->|"runs"| LIB

Transport. libraccoon_ring_bridge.so is a small C++ library that is built into every BotUI package. It exposes the raccoon_ring API to Dart through FFI. TransportService is the single entry point in the app. Every screen subscribes to a channel (for example a sensor value) or publishes on one (for example a motor command). A timer drains the incoming frames about 30 times per second and hands them to Riverpod providers, which rebuild the widgets. The channel list is in Transport .

Execution server. To start, stop or inspect a program, BotUI calls the raccoon-server:

WhatHow
Start a programPOST /api/v1/run/<project>
Live outputWebSocket /ws/output/<command>
StopPOST /api/v1/commands/<command>/cancel
Is something running?GET /api/v1/commands/running
Logs of earlier runsGET /api/v1/logs/<project>/runs
Component versionsGET /version

BotUI reads the API token from /home/pi/.raccoon/api_token. On a machine without this file (for example when you try the UI on your PC) the server features simply stay empty or show an error.

Screen Map

graph TD
    DASH["Dashboard (/)"]
    DASH --> SENS["Sensors & Actors"]
    DASH --> PROG["Programs"]
    DASH --> SETT["Settings"]

    SENS --> CAT["Category lists
(Analog, Digital, Motor, Servo, IMU)"] CAT --> SCR["Graph / Motor / Servo / Quaternion screens"] SENS --> CAM["Camera"] SENS --> SYS["System Health → Disk Usage"] SENS --> CB["Calibration Board"] PROG --> RUN["Program screen
(Start, Advanced, terminal)"] SETT --> NET["Network"] SETT --> SYSS["System
(Hostname, Keyboard, Reboot, Shutdown)"] SETT --> DISP["Display
(Color Theme, Rotate, Overview, Screensaver, Calibrate, Hide UI)"] SETT --> PERS["Personality"] SETT --> LOGS["Logs"] SETT --> VER["Versions"] SETT --> SERV["Services"]

Navigation is a stack: every screen has a back arrow in the top bar, and the top bar also shows the battery voltage. Two things sit outside this tree, because they must be reachable from anywhere: the dynamic screens your program can show, and the Dev Menu .

Section Overview

PageWhat you will find
DashboardThe home screen: overview panel, menu tiles, screensaver
Sensors & ActorsSensor graphs, motor and servo control, camera, system health
ProgramsStarting, watching and stopping programs, sync state
SettingsNetwork, system, display, personality, logs, versions, services
Calibration BoardUSB-C board for optical-flow odometry and IMU calibration
Dynamic ScreensScreens your program shows on the display, and the answers it gets back
Dev MenuStop a program, restart the UI, reboot, reset the STM32, games
System PopupsLow battery, hardware shutdown, version mismatch, error and Ethernet dialogs
ScreenshotsTriple-click the built-in button to save a screenshot

Installing and Building BotUI

BotUI is part of the RaccoonOS image and is updated with raccoon update, so normally there is nothing to install. To build your own version, deploy it to a robot, or try the UI in a window on your PC, see Build System → botui .

Under the Hood

A few details that explain how BotUI behaves on the Pi:

  • Touch debounce. The resistive touchscreen often reports one press as several quick presses. A filter in front of the whole app drops a press that starts within 150 ms and 30 px of the last accepted one.
  • Touch calibration. The calibration matrix from Settings → Display → Calibrate is applied to every tap.
  • Frame stall watchdog. On the Pi 3 the rendering pipeline can occasionally freeze while the app logic keeps running. A watchdog notices that no frame was drawn, tries to wake the pipeline, and if that fails exits the app. flutter-ui.service is set to Restart=always with a 2 s delay, so the UI comes back by itself after a brief flicker.
  • Colors. Screens never hardcode a color. A tile asks for a named slot (red, green, blue, …) and the active color theme decides what it looks like.