diff --git a/relay_server.py b/relay_server.py index 8146661..4579af9 100644 --- a/relay_server.py +++ b/relay_server.py @@ -41,15 +41,27 @@ @sio.event def from_neuronavigation(sid, msg): asyncio.create_task(sio.emit("to_robot", msg)) + # Also send to the experiment pipeline. + asyncio.create_task(sio.emit("to_external_controller", msg)) # print("Forwarding neuronavigation -> robot: %s" % str(msg)) @sio.event def from_robot(sid, msg): asyncio.create_task(sio.emit("to_neuronavigation", msg)) + # Also send to the experiment pipeline. + asyncio.create_task(sio.emit("to_external_controller", msg)) # print("Forwarding robot -> neuronavigation: %s" % str(msg)) +@sio.event +def from_external_controller(sid, msg): + # The experiment pipeline (cobot-pipeline-controller) speaks on this + # channel; forward its messages to the robot and the neuronavigation + # system, like the other channels do. + asyncio.create_task(sio.emit("to_robot", msg)) + asyncio.create_task(sio.emit("to_neuronavigation", msg)) + @sio.event def restart_robot_main_loop(sid): asyncio.create_task(sio.emit("restart_robot_main_loop")) diff --git a/requirements.txt b/requirements.txt index 324ac06..b197099 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,13 @@ -python-socketio==5.11.3 -uvicorn==0.30.1 -nest-asyncio==1.6.0 -requests==2.32.3 +python-socketio>=5.11.3,<6 +uvicorn>=0.30,<1 +nest-asyncio>=1.6,<2 +requests>=2.33,<3 websocket-client websockets -numpy==1.26.4 -opencv-python==4.10.0.84 +numpy>=1.26,<2 +opencv-python>=4.10,<5 pynput -matplotlib==3.9.0 -scipy==1.14.0 +matplotlib>=3.9,<4 +scipy>=1.14,<2 python-dotenv +pymodbus>=3.6,<4