Preview. The servo.connect API is currently in developer preview and not yet shipped in general availability. Early feedback and testing are welcome.
Prerequisites
Before starting, make sure you have:- Python 3.10+ installed
- Network access to your Servo control-plane URL
- A Servo account or API key
Step 1: Install and authenticate
Install the Servo client package:servo key create --label robot-cell-01, then export it on the robot:
Step 2: Test on your laptop (no hardware needed)
You do not need physical hardware on hand to start developing. Usemock=True to exercise
Servo’s local bindings and bounded control loop on your development computer. Mock sessions do
not contact a hosted model or require credentials:
RunReport. Exact elapsed time and measured frequency vary slightly by host. Use a non-mock
session to validate credentials, network transport, and a hosted model.
Step 3: Connect your real robot (rig.py)
When you are ready to connect physical hardware, create rig.py to bind your real cameras and motor methods using observe and act:
servo daemon) on first use if it isn’t already running. For production robot cells, run servo daemon --install-service once to install it as a supervised system service.
Understanding observe and act
Step 4: Zero-motion preflight (servo check-rig)
Before powering on physical motors, run zero-motion preflight verification against your script:
servo check-rig imports rig.py and validates all camera connections, network latency, and motor bindings up to the point of motion without commanding any motor movement:
servo check-rig rig.py --mock.
Step 5: Camera selection
Automatic camera discovery is not exposed by the customer CLI yet. For a generic V4L2 camera, usecamera(0) with a verified device index. Supported Intel RealSense installations can use a
known vendor serial with camera(serial="...").
Do not infer camera roles from USB enumeration order. Verify each stream and bind its role
explicitly; stable serials prevent streams from swapping when device indices change after a reboot.
Step 6: Live monitoring and interventions
While an episode runs, you can monitor and control execution interactively:- Remote Web Cockpit: Open the URL displayed by
servo check-rigto view real-time camera streams and latency charts in your browser. - Teleoperation Interventions: Take manual control using a gamepad or keyboard from the cockpit at any time. Servo smoothly blends velocity trajectories to eliminate motion jolts.
- Programmatic Pause & Resume:
Direct control loops (servo.Policy)
If you prefer managing your own while loop (for custom safety filters, step-by-step logging, or custom simulation wrappers), use servo.Policy:
policy(...) returns the first row of the chunk the model returned, directly usable by env.step(action). It does not buffer or prefetch — every call is one real network round trip — so call it no faster than your model’s round-trip allows, or add your own buffering for a tighter loop.
Next steps
- Read the in-depth Robot Integration Guide to learn about ROS 2 topics, custom sensor contracts, and fault handling.
- Scale up to multi-robot deployments in Robot Fleets.
- Review all methods and configuration options in the Python API Reference.