ESP-Daemon is a communication and control system for Eurobot robots, implemented using Seeed Studio XIAO ESP32C3 and ROS2. The system provides multiple features including SIMA communication (ESP-NOW Bridge), RGB strip control, wireless emergency stop, and BMS (Battery Management System) integration.
- Main Controller: Seeed Studio XIAO ESP32C3
- 32-bit RISC-V @ 160MHz processor
- 400KB SRAM, 4MB Flash
- 2.4GHz WiFi and Bluetooth 5.0
- USB Type-C interface
- SIMA Communication: Low-latency robot-to-robot communication using ESP-NOW protocol
- RGB Strip Control: Support for programmable RGB strips like WS2812B
- Wireless Emergency Stop: Remote emergency stop functionality
- BMS Integration: Battery Management System integration
- ROS2 Integration: Seamless integration with ROS2 ecosystem using micro-ROS
- Docker Support: Containerized deployment solution
- Web Interface: Built-in web UI for device configuration and monitoring
- Ubuntu 20.04 or higher
- Docker and Docker Compose
- ROS2 Humble or higher
- PlatformIO IDE (for ESP32 firmware development)
git clone https://github.com/DIT-ROBOTICS/ESP-Daemon.git
cd ESP-Daemoncd esp_firmware
pio runpio run -t uploadAfter uploading the firmware, the device will create a WiFi access point. Connect to it and navigate to:
http://192.168.4.1
Start the services using Docker Compose:
docker compose up-
Modify settings in
esp_firmware/platformio.ini:- Update
upload_portto your XIAO ESP32C3 device port (usually/dev/ttyACM0) - Adjust
monitor_speedas needed (default: 115200)
- Update
-
Configure in
esp_firmware/include/config.h:- WiFi settings
- ESP-NOW peer addresses
- RGB strip configuration
- BMS parameters
-
Environment Variables:
export ROS_DOMAIN_ID=<same_as_esp_config>
-
Docker Configuration:
- Set appropriate environment variables in
docker-compose.yaml - Ensure proper device and directory mounting
- Set appropriate environment variables in
The system uses a numeric command system through the /sima/start topic:
-
Send commands using ROS2:
# Format: ros2 topic pub /sima/start std_msgs/msg/Int16 "{data: <command>}" # Send command to all SIMA devices ros2 topic pub /sima/start std_msgs/msg/Int16 "{data: 5}"
-
Monitor system status:
# Monitor battery voltage ros2 topic echo /robot_status/battery_voltage # Monitor device heartbeat ros2 topic echo /esp32_counter
The emergency stop system uses a relay control through the /robot_status/emergency_stop topic:
-
Trigger emergency stop:
# Enable emergency stop ros2 topic pub /robot_status/emergency_stop std_msgs/msg/Bool "{data: true}" # Disable emergency stop ros2 topic pub /robot_status/emergency_stop std_msgs/msg/Bool "{data: false}"
-
The system will:
- Enable relay when emergency stop is triggered
- Disable relay when emergency stop is released
- Automatically handle mode transitions
The system continuously monitors battery voltage:
-
View real-time battery voltage:
ros2 topic echo /robot_status/battery_voltage -
The voltage is published as a Float32 value in the
/robot_status/battery_voltagetopic
The device operates in different modes:
WAITING_AGENT: Initial state, waiting for ROS2 agentAGENT_AVAILABLE: ROS2 agent is availableAGENT_CONNECTED: Successfully connected to ROS2 agentAGENT_DISCONNECTED: Lost connection to ROS2 agent
-
ESP32 Firmware Development:
- Add new features in
esp_firmware/src - Update dependencies in
platformio.ini
- Add new features in
-
ROS2 Node Development:
- Create new ROS2 packages in
esp_daemon_ws/src - Update Docker configuration to include new packages
- Create new ROS2 packages in
