Python SDK API Reference¶
Complete API reference for the ARVOS Python SDK.
ArvosServer¶
Main WebSocket server class.
Methods¶
start()¶
Start the WebSocket server.
stop()¶
Stop the server and close all connections.
print_qr_code()¶
Display QR code for easy connection.
get_websocket_url() -> str¶
Get the WebSocket connection URL.
broadcast(message: str)¶
Send message to all connected clients.
get_client_count() -> int¶
Get number of connected clients.
Callbacks¶
All callbacks can be async or sync functions:
# Async callback
async def on_imu(data: IMUData):
print(f"IMU: {data}")
# Sync callback
def on_imu(data: IMUData):
print(f"IMU: {data}")
Connection Callbacks¶
on_connect(client_id: str)- Client connectedon_disconnect(client_id: str)- Client disconnected
Sensor Callbacks¶
on_handshake(handshake: HandshakeMessage)- Device info receivedon_imu(data: IMUData)- IMU data receivedon_gps(data: GPSData)- GPS data receivedon_pose(data: PoseData)- Pose data receivedon_camera(frame: CameraFrame)- Camera frame receivedon_depth(frame: DepthFrame)- Depth frame receivedon_status(status: dict)- Status message receivedon_error(error: str, details: str)- Error message received
Apple Watch Callbacks¶
on_watch_imu(data: WatchIMUData)- Watch IMU dataon_watch_attitude(data: WatchAttitudeData)- Watch attitudeon_watch_activity(data: WatchMotionActivityData)- Watch activity
Protocol Servers¶
All protocol servers inherit from BaseArvosServer and share the same interface.
GRPCArvosServer¶
MQTTArvosServer¶
HTTPArvosServer¶
MCAPStreamServer¶
from arvos.servers import MCAPStreamServer
server = MCAPStreamServer(
host="0.0.0.0",
port=17500,
output_file="output.mcap"
)
QUICArvosServer¶
from arvos.servers import QUICArvosServer
server = QUICArvosServer(
host="0.0.0.0",
port=4433,
certfile="/path/to/cert.pem",
keyfile="/path/to/key.key"
)
ArvosClient¶
Client class for connecting to existing servers.
Methods¶
connect(uri: str, timeout: float = 10.0)¶
Connect to an ARVOS server.
disconnect()¶
Disconnect from server.
run()¶
Main receive loop - call after connect().
Callbacks¶
Same callback interface as ArvosServer.
BaseArvosServer¶
Abstract base class for all protocol servers.
Methods¶
start()¶
Start the server (abstract).
stop()¶
Stop the server (abstract).
get_connection_url() -> str¶
Get connection URL (abstract).
get_protocol_name() -> str¶
Get protocol name (abstract).
get_local_ip() -> str¶
Get local IP address.
get_statistics() -> dict¶
Get server statistics.
reset_statistics()¶
Reset statistics counters.
print_connection_info()¶
Print connection information.
Callbacks¶
All servers share the same callback interface (see ArvosServer above).
Next Steps¶
- Data Types - Sensor data structures
- Servers - Protocol server details
- Clients - Client class details