armnet-runtime¶
armnet-runtime is installed inside your runtime containers. It provides:
- the
@maindecorator - the
Contextobject passed to runtime functions ctx.cellhelpers such asresetctx.volumefor the mounted user volume- the
armnet-runtimecontainer entrypoint - guarded LeRobot/robot import replacement for remote cell execution
Runtime programs usually look like:
from armnet_runtime import Context, main
@main
def run(ctx: Context) -> dict:
ctx.report_progress("hello")
return {"ok": True}
The @main decorator marks the function the platform should run. Your
Dockerfile should call:
CMD ["armnet-runtime", "/app/main.py"]
The runtime entrypoint imports your file, finds the decorated function, builds a
Context, and calls the function.
Connecting to Robots¶
Use ctx.cell.robot_port and other ctx.cell fields when constructing robot
configs. In a managed cell this value may be a connector endpoint rather than a
physical serial or network interface; the runtime import replacement routes
hardware calls through the managed cell.
Plain LeRobot robots work unchanged this way, at one round trip per device. The Armnet robots take one round trip to observe and one to act; Armnet's own record, teleop and eval runtimes use them. See Armnet Robots.
See Context for the full object reference.