This repository contains code to control a WS2812 (NeoPixel) LED ring based on emotion messages received via ROS (Robot Operating System). The project uses the Adafruit NeoPixel library for LED manipulation and integrates ROS communication to receive and process emotion messages. Additionally, the project is designed to work in conjunction with the Display Emotions project to develop the representation of emotions for the Apollo robot from the LASER lab.
- WS2812 LED Control: Configures and controls a ring of 16 WS2812 LEDs.
- ROS Integration: Receives emotion messages through ROS and changes the LED colors according to the received emotion.
- Emotion-to-Color Mapping: Defines a mapping of 24 emotions to specific RGB colors based on the Plutchik's wheel of emotions.
- Adafruit NeoPixel Library - Documentation
- ROS (Robot Operating System) - Documentation
- rosserial_arduino - Documentation
Clone the repository
https://github.com/GabrielSpdf/apollo_heart.git
roslaunch display_emotions display_emotions.launch
rosrun rosserial_python serial_node.py /dev/ttyACM0
Note
Replace /dev/ttyACM0 with the USB port where your device is connected.
rostopic pub /utbots/display_emotions/emotion std_msgs/String "data: 'joy'"
Below is a demonstration of the project using the emotions TRUST and RAGE, respectively:
When the robot's face changes color, the heart color should follow this change.
To improve the appearance and the idea of the heart in a resting state, it would be ideal to add a color pulse to the heart, similar to a real heartbeat.
It is essential that, just as the robot's face transitions between colors according to the Plutchik's wheel of emotions, the heart should also transition between colors.
Note
In the project folder, there is a file called for_future, which was left as a basis for implementing the color transitions.