The runnable scripts that ship with the SDK, grouped by what they show.
Each file is one short, runnable script, kept in the
examples directory of the
SDK repository. Every script except connect.py and the livekit_raw/ scripts connects to
the saved robot (menlo setup), or to the robot the MENLO_* environment variables describe; set MENLO_ROBOT=NAME to pick another saved
robot. The settings a script uses, such as a speed, a duration or a joint name, are constants
at the top of the file. Read the docstring at the top of a file before you run it: it says
what the robot must be doing. Before a script that moves the robot, work through
Before You Run a Script.
The SDK sends what a script asks and reports what the robot says; it refuses a command only
when there is no live state. A guard is yours: guard.py is an example of one, and no
script uses it by default. Each motion script carries two commented guard lines; uncomment
them to stop the script, before it sends anything, when the robot reports what your rule
will not drive through, and edit the limits in guard.py. Nothing here is an emergency
stop: use the E-Stop in Asimov Manager, or cut power at the battery unit.
the robot's facts (robot mode, armed, faults, alerts, the hottest joint, battery, state age) and preflight() for stand, move and trajectory; sends nothing
an optional guard of your own: joint temperature, battery, a latched fault and active alerts, with limits at the top of the file; prints what it finds and exits with status 1 when the rule fails. Off by default: the motion scripts carry it commented out
a tour of robot.get_state(): mode, arming, faults, battery, the hottest actuators, gravity, alerts, state age and rate, and the mode and alert callbacks
stand() from any robot mode; it returns once the robot is armed, and the script prints the NotReadyError or WaitTimeoutError otherwise. From MOVE, hang the robot from its gantry hook or seat it on a stool or bench first
a bounded set_velocity(duration=3.0) in MOVE: the SDK holds the velocity, sends zero, and the robot balances in place; reports sent.clamped. Walking in MOVE only is the script's own rule
drive from the keyboard with short bounded holds: w/s walk, a/d strafe, q/e turn, space balance(), t stand (asks first in MOVE), b damp after asking, x quit
set_joints() on one named joint, on a supported robot; exits unless ROBOT_SUPPORTED = True is set in the file; the robot enters DAMP 2 s after the script exits
set_joints(wait=False), then wait_until() acts the moment the joint passes an angle in the robot's own report, on a supported robot; exits unless ROBOT_SUPPORTED = True
The scripts in livekit_raw/ use only the livekit and asimov-protocol packages; see
Without the SDK. They read MENLO_CREDENTIAL and the
MANAGER_URL set in manager_token.py.