RemiFabre
Initial commit
61f606d
Raw History Blame Contribute Delete
1.04 kB
"""Chess Emotions App - Play chess vs Stockfish while Reachy reacts!
Reachy roots for Stockfish, so expect celebrations when you blunder
and worried looks when you play well.
All chess logic runs in the browser (chess.js + stockfish.js WASM).
Emotions are triggered via direct REST calls to the Reachy daemon.
"""
import threading
from reachy_mini import ReachyMini, ReachyMiniApp
import time
class ChessEmotionsApp(ReachyMiniApp):
# Web UI served at this port
custom_app_url: str | None = "http://0.0.0.0:8042"
# No special media backend needed
request_media_backend: str | None = None
def run(self, reachy_mini: ReachyMini, stop_event: threading.Event):
# The app is entirely web-based - just keep the daemon alive
# Emotions are triggered by the browser via REST API calls to port 8000
while not stop_event.is_set():
time.sleep(0.1)
if __name__ == "__main__":
app = ChessEmotionsApp()
try:
app.wrapped_run()
except KeyboardInterrupt:
app.stop()