apirrone
commited on
Commit
·
82a3883
1
Parent(s):
50939e7
mypy and enabling back force gradio in sim
Browse files
src/reachy_mini_conversation_app/headless_personality_ui.py
CHANGED
|
@@ -9,7 +9,7 @@ callable to avoid cross-thread issues.
|
|
| 9 |
from __future__ import annotations
|
| 10 |
import asyncio
|
| 11 |
import logging
|
| 12 |
-
from typing import Callable, Optional
|
| 13 |
|
| 14 |
from fastapi import FastAPI
|
| 15 |
|
|
@@ -52,7 +52,7 @@ def mount_personality_routes(
|
|
| 52 |
name: str
|
| 53 |
persist: Optional[bool] = False
|
| 54 |
|
| 55 |
-
def _startup_choice() ->
|
| 56 |
"""Return the persisted startup personality or default."""
|
| 57 |
try:
|
| 58 |
if get_persisted_personality is not None:
|
|
|
|
| 9 |
from __future__ import annotations
|
| 10 |
import asyncio
|
| 11 |
import logging
|
| 12 |
+
from typing import Any, Callable, Optional
|
| 13 |
|
| 14 |
from fastapi import FastAPI
|
| 15 |
|
|
|
|
| 52 |
name: str
|
| 53 |
persist: Optional[bool] = False
|
| 54 |
|
| 55 |
+
def _startup_choice() -> Any:
|
| 56 |
"""Return the persisted startup personality or default."""
|
| 57 |
try:
|
| 58 |
if get_persisted_personality is not None:
|
src/reachy_mini_conversation_app/main.py
CHANGED
|
@@ -74,12 +74,12 @@ def run(
|
|
| 74 |
robot = ReachyMini(media_backend="default")
|
| 75 |
|
| 76 |
# Check if running in simulation mode without --gradio
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
|
| 84 |
camera_worker, _, vision_manager = handle_vision_stuff(args, robot)
|
| 85 |
|
|
|
|
| 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)
|
| 83 |
|
| 84 |
camera_worker, _, vision_manager = handle_vision_stuff(args, robot)
|
| 85 |
|