Menlo

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.

examples/walk.pyView on GitHub ↗
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 toThe SDK gives you
Walk, strafe, turnset_velocity(vx, vy, vyaw) in MOVE, held for a duration or until balance()
Change robot modestand(), balance(), damp()
Move jointsset_joints(pose) and trajectory(setpoint) with the walking policy off
Read the robotrobot.get_state(): mode, joints, IMU, battery, alerts; waits that read it
Check before movingevery moving verb checks the robot first and raises NotReadyError with stable problem codes; preflight() is the same check without a command
See and hearcamera frames, microphone chunks, a speaker to play into
Keep a recordevery state sample and every command as JSON lines

Connection Modes

ModeControl and stateCamera and audioWorks from
udpUDP on the robot's networknonethe robot's network
hybridUDP on the robot's networka LiveKit roomthe robot's network
livekita LiveKit rooma LiveKit roomwherever 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:

Pages

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.

How is this guide?

On this page