Skip to content

Commit 9b06ff3

Browse files
committed
Update configs on plaipin expressive eyes
1 parent 098efb6 commit 9b06ff3

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

coffee_ws/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ ros2 launch coffee_head all_nodes.launch.py
1010
- Camera node handles opening the camera, tracking faces (`src/coffee_head/coffee_head/camera_node.py`).
1111
- Head tracking handles the PID controller, and is in coordination with the camera node to move the motors to center the detected face in frame (`src/coffee_head/coffee_head/head_tracking.py`).
1212
- Subscribes to the camera node.
13-
- Coffee Eyes shows the eye visuals for the Coffee Buddy robot, (`src/coffee_face/coffee_face/coffee_eyes.py`).
13+
- Coffee Expression show the latest version of the eye shapes with a new topic message (`src/coffee_expressions/coffee_expressions/plaipin_expressive_eyes.py`)
14+
- Coffee Eyes shows the eye visuals for the Coffee Buddy robot, (`src/coffee_face/coffee_face/coffee_eyes.py`).
1415
- Subscribes to the camera node to adjust eye position in window.
1516

1617
Commands to launch separate nodes:
@@ -22,8 +23,11 @@ ros-source
2223
ros2 run coffee_head camera_node
2324
ros2 run coffee_head head_tracking
2425
ros2 run coffee_head eye_tracking
26+
ros2 run coffee_expressions plaipin_expressive_eyes
2527
ros2 run coffee_face coffee_eyes
2628
```
2729

30+
**NOTE:** We define the location of `expressions.json` in the `setup.py` file inside `coffee_expressions` directory.
31+
2832
Running the animator
2933
- Animations are saved in `~/.ros/motion_files` as `.json` files.

coffee_ws/src/coffee_expressions/coffee_expressions/plaipin_expressive_eyes.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,25 @@ def __init__(self):
2727

2828
# Initialize Pygame and Plaipin components
2929
pygame.init()
30-
self.screen_width = 800
31-
self.screen_height = 400
32-
self.screen = pygame.display.set_mode((self.screen_width, self.screen_height))
30+
self.screen_width = 1080
31+
self.screen_height = 600
32+
# self.screen = pygame.display.set_mode((self.screen_width, self.screen_height))
3333
pygame.display.set_caption("Coffee Buddy - Plaipin Eyes")
3434

3535
# Create custom eye configuration
3636
config = EyeConfig(
37-
width=60, # Scaled down for 800x400 display
38-
height=240, # Scaled down for 800x400 display
39-
spacing=70, # Scaled down for 800x400 display
37+
width=120, # Scaled down for 800x400 display
38+
height=480, # Scaled down for 800x400 display
39+
spacing=140, # Scaled down for 800x400 display
4040
blink_interval=120,
4141
blink_speed=0.1,
4242
blink_close_frames=5,
4343
outline_color=(255, 255, 255),
4444
fill_color=(255, 255, 255),
4545
outline_width=2,
4646
background_color=(0, 0, 0),
47-
base_screen_width=800, # Match our display
48-
base_screen_height=400 # Match our display
47+
base_screen_width=self.screen_width, # Match our display
48+
base_screen_height=self.screen_height # Match our display
4949
)
5050

5151
# Get package share directory path
@@ -100,7 +100,8 @@ def affective_state_callback(self, msg: AffectiveState):
100100
)
101101
else:
102102
# Return to center when idle
103-
self.eye_controller.set_eye_positions((0.0, 0.0))
103+
# self.eye_controller.set_eye_positions((0.0, 0.0))
104+
self.eye_controller.set_eye_positions((msg.gaze_target.x, msg.gaze_target.y))
104105

105106
def run(self):
106107
"""Main animation loop"""

0 commit comments

Comments
 (0)