Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions relay_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
17 changes: 9 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Loading