Alina commited on
Commit
4db07d5
·
unverified ·
1 Parent(s): f181676

152 simplify wireless tags (#171)

Browse files
README.md CHANGED
@@ -132,7 +132,6 @@ By default, the app runs in console mode for direct audio interaction. Use the `
132
  | `--local-vision` | `False` | Use local vision model (SmolVLM2) for periodic image processing instead of gpt-realtime vision. Requires `local_vision` extra to be installed. |
133
  | `--gradio` | `False` | Launch the Gradio web UI. Without this flag, runs in console mode. Required when running in simulation mode. |
134
  | `--debug` | `False` | Enable verbose logging for troubleshooting. |
135
- | `--wireless-version` | `False` | Use GStreamer backend for wireless version of the robot. Requires `reachy_mini_wireless` extra to be installed.
136
 
137
 
138
  ### Examples
@@ -148,16 +147,16 @@ By default, the app runs in console mode for direct audio interaction. Use the `
148
  reachy-mini-conversation-app --local-vision
149
  ```
150
 
151
- - Run with wireless support (requires `reachy_mini_wireless` extra and daemon started with `--wireless-version`):
152
 
153
  ```bash
154
- reachy-mini-conversation-app --wireless-version
155
  ```
156
 
157
- - Disable the camera pipeline (audio-only conversation):
158
 
159
  ```bash
160
- reachy-mini-conversation-app --no-camera
161
  ```
162
 
163
  ### Troubleshooting
@@ -222,8 +221,6 @@ When running with `--gradio`, open the “Personality” accordion:
222
  Note: The “Personality” panel updates the conversation instructions. Tool sets are loaded at startup from `tools.txt` and are not hot‑reloaded.
223
 
224
 
225
-
226
-
227
  ## Development workflow
228
  - Install the dev group extras: `uv sync --group dev` or `pip install -e .[dev]`.
229
  - Run formatting and linting: `ruff check .`.
 
132
  | `--local-vision` | `False` | Use local vision model (SmolVLM2) for periodic image processing instead of gpt-realtime vision. Requires `local_vision` extra to be installed. |
133
  | `--gradio` | `False` | Launch the Gradio web UI. Without this flag, runs in console mode. Required when running in simulation mode. |
134
  | `--debug` | `False` | Enable verbose logging for troubleshooting. |
 
135
 
136
 
137
  ### Examples
 
147
  reachy-mini-conversation-app --local-vision
148
  ```
149
 
150
+ - Disable the camera pipeline (audio-only conversation):
151
 
152
  ```bash
153
+ reachy-mini-conversation-app --no-camera
154
  ```
155
 
156
+ - Run with Gradio web interface:
157
 
158
  ```bash
159
+ reachy-mini-conversation-app --gradio
160
  ```
161
 
162
  ### Troubleshooting
 
221
  Note: The “Personality” panel updates the conversation instructions. Tool sets are loaded at startup from `tools.txt` and are not hot‑reloaded.
222
 
223
 
 
 
224
  ## Development workflow
225
  - Install the dev group extras: `uv sync --group dev` or `pip install -e .[dev]`.
226
  - Run formatting and linting: `ruff check .`.
src/reachy_mini_conversation_app/main.py CHANGED
@@ -18,6 +18,7 @@ from reachy_mini_conversation_app.utils import (
18
  parse_args,
19
  setup_logger,
20
  handle_vision_stuff,
 
21
  )
22
 
23
 
@@ -52,31 +53,47 @@ def run(
52
  logger.info("Starting Reachy Mini Conversation App")
53
 
54
  if args.no_camera and args.head_tracker is not None:
55
- logger.warning("Head tracking is not activated due to --no-camera.")
 
 
 
56
 
57
  if robot is None:
58
- # Initialize robot with appropriate backend
59
- # TODO: Implement dynamic robot connection detection
60
- # Automatically detect and connect to available Reachy Mini robot(s!)
61
- # Priority checks (in order):
62
- # 1. Reachy Lite connected directly to the host
63
- # 2. Reachy Mini daemon running on localhost (same device)
64
- # 3. Reachy Mini daemon on local network (same subnet)
65
-
66
- if args.wireless_version and not args.on_device:
67
- logger.info("Using WebRTC backend for fully remote wireless version")
68
- robot = ReachyMini(media_backend="webrtc", localhost_only=False)
69
- elif args.wireless_version and args.on_device:
70
- logger.info("Using GStreamer backend for on-device wireless version")
71
- robot = ReachyMini(media_backend="gstreamer")
72
- else:
73
- logger.info("Using default backend for lite version")
74
- robot = ReachyMini(media_backend="default")
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
  # Check if running in simulation mode without --gradio
77
  if robot.client.get_status()["simulation_enabled"] and not args.gradio:
78
  logger.error(
79
- "Simulation mode requires Gradio interface. Please use --gradio flag when running in simulation mode.",
80
  )
81
  robot.client.disconnect()
82
  sys.exit(1)
 
18
  parse_args,
19
  setup_logger,
20
  handle_vision_stuff,
21
+ log_connection_troubleshooting,
22
  )
23
 
24
 
 
53
  logger.info("Starting Reachy Mini Conversation App")
54
 
55
  if args.no_camera and args.head_tracker is not None:
56
+ logger.warning(
57
+ "Head tracking disabled: --no-camera flag is set. "
58
+ "Remove --no-camera to enable head tracking."
59
+ )
60
 
61
  if robot is None:
62
+ try:
63
+ robot_kwargs = {}
64
+ if args.robot_name is not None:
65
+ robot_kwargs["robot_name"] = args.robot_name
66
+
67
+ logger.info("Initializing ReachyMini (SDK will auto-detect appropriate backend)")
68
+ robot = ReachyMini(**robot_kwargs)
69
+
70
+ except TimeoutError as e:
71
+ logger.error(
72
+ "Connection timeout: Failed to connect to Reachy Mini daemon. "
73
+ f"Details: {e}"
74
+ )
75
+ log_connection_troubleshooting(logger, args.robot_name)
76
+ sys.exit(1)
77
+
78
+ except ConnectionError as e:
79
+ logger.error(
80
+ "Connection failed: Unable to establish connection to Reachy Mini. "
81
+ f"Details: {e}"
82
+ )
83
+ log_connection_troubleshooting(logger, args.robot_name)
84
+ sys.exit(1)
85
+
86
+ except Exception as e:
87
+ logger.error(
88
+ f"Unexpected error during robot initialization: {type(e).__name__}: {e}"
89
+ )
90
+ logger.error("Please check your configuration and try again.")
91
+ sys.exit(1)
92
 
93
  # Check if running in simulation mode without --gradio
94
  if robot.client.get_status()["simulation_enabled"] and not args.gradio:
95
  logger.error(
96
+ "Simulation mode requires Gradio interface. Please use --gradio flag when running in simulation mode."
97
  )
98
  robot.client.disconnect()
99
  sys.exit(1)
src/reachy_mini_conversation_app/utils.py CHANGED
@@ -1,7 +1,7 @@
1
  import logging
2
  import argparse
3
  import warnings
4
- from typing import Any, Tuple
5
 
6
  from reachy_mini import ReachyMini
7
  from reachy_mini_conversation_app.camera_worker import CameraWorker
@@ -26,16 +26,10 @@ def parse_args() -> Tuple[argparse.Namespace, list]: # type: ignore
26
  parser.add_argument("--gradio", default=False, action="store_true", help="Open gradio interface")
27
  parser.add_argument("--debug", default=False, action="store_true", help="Enable debug logging")
28
  parser.add_argument(
29
- "--wireless-version",
30
- default=False,
31
- action="store_true",
32
- help="Use WebRTC backend for wireless version of the robot",
33
- )
34
- parser.add_argument(
35
- "--on-device",
36
- default=False,
37
- action="store_true",
38
- help="Use when conversation app is running on the same device as Reachy Mini daemon",
39
  )
40
  return parser.parse_known_args()
41
 
@@ -108,3 +102,22 @@ def setup_logger(debug: bool) -> logging.Logger:
108
  logging.getLogger("fastrtc").setLevel(logging.ERROR)
109
  logging.getLogger("aioice").setLevel(logging.WARNING)
110
  return logger
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import logging
2
  import argparse
3
  import warnings
4
+ from typing import Any, Tuple, Optional
5
 
6
  from reachy_mini import ReachyMini
7
  from reachy_mini_conversation_app.camera_worker import CameraWorker
 
26
  parser.add_argument("--gradio", default=False, action="store_true", help="Open gradio interface")
27
  parser.add_argument("--debug", default=False, action="store_true", help="Enable debug logging")
28
  parser.add_argument(
29
+ "--robot-name",
30
+ type=str,
31
+ default=None,
32
+ help="[Optional] Robot name/prefix for Zenoh topics (must match daemon's --robot-name). Only needed for development with multiple robots.",
 
 
 
 
 
 
33
  )
34
  return parser.parse_known_args()
35
 
 
102
  logging.getLogger("fastrtc").setLevel(logging.ERROR)
103
  logging.getLogger("aioice").setLevel(logging.WARNING)
104
  return logger
105
+
106
+ def log_connection_troubleshooting(logger: logging.Logger, robot_name: Optional[str]) -> None:
107
+ """Log troubleshooting steps for connection issues."""
108
+ logger.error("Troubleshooting steps:")
109
+ logger.error(" 1. Verify reachy-mini-daemon is running")
110
+
111
+ if robot_name is not None:
112
+ logger.error(
113
+ f" 2. Daemon must be started with: --robot-name '{robot_name}'"
114
+ )
115
+ else:
116
+ logger.error(
117
+ " 2. If daemon uses --robot-name, add the same flag here: "
118
+ "--robot-name <name>"
119
+ )
120
+
121
+ logger.error(" 3. For wireless: check network connectivity")
122
+ logger.error(" 4. Review daemon logs")
123
+ logger.error(" 5. Restart the daemon")