Project files
7 KB
Machine-translated by Robotheca from the original in Chinese (opens in a new tab). License: MIT (opens in a new tab).
Atlas Rover Mk.1 DualEye Firmware V0.1/V0.2 Design Description
1. Version Objectives
The goal of DualEye Firmware V0.1 is not to complete all hardware drivers at once, but to first stabilize the core program framework:
- Dual physical round-screen expression model.
- Page and expression state machine.
- MimiClaw voice event entry.
- UART chassis control protocol.
- Movement safety timeout and
AR1,STOPprotection. - Subsequent adaptation boundaries for Waveshare's official dual-screen, touch, and audio drivers.
V0.2 will continue to fill in the framework for "how to configure and debug after flashing":
- NVS storage for Wi-Fi, LLM/API, and security settings.
- SoftAP/STA/APSTA network startup.
- Web management page for mobile/PC.
- Separation of user application page
/appand admin backend/admin; root path/defaults to the application page. - 6-digit pairing code.
- STOP, short-movement, and text intent test APIs.
- Placeholder for MimiClaw adaptation layer.
2. Responsibilities of the Dual Boards
| Board | Responsibilities | What It Does Not Do |
|---|---|---|
| DualEye | Binocular expressions, pages, touch, voice, MimiClaw, sending motion intent to the chassis board | Does not directly drive motors, does not power motors from itself, does not bypass safety trimming |
| XIAO ESP32C3 Chassis Board | Open-loop short-duration differential speed control for ordinary N20 + DRV8833, speed limiting, timeout parking based on duration_ms, ACK feedback | Does not perform complex voice understanding, does not handle DualEye UI, does not guarantee precise distance/angle, does not directly drive lighting themes |
4. Program Structure
| File | Purpose |
|---|---|
firmware/dualeye/main/main.c | Program entry point, starts UI, UART RX, and development event demo tasks |
atlas_expression.* | Dual-eye expression parameter frame. One screen per eye, parameters include gaze, iris, pupil, eyelid, eyebrow line, color, and animation effects |
atlas_display.* | Display adapter layer. V0.1 outputs logs first; when connected to the real device, replace with LVGL/screen drawing |
atlas_rover_uart.* | AR1 UART protocol encapsulation, responsible for sending STOP/MOVE/TURN commands and parsing ACK |
atlas_voice.* | Voice event and text intent normalization entry |
atlas_ui.* | Page, expression, movement, and safety state machine |
atlas_config.* | NVS configuration read/write, saves Wi-Fi, LLM, safety, and UI configurations |
atlas_wifi.* | SoftAP/STA/APSTA network startup and status query |
atlas_admin_http.* | Web management page and REST API |
atlas_pairing.* | Generates a 6-digit local pairing code on startup |
atlas_llm_client.* | LLM configuration status and readiness check, does not directly control motors |
atlas_mimiclaw_adapter.* | Converts local text or subsequent MimiClaw results into atlas_voice_intent_t |
The ATLAS_ENABLE_DEV_EVENT_DEMO macro in main.c is enabled by default to observe expression state transitions (listening, thinking, speaking, success) after flashing; it does not send movement commands. After connecting to a real MimiClaw, this macro can be set to 0.
4. Expression States
The current firmware includes the following expression enumerations:
| Expression | Purpose |
|---|---|
idle | Idle state |
happy | Command success, interaction success |
listen | Wake-up/listening |
thinking | MimiClaw processing command |
speaking | Playing voice response |
moving | Chassis executing movement |
curious | Uncertain, waiting for confirmation, chassis busy |
sleepy | Long idle or low-power preparation |
surprised | Emergency stop/sudden touch |
wink | Task completion easter egg |
angry | Rejecting dangerous command |
charging | Charging |
error | UART/power/chassis failure |
5. Voice-to-Motion Link
flowchart LR
A["Microphone/Touch Wake-up"] --> B["MimiClaw Understanding"]
B --> C["atlas_voice_intent_t"]
C --> D["atlas_ui State Machine"]
D --> E["Expression Switching"]
D --> F["AR1 UART Commands"]
F --> G["Chassis Board"]
G --> H["DRV8833 / Motors"]
G --> I["AR1 ACK"]
I --> D
Example:
| User Intent | DualEye Expression | UART Output |
|---|---|---|
| Wake-up | listen | No movement command sent |
| Understanding | thinking | No movement command sent |
| Move Forward | moving, gaze forward | AR1,MOVE,F,40,500 |
| Move Backward | moving, gaze downward | AR1,MOVE,B,35,400 |
| Turn Left | moving, gaze left | AR1,TURN,L,30,350 |
| Turn Right | moving, gaze right | AR1,TURN,R,30,350 |
| Stop | idle | AR1,STOP |
6. Safety Policy
- DualEye only actively sends commands prefixed with
AR1,. - After power-on, it first sends
AR1,STOP. - After each movement command, DualEye sends a delayed
AR1,STOPbased on the action duration. - The chassis board must still independently implement a motion cutoff watchdog: each motion command must include
duration_msto automatically stop after the specified time; abnormal commands must stop immediately. - The chassis board must ignore any content not prefixed with
AR1,. - Motor power must not be drawn from DualEye; DualEye, the chassis board, and motor power share only the GND.
- Web/voice movement is enabled by default for out-of-the-box convenience; it can still be disabled in the management page's security settings.
STOPdoes not require a pairing code; movement, configuration changes, reboots, and configuration clearing require a 6-digit pairing code.- LLM/MimiClaw cannot directly output UART strings; they can only output structured intentions, which are then filtered by the local Safety Guard.
- API keys are not hardcoded, not uploaded to GitHub, and not printed in logs; NVS encryption is not yet enabled in the current prototype phase.
- The default control mode is
manual: web direction buttons can control the rover; switching toaimode allows voice/mimiClaw movement intentions to control it, while web direction buttons are rejected.
7. Real Machine Adaptation To-Do List
| To-Do | File Location | Description |
|---|---|---|
| Dual-Screen LCD Initialization | atlas_display.c | Integrate Waveshare official ESP-IDF/LVGL example |
| Round-Screen Drawing | atlas_display.c | Render atlas_eye_frame_t as left/right 240 × 240 layers |
| Touch Input | New or extended UI layer | Touch to switch pages, themes, confirm/cancel commands |
| Microphone & TTS Volume | atlas_ui_state_t.audio_level | Make listen/speaking emoji pulse with volume |
| MimiClaw | atlas_voice.* | Map semantic output to atlas_voice_event_t |
| Real-Machine UART Pin Confirmation | atlas_rover_uart.* | Currently using LCD1 UART port as per official spec: Pin10 TXD → XIAO D7/GPIO20, Pin9 RXD ← XIAO D6/GPIO21 |
| Real LLM/Host Invocation | atlas_llm_client.* | Currently only configuration state; later connect via HTTPS/HTTP or WebSocket |
| Admin Page Optimization | atlas_admin_http.* | Currently basic embedded page; later add logs, emoji debugging, OTA, and improved mobile layout |
| mDNS/Device Discovery | atlas_wifi.* | Currently uses SoftAP address or LAN IP; later add atlas-rover.local |
8. Current Verification
This version must at least pass:
cd firmware/dualeye
export IDF_PATH="$HOME/.espressif/esp-idf-v5.5.2"
export IDF_PYTHON_ENV_PATH="$HOME/.espressif/python_env/idf5.5_py3.9_env"
. "$IDF_PATH/export.sh"
idf.py build
After a successful build, the firmware skeleton, module separation, and ESP-IDF configuration are confirmed usable; subsequent steps will involve real-device display/audio adaptation.
The current project configures the Flash as 16 MB according to the DualEye official specifications and uses a custom partition table:
| Partition | Size | Purpose |
|---|---|---|
nvs | 24 KB | Stores Wi-Fi, LLM/API, and security configurations |
factory | 4 MB | DualEye application firmware |
storage | 4 MB | Reserved for future resources, logs, or file system |
Local build V0.5 passes, with the application image approximately 0x110770 bytes, leaving ample space in the 4 MB app partition. PSRAM still requires further validation in conjunction with the real dual-screen/LVGL buffer strategy.
Files by @davidwang960707-gpu, at commit 675d6f2, read from GitHub in your browser. Hardware license: MIT; software license: MIT. Robotheca doesn't review code: read it before running it.