Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8979926
fix to run loop exactry at 150 msec
k-okada Jul 3, 2025
467fc13
add nh.getHardware()->setBaud(115200); for STAMPC3
k-okada Jul 28, 2025
52b3219
support I2C
k-okada Jul 28, 2025
4861f7d
add dual_demo.launch for two eyes setting
k-okada Jul 28, 2025
92bf003
add node_scripts/dual_serial_logger.py
k-okada Jul 28, 2025
0669886
move eye_asset parser to eye.hpp, ros/i2c just read paramand send to …
k-okada Jul 28, 2025
ad9d8fa
support upperlid_position_x, upperlid_position_y, rotation_theta
k-okada Jul 28, 2025
1fc91fb
support extra images
k-okada Jul 29, 2025
189387f
Due to the limited RAM on StampC3, sprites are decoded at a lower res…
k-okada Jul 30, 2025
7b9e399
fix i2c related scripts to support loading extra images
k-okada Jul 30, 2025
6cb668a
display map data only when '\n' is included. I2C send asset informati…
k-okada Jul 30, 2025
e201358
platformio.ini merge i2c-left and i2c-right
k-okada Jul 30, 2025
c936971
ros_lib.h: ArduinoJson.h removed. The loop now continues regardless o…
k-okada Jul 31, 2025
de4a444
- Removed the need for `_extra` in eye_asset/name. Introduced `asset_…
k-okada Aug 3, 2025
e3adb7f
added iris_default_{pos_x, pos_y, theta, zoom}, instead of look_x, lo…
k-okada Aug 4, 2025
6981029
- Added support for look_theta as the third argument of the look_at m…
k-okada Aug 4, 2025
63fe964
Added the support of control the eye status in more detail through th…
k-okada Aug 4, 2025
7292f8c
eye.hpp: show all staus only when 'eye_asset_done' received
k-okada Aug 25, 2025
333a498
demo_move_eye.py: add --advanced mode
k-okada Aug 25, 2025
bc04cb6
run `if (current_eye_asset.invert_rl) sprite_outline.setRotation(6)` …
k-okada Oct 15, 2025
bc9b854
add mode_right/mode_left to demo_dual.launch
k-okada Oct 15, 2025
5ea49d7
fix motion timing for dual eye mode, reset interval time (minus sleep…
k-okada Oct 17, 2025
bae7e00
Merge pull request #12 from k-okada/fix_timing
k-okada Oct 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions eye_display/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ include_directories()

catkin_install_python(PROGRAMS
node_scripts/build.py node_scripts/demo_move_eye.py node_scripts/pub_eye_status.py
node_scripts/ros_to_i2c.py node_scripts/asset_param_list.py
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/node_scripts)
85 changes: 76 additions & 9 deletions eye_display/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,85 @@ $rosparam get eye_display/eye_asset/names

If you want to control the device through I2C bus, please use following env.

- `stampc3-i2c-right`: Stamp C3 device on right eye
- `stampc3-i2c-left`: Stamp C3 device on left eye
- `stamps3-i2c-right`: Stamp C3 device on right eye
- `stamps3-i2c-left`: Stamp C3 device on left eye
- `stampc3-i2c`: Stamp C3 device
- `stamps3-i2c`: Stamp S3 device

```bash
roscd eye_display
pio run -e stampc3-i2c-right
pio run -e stampc3-i2c-right -t uploadfs --upload-port <port to device>
pio run -e stampc3-i2c-right -t upload --upload-port <port to device>
pio run -e stampc3-i2c
pio run -e stampc3-i2c -t uploadfs --upload-port <port to device>
pio run -e stampc3-i2c -t upload --upload-port <port to device>
```

Then you can control the device with I2C.

```bash
roslaunch eye_display demo.launch use_i2c:=true i2c_device:=<device number> i2c_bus:=<bus number>
```

See `node_scripts/ros_to_i2c.py` for control protocol.

To monitor the serial output in the dual I2C mode. Use the following logger tool.

```bash
./node_scripts/dual_serial_logger.py /dev/ttyACM0 /dev/ttyACM1 115200
```
#### Dual eye mode

You can start two device with `demo_dual.launch`

```bash
roslaunch eye_display demo_dual.launch use_i2c:=false port_right:=/dev/ttyACM0 port_left:=/dev/ttyACM1 baud:=115200 debug:=true
```

You can control dual eye status with demo scripts
```bash
rosrun eye_display pub_eye_status.py --dual --rate 0.3 --names sleepy surprised happy
```

#### extra images

If you need more than the standard images (outline, iris, pupil, reflex, upperlid), use the extra images.


```
path_extra1: "/krmt_reflex_shine1.png"
extra1_default_pos_x: 75
extra1_default_pos_y: 75
extra1_default_theta: 0
extra1_position_x: [ 0, 20, 40, 20, 0, -20, -40, -20]
extra1_position_y: [ 40, 20, 0, -20, -40, -20, 0, 20]
extra1_rotation_theta: [ 0, 40, 80, 40, 0, -40, -80, -40]
extra1_zoom: [ 1.0, 1.1, 1.2, 1.3, 1.4, 1.2, 1.0, 0.8, 0.7, 0.8, 0.9]
path_extra2: "/krmt_reflex_heart.png"
extra2_position_x: [ 0, 20, 0, -20]
extra2_position_y: [ 0, 10, 0, -10]
extra2_rotation_theta: [ 0, -40, -80, -40, 0, 40, 80, 40]
extra2_zoom: [1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 1.5, 1.0, 0.5]
extra2_default_pos_x: 75
extra2_default_pos_y: 75
extra2_default_theta: 0
```

#### Advanced control

You can control the eye status in more detail through the `eye_status` topics.
Use the following low-level commands.
`<emotion>` is defined in the names list in the configuration YAML file (e.g., `names: [normal, happy, blink]`).
`<type>` can be one of `iris`, `pupil`, `reflex`, `upperlid`, `extra1`, `extra2`.

```
eye_asset_image_path: <emotion>: <type>: <file name>
eye_asset_default_pos_x: <emotion>: <type>: <value>
eye_asset_default_pos_y: <emotion>: <type>: <value>
eye_asset_default_theta: <emotion>: <type>: <value in degree>
eye_asset_default_zoom: <emotion>: <type>: <value>
eye_asset_position_x: <emotion>: <type>: <comma separated values>
eye_asset_position_y: <emotion>: <type>: <comma separated values>
eye_asset_rotation_theta: <emotion>: <type>: <comma separated values>
eye_asset_zoom: <emotion>: <type>: <comma separated values>
```

### Description of direction

![eye_display_direction](./doc/eye_display_direction.svg)
Expand Down Expand Up @@ -140,6 +205,8 @@ rosrun eye_display update_ros_lib.sh
This feature requires git 2.27+, so if you use Ubuntu<=20.04, please install latest version of git https://git-scm.com/downloads/linux

```
$ git clone --filter=blob:none --sparse https://github.com/jsk-ros-pkg/jsk_3rdparty.git -b eye_display
$ git sparse-checkout set eye_display
git clone --filter=blob:none --sparse https://github.com/jsk-ros-pkg/jsk_3rdparty.git
cd jsk_3rdparty
git sparse-checkout set eye_display
git checkout eye_display
```
Loading
Loading