Missions

Chain steps into a recipe the robot follows. Things like "go to the kitchen, pick up the cup, bring it back".

What a Mission is

A Mission is a small graph of Steps. Each Step is one robot action (a primitive) that runs through the safety pipeline. Steps can depend on each other, retry on failure, and be marked required vs optional.

Step

One robot action, e.g. goto(x, y) or pick(object).

Depends on

Step B only starts after Step A finishes successfully.

Required

If a required Step fails, the Mission aborts. Optional Steps log and continue.

Drag-and-drop Mission builder: coming in v0.2

The visual editor lets you compose Missions by dragging Step tiles onto a canvas and drawing dependency arrows. Until that ships, you have two ways to drive missions:

  • Via the live demo: the HuggingFace Space lets you dispatch primitives one at a time and watch the trace, which is close to running a single-Step Mission.
  • Via the Python API: for now, Missions are built and submitted from code. See the snippet below.
Set up the local stack
Python-API example (for now)
from ghostloop.missions import Mission, Step, MissionRunner
from ghostloop import Intent

mission = Mission(name="deliver", steps=[
    Step(name="goto_room",
         emit=lambda m, s: Intent("goto", {"x": 1.5, "y": 0, "theta": 0})),
    Step(name="dispense",
         emit=lambda m, s: Intent("dispense_pill", {"count": 1}),
         depends_on=["goto_room"]),
    Step(name="alert",
         emit=lambda m, s: Intent("alert_nurse", {"message": "delivered"}),
         depends_on=["dispense"]),
])
result = MissionRunner(runtime).run(mission)

Submit it to a running backend by POSTing the serialized Mission to /v1/missions/run.