Python Client¶
Any WebSocket library works with the Gateway API. The SDK ships a ready-made test client you can use to verify a connection without the mobile app.
For IT, technicians and integration partners
Technical reference for IT departments, URG technicians and trained partners. It is not written as operating instructions for end users.
Install¶
pip install websockets
test_client.py¶
The Gateway repository includes gateway/test_client.py. It connects, sends a harmless
mock move, and prints three status frames:
python3 test_client.py <ROBOT-IP> # address of the Perception Board
Expected output:
Verbinde mit ws://<ROBOT-IP>:8765/ws ...
Verbunden. Sende Test-Move (vx=0.1) ...
Status: {'type': 'status', 'battery': 95, 'mode': 'damp', 'warning': None}
...
OK - Gateway antwortet.
Writing your own client¶
import asyncio, json, websockets
class UmeClient:
def __init__(self, host="<ROBOT-IP>", port=8765):
self.uri = f"ws://{host}:{port}/ws"
async def run(self):
async with websockets.connect(self.uri) as ws:
await ws.send(json.dumps({"type": "mode", "mode": "prep"}))
await ws.send(json.dumps({"type": "mode", "mode": "walk"}))
await ws.send(json.dumps({"type": "move", "vx": 0.3, "vy": 0, "wz": 0}))
async for raw in ws:
print(json.loads(raw))
asyncio.run(UmeClient().run())
Test safely
Run the Gateway with --mock while developing. In mock mode every command is validated and
logged, status is streamed, but no motion is executed — see
Gateway Deployment.