Skip to content

Commit fea894e

Browse files
committed
Update workspace README
1 parent ac76195 commit fea894e

File tree

1 file changed

+59
-5
lines changed

1 file changed

+59
-5
lines changed

coffee_ws/README.md

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,22 @@ source ../ros-source.sh
1212
colcon build
1313
ros-source
1414
# Note: coffee_head package was split into coffee_head_control and coffee_vision
15+
# Note: coffee_vision now features modular architecture with configurable parameters
1516
# Launch individual nodes as needed - see sections below
1617
```
1718

18-
- Camera node handles opening the camera, tracking faces (`src/coffee_vision/coffee_vision/camera_node.py`).
19+
## Recent Architecture Improvements
20+
21+
**Coffee Vision Package Refactoring:**
22+
- **Modular Design**: Face detection and coordinate transformation separated into independent modules
23+
- **Configurable Parameters**: Runtime tuning via ROS2 parameters without code changes
24+
- **Headless Operation**: Removed GUI dependencies for better deployment flexibility
25+
- **Improved Testability**: Components can be tested and reused independently
26+
27+
- Camera node handles opening the camera, tracking faces with modular face detection and coordinate transformation (`src/coffee_vision/coffee_vision/camera_node.py`).
28+
- **Modular Architecture**: Separated face detection (`face_detection.py`) and coordinate utilities (`coordinate_utils.py`)
29+
- **Configurable Parameters**: ROS2 parameters for face detection sensitivity, eye movement, and coordinate transformation
30+
- **Headless Operation**: No GUI dependencies, controlled via ROS topics
1931
- 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_control/coffee_head_control/head_tracking.py`).
2032
- Subscribes to the camera node.
2133
- Coffee Expression show the latest version of the eye shapes with a new topic message (`src/coffee_expressions/coffee_expressions/plaipin_expressive_eyes.py`)
@@ -32,7 +44,7 @@ ros-source
3244

3345
- `/voice/intent` - Voice intent
3446

35-
- `/vision/face_position` - Face position -- the position of the face in the frame of the camera viewer. NOTE that we can dynamically update the field of view (FOV) of the camera viewer. The smaller the FOV, the faster the head tracking will be.
47+
- `/vision/face_position` - Face position -- the position of the face transformed to robot eye coordinates. Uses configurable sensitivity and range parameters for eye movement control. NOTE that we can dynamically update the field of view (FOV) of the camera viewer. The smaller the FOV, the faster the head tracking will be.
3648

3749
- `/system/event` - System event
3850

@@ -207,9 +219,43 @@ source ./scripts/setup_env.sh
207219

208220
## Launching Camera
209221
```
210-
# Run for Launching Camera
211-
222+
# Run camera node with default settings
212223
ros2 run coffee_vision camera_node
224+
225+
# Run with custom face detection sensitivity
226+
ros2 run coffee_vision camera_node --ros-args \
227+
-p face_confidence_threshold:=0.7 \
228+
-p face_smoothing_factor:=0.6
229+
230+
# Run with custom eye movement parameters
231+
ros2 run coffee_vision camera_node --ros-args \
232+
-p eye_range:=1.5 \
233+
-p eye_sensitivity:=2.0 \
234+
-p invert_x:=true
235+
```
236+
237+
### Camera Node Configuration
238+
239+
The camera node supports comprehensive configuration via ROS2 parameters:
240+
241+
| Parameter | Type | Default | Description |
242+
|-----------|------|---------|-------------|
243+
| `face_confidence_threshold` | float | 0.5 | Minimum confidence for face detection |
244+
| `face_smoothing_factor` | float | 0.4 | Temporal smoothing (higher = smoother) |
245+
| `eye_range` | float | 1.0 | Maximum eye movement range |
246+
| `eye_sensitivity` | float | 1.5 | Eye movement sensitivity multiplier |
247+
| `invert_x` | bool | false | Invert X axis for eye movement |
248+
| `invert_y` | bool | false | Invert Y axis for eye movement |
249+
250+
**External Control Topics:**
251+
```bash
252+
# Camera selection and quality control
253+
ros2 topic pub /coffee_bot/camera/cmd/select std_msgs/Int32 "data: 1"
254+
ros2 topic pub /coffee_bot/camera/cmd/quality std_msgs/Bool "data: true"
255+
ros2 topic pub /coffee_bot/camera/cmd/face_detection std_msgs/Bool "data: false"
256+
257+
# Request diagnostics
258+
ros2 topic pub /coffee_bot/camera/cmd/diagnostics std_msgs/String "data: 'get'"
213259
```
214260

215261
## Launching Eye Interface
@@ -391,8 +437,12 @@ ros2 service call /coffee/llm/chat coffee_llm_msgs/srv/ChatService "{prompt: 'He
391437
## Window 1
392438

393439
```
440+
# Camera node with configurable parameters
394441
ros2 run coffee_vision camera_node
395442
443+
# Or with custom face detection and eye movement settings:
444+
# ros2 run coffee_vision camera_node --ros-args -p face_confidence_threshold:=0.7 -p eye_sensitivity:=2.0
445+
396446
ros2 run coffee_expressions plaipin_expressive_eyes
397447
398448
ros2 run dynamixel_sdk_examples read_write_node
@@ -424,9 +474,13 @@ ros2 launch coffee_speech_processing voice_intent.launch.py use_vad:=true vad_si
424474
ros2 run coffee_face coffee_eyes
425475
ros2 run coffee_expressions_test_ui expressions_test_ui
426476
427-
428477
ros2 run coffee_expressions_state_ui state_ui
429478
479+
# View and modify camera node parameters
480+
ros2 param list /camera_node
481+
ros2 param get /camera_node face_confidence_threshold
482+
ros2 param set /camera_node eye_sensitivity 2.5
483+
430484
#Run with VAD --
431485
ros2 launch coffee_speech_processing voice_intent.launch.py use_vad:=true vad_silence_duration:=1500
432486

0 commit comments

Comments
 (0)