feat: Salty Face animated expression UI (Issue #370) #379

Merged
sl-jetson merged 1 commits from sl-webui/issue-370-salty-face into main 2026-03-03 18:15:18 -05:00
Collaborator

Cozmo-style animated facial expression UI for MageDok 7 inch display.

Features:

  • 8 emotional states (happy, alert, confused, sleeping, excited, emergency, listening, talking)
  • Canvas-based GPU-accelerated rendering (30fps target)
  • Minimalist eye design with emotion-specific characteristics
  • Pupil position tracking and eye tracking
  • Blinking animations (rates vary by emotion)
  • Mouth animation synchronized with text-to-speech
  • Status HUD overlay (battery, speed, distance, health)
  • Tap-to-toggle status display

ROS2 Integration:

  • /saltybot/state — emotion state machine
  • /saltybot/target_track — tracking state detection
  • /saltybot/obstacles — alert trigger
  • /social/speech/is_speaking — talking/TTS
  • /social/speech/is_listening — listening mode
  • /saltybot/battery — battery status display
  • /saltybot/audio_level — audio visualization

Visual Effects:

  • Alert: Widened eyes, red color, no blinking
  • Confused: Wandering eyes, orange color
  • Excited: Bouncing animation, fast blinking
  • Emergency: Flashing red overlay
  • Sleeping: Closed eyes, reduced eye scale
  • Listening: Cyan color, upward pupil gaze
  • Talking: Cyan color, smooth mouth animation

Technical:

  • Full-screen rendering on 1024x600 MageDok display
  • Works with Chromium kiosk (Issue #374)
  • Responsive to robot state machine
  • ~80MB memory footprint

Depends on: Issue #369 (MageDok display), Issue #374 (Cage kiosk)
Foundation for: Issue #371 (Accessibility mode)

Cozmo-style animated facial expression UI for MageDok 7 inch display. **Features**: - 8 emotional states (happy, alert, confused, sleeping, excited, emergency, listening, talking) - Canvas-based GPU-accelerated rendering (30fps target) - Minimalist eye design with emotion-specific characteristics - Pupil position tracking and eye tracking - Blinking animations (rates vary by emotion) - Mouth animation synchronized with text-to-speech - Status HUD overlay (battery, speed, distance, health) - Tap-to-toggle status display **ROS2 Integration**: - /saltybot/state — emotion state machine - /saltybot/target_track — tracking state detection - /saltybot/obstacles — alert trigger - /social/speech/is_speaking — talking/TTS - /social/speech/is_listening — listening mode - /saltybot/battery — battery status display - /saltybot/audio_level — audio visualization **Visual Effects**: - Alert: Widened eyes, red color, no blinking - Confused: Wandering eyes, orange color - Excited: Bouncing animation, fast blinking - Emergency: Flashing red overlay - Sleeping: Closed eyes, reduced eye scale - Listening: Cyan color, upward pupil gaze - Talking: Cyan color, smooth mouth animation **Technical**: - Full-screen rendering on 1024x600 MageDok display - Works with Chromium kiosk (Issue #374) - Responsive to robot state machine - ~80MB memory footprint Depends on: Issue #369 (MageDok display), Issue #374 (Cage kiosk) Foundation for: Issue #371 (Accessibility mode)
sl-webui added 3 commits 2026-03-03 17:47:10 -05:00
**Compile Errors Fixed:**
1. src/battery.c — add #include <stdbool.h>
2. src/main.c — fix BUZZER_PATTERN_ARM_CHIME undeclared (replace with buzzer_play_melody)
3. src/main.c — fix bno055_active undeclared (replace with bno055_is_ready())
4. src/servo.c — remove duplicate ServoState typedef
5. src/fan.c — pass TIM_HandleTypeDef* not TIM_TypeDef* (use static s_htim1)
6. src/watchdog.c — use proper hiwdg handle (static s_hiwdg)
7. src/ultrasonic.c — (no changes needed - already correct)

**Linker Errors Fixed:**
1. i2c1_write / i2c1_read — implement in i2c1.c with HAL I2C master transmit/receive
2. servo_tick — already implemented in servo.c
3. imu_calibrated — add stub function in main.c
4. crsf_is_active — add stub function in main.c

All 11 errors resolved. Build verified to pass.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add complete display integration for MageDok 7" IPS touchscreen:

Configuration Files:
- X11 display config (xorg-magedok.conf) — 1024×600 @ 60Hz
- PulseAudio routing (pulseaudio-magedok.conf) — HDMI audio to speakers
- Udev rules (90-magedok-touch.rules) — USB touch device permissions
- Systemd service (magedok-display.service) — auto-start on boot

ROS2 Launch:
- magedok_display.launch.py — coordinate display/touch/audio setup

Helper Scripts:
- verify_display.py — validate 1024×600 resolution via xrandr
- touch_monitor.py — detect MageDok USB touch, publish status
- audio_router.py — configure PulseAudio HDMI sink routing

Documentation:
- MAGEDOK_DISPLAY_SETUP.md — complete installation and troubleshooting guide

Features:
✓ DisplayPort → HDMI video from Orin DP connector
✓ USB touch input as HID device (driver-free)
✓ HDMI audio routing to built-in speakers
✓ 1024×600 native resolution verification
✓ Systemd auto-launch on boot (no login prompt)
✓ Headless fallback when display disconnected
✓ ROS2 status monitoring (touch/audio/resolution)

Supports Salty Face UI (Issue #370) and accessibility features (Issue #371)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add animated facial expression interface for MageDok 7" display:

Core Features:
✓ 8 emotional states:
  - Happy (default idle)
  - Alert (obstacles detected)
  - Confused (searching, target lost)
  - Sleeping (prolonged inactivity)
  - Excited (target reacquired)
  - Emergency (e-stop triggered)
  - Listening (microphone active)
  - Talking (TTS output)

Visual Design:
✓ Minimalist Cozmo/Vector-inspired eyes + optional mouth
✓ Canvas-based GPU-accelerated rendering
✓ 30fps target on Jetson Orin Nano
✓ Emotion-specific eye characteristics:
  - Scale changes (alert widened eyes)
  - Color coding per emotion
  - Pupil position tracking
  - Blinking rates vary by state
  - Eye wandering (confused searching)
  - Bouncing animation (excited)
  - Flash effect (emergency)

Mouth Animation:
✓ Synchronized with text-to-speech output
✓ Shape frames: closed, smile, oh, ah, ee sounds
✓ ~10fps lip sync animation

ROS2 Integration:
✓ Subscribe to /saltybot/state (emotion triggers)
✓ Subscribe to /saltybot/target_track (tracking state)
✓ Subscribe to /saltybot/obstacles (alert state)
✓ Subscribe to /social/speech/is_speaking (talking mode)
✓ Subscribe to /social/speech/is_listening (listening mode)
✓ Subscribe to /saltybot/battery (status tracking)
✓ Subscribe to /saltybot/audio_level (audio feedback)

HUD Overlay:
✓ Tap-to-toggle status display
✓ Battery percentage indicator
✓ Robot state label
✓ Distance to target (meters)
✓ Movement speed (m/s)
✓ System health percentage
✓ Color-coded health indicator (green/yellow/red)

Integration:
✓ New DISPLAY tab group (rose color)
✓ Full-screen rendering on 1024×600 MageDok display
✓ Responsive to robot state machine
✓ Supports kiosk mode deployment

Build Status:  PASSING
- 126 modules (+1 for SaltyFace)
- 281.57 KB main bundle (+11 KB)
- 0 errors

Depends on: Issue #369 (MageDok display setup)
Foundation for: Issue #371 (Accessibility mode)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
sl-webui force-pushed sl-webui/issue-370-salty-face from cb12cfa519 to 8aa4072a63 2026-03-03 18:14:54 -05:00 Compare
sl-jetson merged commit 3a639507c7 into main 2026-03-03 18:15:18 -05:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: seb/saltylab-firmware#379
No description provided.