ESP32-C3 NeoPixel sketch (esp32/social_expression/social_expression.ino):
- Adafruit NeoPixel + ArduinoJson, serial JSON protocol 115200 8N1
- Mood→colour: happy=green, curious=blue, annoyed=red, playful=rainbow
- Idle breathing animation (sine-modulated warm white)
- Auto-falls to idle after IDLE_TIMEOUT_MS (3 s) with no command
ROS2 saltybot_social_msgs (new package):
- Mood.msg — {mood, intensity}
- Person.msg — {track_id, bearing_rad, distance_m, confidence, is_speaking, source}
- PersonArray.msg — {persons[], active_id}
ROS2 saltybot_social (new package):
- expression_node: subscribes /social/mood → JSON serial to ESP32-C3
reconnects on port error; sends idle frame after idle_timeout_s
- attention_node: subscribes /social/persons → /cmd_vel rotation-only
proportional control with dead zone; prefers active speaker, falls
back to highest-confidence person; lost-target idle after 2 s
- launch/social.launch.py — combined launch
- config YAML for both nodes with documented parameters
- test/test_attention.py — 15 pytest-only unit tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
23 lines
846 B
YAML
23 lines
846 B
YAML
# expression_params.yaml — LED mood display bridge configuration.
|
|
#
|
|
# serial_port : udev symlink or device path for the ESP32-C3 USB-CDC port.
|
|
# Recommended: create a udev rule:
|
|
# SUBSYSTEM=="tty", ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001",
|
|
# SYMLINK+="esp32-social"
|
|
#
|
|
# baud_rate : must match social_expression.ino (default 115200)
|
|
#
|
|
# idle_timeout_s : if no /social/mood message arrives for this many seconds,
|
|
# the node sends {"mood":"idle","intensity":1.0} so the ESP32 breathing
|
|
# animation is synchronised with node awareness.
|
|
#
|
|
# control_rate : how often to check the idle timeout (Hz).
|
|
# Does NOT gate the mood messages — those are forwarded immediately.
|
|
|
|
expression_node:
|
|
ros__parameters:
|
|
serial_port: /dev/esp32-social
|
|
baud_rate: 115200
|
|
idle_timeout_s: 3.0
|
|
control_rate: 10.0
|