rov-autonomy/widgets/README.md

58 lines
2.6 KiB
Markdown

# Argonaut 3 — Cockpit DIY Widgets
## Requirements
- **Cockpit native desktop app v1.17.0** (Windows `.exe` installer)
- The BlueOS browser extension version does NOT support DIY widgets
- Download from: https://github.com/bluerobotics/cockpit/releases/tag/v1.17.0
## How to install a widget
1. Open the Cockpit native desktop app
2. Connect to the vehicle / VM (`100.84.141.120` for dev VM)
3. Enter edit mode (pencil icon, top right)
4. Click **Add Widget** at the bottom of the screen
5. Scroll right to find the `</>` DIY widget — drag it onto the view
6. Click the **gear icon** on the widget to open the editor
7. Click **Import** and select the `.json` file for the widget you want
8. The widget will load immediately
> **Note:** Widget files are `.json` format (not `.html`).
> Cockpit expects a JSON file with `html`, `css`, and `js` fields.
## Widget index
| File | Widget | Notes |
|---|---|---|
| w0_data_lake_inspector.json | Data Lake Inspector | Diagnostic — shows all data lake variables. Not production. |
| w1_system_health_indicator.json | System Health Indicator | Traffic light GREEN/AMBER/RED. Reads `rov_failsafe` from data lake. |
| w2_mission_status.json | Mission Status | Progress bar + state. Reads `rov_mission_state` and `rov_mission_progress`. |
| w3_abort_button.json | Abort Button | Confirm dialog → POST /abort to FastAPI. Edit `FASTAPI_HOST` before use. |
| w4_mission_setup_button.json | Mission Setup Button | Opens setup page in new tab. Edit `SETUP_URL` before use. |
| w5_battery_return_budget.json | Return Budget | Headroom warning. Reads `SYS_STATUS/battery_remaining` (native) + `rov_return_budget`. |
## Config values to edit before field use
In `w3_abort_button.json` (line 1 of the JS section):
```
var FASTAPI_HOST = 'http://blueos.local:8081';
```
In `w4_mission_setup_button.json` (line 1 of the JS section):
```
var SETUP_URL = 'http://blueos.local:8081/setup';
```
Both values are correct for real hardware. For the dev VM, replace `blueos.local` with the VM Tailscale IP.
## Widget data dependencies
| Widget | Works without backend? | Requires |
|---|---|---|
| W0 Data Lake Inspector | Yes — shows live MAVLink data immediately | Vehicle connected |
| W1 System Health | Shows "waiting" until bridge runs | NAMED_VALUE bridge node |
| W2 Mission Status | Shows "waiting" until bridge runs | NAMED_VALUE bridge node |
| W3 Abort Button | Button visible, POST will fail | FastAPI backend container |
| W4 Setup Button | Button visible, opens 404 | Extension backend serving setup page |
| W5 Return Budget | Battery% shows live, budget shows 0% | FastAPI backend for return budget calc |