VID_20250205_163259.mp4
Eye Display Module
- Round Display Module with M5Stamp C3 (pio env name:
stampc3
) : https://www.switch-science.com/products/8098 - Round Display Module with M5Stamp S3 (pio env name:
stamps3
) : https://www.switch-science.com/products/8971
First you have to install ROS and PlatformIO
pip install platformio
And then, you can build and upload the firmware to the device.
It is recommended to put this repo in a catkin workspace.
mkdir ~/catkin_ws/src
cd ~/catkin_ws
catkin init
cd ~/catkin_ws/src
git clone https://github.com/sktometometo/eye_display.git
rosdep install --from-paths . --ignore-src -y -r
catkin build eye_display
source ~/catkin_ws/devel/setup.bash
VID_20250205_163259.mp4
You can check basic functionalities with a demo firmware.
cd simple_version
pio run -e stampc3
pio run -e stampc3 -t uploadfs --upload-port <port to device>
pio run -e stampc3 -t upload --upload-port <port to device>
Then simple_version will work
Please replace stampc3
with stamps3
if you use type 2 device.
If you want to control the device with rosserial or I2C, please use rosserial_version
firmware.
To build the rosserial_version
firmware, you can use build.py
script.
This script requires a config yaml file and eye layer images. This repo has a sample project, please see sample_project.
If you want to build the firmware with the sample project, you can use the following command.
roscd eye_display/sample_project
rosrun eye_display build.py ./sample.yaml --env stampc3 --port <port to device>
(Please replace stampc3
with stamps3
if you use type 2 device.)
After building and uploading the firmware, you can control the device with rosserial.
This repository has a sample node to control the device.
First, please launch a rosserial node.
roslaunch eye_display demo.launch port:=<port to device> mode_right:=<true or false>
Then you can control the device with the demo scripts.
rosrun eye_display demo_move_eye.py
rosrun eye_display pub_eye_status.py
You can also directly control pupil position by publish a message to "/serial_node/look_at" topic.
rostopic pub -1 /serial_node/look_at geometry_msgs/Point "{x: 1.0, y: 1.0, z: 0.0}"
You can control emotion expression with eye by publishing a message to "/eye_status" topic.
rostopic pub -1 /eye_status std_msgs/UInt16 "data: 0"
The following table shows the correspondence between the data and the emotional expression of the eyes. Please also see the message definition.
data | emotion |
---|---|
0 | normal |
1 | blink |
2 | surprised |
3 | sleepy |
4 | angry |
5 | sad / troubled |
6 | happy |
If you want to control the device through I2C bus, please use following env.
stampc3-i2c-right
: Stamp C3 device on right eyestampc3-i2c-left
: Stamp C3 device on left eyestamps3-i2c-right
: Stamp C3 device on right eyestamps3-i2c-left
: Stamp C3 device on left eye
roscd eye_display/sample_project
rosrun eye_display build.py ./sample.yaml --env <env name> --port <port to device>
Then you can control the device with I2C.