Overview
menlo-sdk: walking, joint control, robot state, camera and audio for Asimov 1 from Python.
menlo-sdk is the Python SDK for Menlo robots, and supports Asimov 1. It drives the robot
with the robot's own verbs, stand, set_velocity, damp and trajectory, plus two the
SDK adds: balance and set_joints. The
package is menlo; the robot is the menlo.asimov subpackage. It is on
PyPI and its source is on
GitHub.
Everything the SDK sends passes through the same arbiter and safety layer on the robot as the Cockpit and the gamepad; nothing in it bypasses the robot.
Before the robot walks
For a first run, hang the robot from its gantry hook with both feet on the floor and give it 2 m of clear floor ahead. Nothing in the SDK is an emergency stop: keep the E-Stop in Asimov Manager open, or be ready to cut power at the battery unit. Read Safety first.
try:
# Checks the robot first: it must be in MOVE. Held and re-sent at 10 Hz for
# DURATION_S, then zero velocity; returns after that.
sent = robot.set_velocity(vx=VX, vy=VY, vyaw=VYAW, duration=DURATION_S)
except NotReadyError as exc: # nothing was sent, or (RobotFaultedError) a fault ended it
print(exc)
sys.exit(1)
if sent.clamped:
print("the SDK reduced the speed to the robot's limits:", sent.command)
print(f"robot mode {robot.get_state().mode.name}, balancing in place")That is the walk from the Quickstart. This guide has the
detail behind every line of it; Drive from Python
gets you from pip install to the first walk, step by step, and the
Python SDK page is the overview.
What It Does
| You want to | The SDK gives you |
|---|---|
| Walk, strafe, turn | set_velocity(vx, vy, vyaw) in MOVE, held for a duration or until balance() |
| Change robot mode | stand(), balance(), damp() |
| Move joints | set_joints(pose) and trajectory(setpoint) with the walking policy off |
| Read the robot | robot.get_state(): mode, joints, IMU, battery, alerts; waits that read it |
| Check before moving | every moving verb checks the robot first and raises NotReadyError with stable problem codes; preflight() is the same check without a command |
| See and hear | camera frames, microphone chunks, a speaker to play into |
| Keep a record | every state sample and every command as JSON lines |
Connection Modes
| Mode | Control and state | Camera and audio | Works from |
|---|---|---|---|
udp | UDP on the robot's network | none | the robot's network |
hybrid | UDP on the robot's network | a LiveKit room | the robot's network |
livekit | a LiveKit room | a LiveKit room | wherever Asimov Manager is reachable |
The Robot object is the same in all three. A saved robot remembers its mode; see
Connection Modes.
Before You Start
The SDK drives a robot that is already assembled, powered and set up. These pages cover the parts it depends on:
- Asimov Manager: SDK credentials and the robot's settings
- Stand Up and Walk: what the robot does in each robot mode
- Standing and Balancing: the stand, balance, walk, damp sequence and why
- Stopping the Robot: the E-Stop and cutting power. Nothing in the SDK is an emergency stop
- Before You Run a Script: the checklist for every script that moves the robot
Pages
Quickstart
Install, check, stand, balance, walk for 3 s, damp.
Connection Modes
udp, hybrid and livekit, and how a saved robot chooses.
Move the Robot
stand, balance, set_velocity, the check each command runs, limits.
Control Joints
set_joints and trajectory on a supported robot.
Read State
One snapshot of everything the robot reports, and how to wait on it.
Camera and Audio
Frames, clips, microphone and speaker on hybrid and livekit.
Record a Session
State and commands as JSON lines.
Without the SDK
The LiveKit room with livekit and asimov-protocol only.
Safety
The checklist before a script runs, what to do when something goes wrong, and the readiness codes.
Examples
Every example script in the repository.
Command Line
menlo setup, robots, status, stand, balance, walk, damp.
Reference
Every class, verb, field and error.
Troubleshooting
What each error means and what to do.
Requirements
Python 3.12 or newer. pip install menlo-sdk installs asimov-protocol, protobuf,
livekit, questionary and rich. numpy, Pillow and OpenCV are optional; a method that
needs one names it in its ImportError.
Related
- Drive from Python: the hands-on path from a built robot to its first walk
- Python SDK: the overview in the program section
- API: the HTTP and WebSocket interface of Asimov Manager
How is this guide?