Skip to content
← Atlas Rover Mk.1

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,STOP protection.
  • 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 /app and 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

BoardResponsibilitiesWhat It Does Not Do
DualEyeBinocular expressions, pages, touch, voice, MimiClaw, sending motion intent to the chassis boardDoes not directly drive motors, does not power motors from itself, does not bypass safety trimming
XIAO ESP32C3 Chassis BoardOpen-loop short-duration differential speed control for ordinary N20 + DRV8833, speed limiting, timeout parking based on duration_ms, ACK feedbackDoes 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

FilePurpose
firmware/dualeye/main/main.cProgram 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:

ExpressionPurpose
idleIdle state
happyCommand success, interaction success
listenWake-up/listening
thinkingMimiClaw processing command
speakingPlaying voice response
movingChassis executing movement
curiousUncertain, waiting for confirmation, chassis busy
sleepyLong idle or low-power preparation
surprisedEmergency stop/sudden touch
winkTask completion easter egg
angryRejecting dangerous command
chargingCharging
errorUART/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 IntentDualEye ExpressionUART Output
Wake-uplistenNo movement command sent
UnderstandingthinkingNo movement command sent
Move Forwardmoving, gaze forwardAR1,MOVE,F,40,500
Move Backwardmoving, gaze downwardAR1,MOVE,B,35,400
Turn Leftmoving, gaze leftAR1,TURN,L,30,350
Turn Rightmoving, gaze rightAR1,TURN,R,30,350
StopidleAR1,STOP

6. Safety Policy

  1. DualEye only actively sends commands prefixed with AR1,.
  2. After power-on, it first sends AR1,STOP.
  3. After each movement command, DualEye sends a delayed AR1,STOP based on the action duration.
  4. The chassis board must still independently implement a motion cutoff watchdog: each motion command must include duration_ms to automatically stop after the specified time; abnormal commands must stop immediately.
  5. The chassis board must ignore any content not prefixed with AR1,.
  6. Motor power must not be drawn from DualEye; DualEye, the chassis board, and motor power share only the GND.
  7. 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.
  8. STOP does not require a pairing code; movement, configuration changes, reboots, and configuration clearing require a 6-digit pairing code.
  9. LLM/MimiClaw cannot directly output UART strings; they can only output structured intentions, which are then filtered by the local Safety Guard.
  10. 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.
  11. The default control mode is manual: web direction buttons can control the rover; switching to ai mode allows voice/mimiClaw movement intentions to control it, while web direction buttons are rejected.

7. Real Machine Adaptation To-Do List

To-DoFile LocationDescription
Dual-Screen LCD Initializationatlas_display.cIntegrate Waveshare official ESP-IDF/LVGL example
Round-Screen Drawingatlas_display.cRender atlas_eye_frame_t as left/right 240 × 240 layers
Touch InputNew or extended UI layerTouch to switch pages, themes, confirm/cancel commands
Microphone & TTS Volumeatlas_ui_state_t.audio_levelMake listen/speaking emoji pulse with volume
MimiClawatlas_voice.*Map semantic output to atlas_voice_event_t
Real-Machine UART Pin Confirmationatlas_rover_uart.*Currently using LCD1 UART port as per official spec: Pin10 TXD → XIAO D7/GPIO20, Pin9 RXD ← XIAO D6/GPIO21
Real LLM/Host Invocationatlas_llm_client.*Currently only configuration state; later connect via HTTPS/HTTP or WebSocket
Admin Page Optimizationatlas_admin_http.*Currently basic embedded page; later add logs, emoji debugging, OTA, and improved mobile layout
mDNS/Device Discoveryatlas_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:

PartitionSizePurpose
nvs24 KBStores Wi-Fi, LLM/API, and security configurations
factory4 MBDualEye application firmware
storage4 MBReserved 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.