Python SDK

One context manager, every mission you'll ever trace

The Python SDK exposes three primitives — mission, phase, decision — and a typed telemetry catalog. Adapters do the protocol-specific work; the SDK does the platform contract.

The mission/phase pattern

Every workflow is a mission. Inside a mission are phases (stages of work), decisions (what the robot or planner chose), and scores (how well it went). Telemetry flows under whatever phase is currently active.

Python
from robotrace import RoboTrace, Pose3D

rt = RoboTrace(host=..., public_key=..., secret_key=...,
               device_id="agv-001", device_type="amr")

with rt.mission("pickup-task-T1", tags=["shift-A"]) as mission:
    # 1. Decisions — what did the robot choose?
    mission.decision(name="path_planned", model="rrt_v2",
                     input={"goal": [5, 3]},
                     output={"path_m": 8.4},
                     confidence=0.94)

    # 2. Phases — break the mission into stages
    with mission.phase("approach") as phase:
        phase.log("robot/pose", Pose3D(x=2, y=1, z=0,
                                        qx=0, qy=0, qz=0, qw=1))
        # ... more telemetry ...

    with mission.phase("grasp") as phase:
        # ... gripper telemetry ...
        pass

    # 3. Scores — how well did it go?
    mission.score("cycle_time_seconds", 24.7)
    mission.score("success", True)

Typed telemetry catalog

The SDK ships typed classes for the most common robot telemetry. Each maps to one schema in the platform's catalog, and the dashboard renders the appropriate widget automatically (time series for Scalar, 3D track for Pose3D, voltage chart for Battery).

Python
from robotrace import (
    Pose3D,       # position + quaternion orientation
    Twist,        # linear + angular velocity
    Battery,      # voltage + state-of-charge
    Imu,          # 3-axis accel + gyro
    Scalar,       # single numeric value
    MultiLine,    # multi-line text (logs, configs)
    Image,        # PNG/JPEG bytes
    Video,        # video segment metadata
    Snapshot,     # arbitrary JSON snapshot
)

# Every type maps to one schema in the platform's catalog;
# dashboard auto-renders the right widget.

Adapters auto-tag missions

Wrap any reference adapter in RoboTraceMiddleware and every mission opened inside the wrapper carries an adapter:<name> tag. The dashboard filter chip and per-row badges make heterogeneous fleets readable at a glance.

Python
from robotrace import RoboTrace
from robotrace.integrations.rosp import RoboTraceMiddleware
from robotrace.integrations.rosp.adapter import RospAdapter

rt = RoboTrace(host=..., device_id="amr-007")

async with RoboTraceMiddleware(rt, RospAdapter(...)) as adapter:
    # The middleware pushes adapter_name="rosp" onto rt's adapter stack
    # on __aenter__, pops on __aexit__. Stacks compose for nested wrappers.

    # Inside this block, every mission you open is auto-tagged with
    # adapter:rosp — visible in the dashboard's adapter filter chip.
    with rt.mission("...") as m:
        # tags will include "adapter:rosp" automatically
        ...

The nine reference adapters

All ship with the SDK. Adapters declare adapter_name; missions auto-tag. Use them directly or pattern-match for your own protocol — full reference is in the dashboard docs.

AdapterTagCoverage
ROS 2 / ROSPadapter:rospPose, Twist, BatteryState, IMU, Image, MCAP recording
VDA 5050adapter:vda5050Order/state messages from AGV master controllers
MQTTadapter:mqttTopic-routed telemetry from any MQTT broker
Open-RMFadapter:rmfRobot fleet management open standard
OPC-UAadapter:opcuaIndustrial automation — manipulators, conveyors, PLCs
MoveIt 2adapter:moveitManipulator trajectories + joint telemetry
Isaac Simadapter:isaacNVIDIA Omniverse / Isaac Sim simulation feeds
CARLAadapter:carlaAutonomous driving — ego pose, IMU, collision, lane invasion
MAVLink(converters)PX4/ArduPilot — converted to ROSP via the SDK's MAVLink converter helpers

Multi-robot: RoboTraceFleet

For coordinated swarms — N devices behind one client. Mission lifecycle is per-device, but you can broadcast a single telemetry value (e.g. facility temperature, time-of-day signal) to every device with one call.

Python
from robotrace import RoboTraceFleet

# One client managing N devices. Used for multi-robot warehouses,
# delivery swarms, or coordinated drone teams.
fleet = RoboTraceFleet(host=..., device_ids=["agv-001", "agv-002", "agv-003"])

# Open a mission for a specific device — fleet routes it to that
# device's client transparently.
with fleet.mission("agv-001", "task-T1", tags=["fleet"]) as m:
    m.score("success", True)

# Broadcast telemetry to ALL devices — useful for facility-wide signals.
fleet.broadcast_log("environment/temperature", Scalar(value=22.5))

Ready to wire it up?

The full reference — every class, every method, every schema — lives in the dashboard's in-product docs. Sign in to read it side-by-side with your missions.