From a1dd39ee9aad18c7be2f7bffe858b8d060431add Mon Sep 17 00:00:00 2001 From: o_nu Date: Mon, 9 Nov 2026 14:47:17 +0100 Subject: [PATCH 1/2] Add external-controller relay channels Adds two channels to the relay so an external experiment pipeline can join the existing robot <-> neuronavigation conversation: - a new from_external_controller event; messages arriving on it are forwarded to to_robot and to_neuronavigation - robot and neuronavigation traffic is additionally copied to to_external_controller 19 lines, additive only -- the existing from_robot / from_neuronavigation behavior and payloads are unchanged, so current clients keep working unmodified. --- relay_server.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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")) From 2a0a89ab0bbad8f32269ddd4d854f9ba7d83aaf5 Mon Sep 17 00:00:00 2001 From: o_nu Date: Mon, 16 Nov 2026 15:43:51 +0100 Subject: [PATCH 2/2] Allow robot-control dependencies in the shared NeuroPilot environment Replace exact pins with compatible ranges so the robot controller can share the NeuroPilot environment. Keep the numpy 1.26 line and the robot's socketio, scipy, matplotlib, and requests APIs within their existing major versions. --- requirements.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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