Task Program architecture#
Task Program connects object-centric task intent to execution in a configured scene. A program declares which Semantic Calls to run, in what order, and what to check. A deployment binds those calls to a scene, robot resources, and an execution policy. Compilation resolves static references. Execution uses live observations to turn each call into a typed Atomic Skill invocation.
flowchart TD
accTitle: Task Program compilation and execution modes
accDescr: Program and deployment declarations feed the compiler. Expert mode runs Atomic Skills, while policy mode evaluates stage progress after Gym steps.
Source["Program source<br/>YAML, JSON or Python"] --> Decode["Decode and bind<br/>TaskProgramCfg"]
Deployment["Deployment catalog<br/>Scene, robot and policy"] --> Decode
Decode --> Compile["Compile and preflight<br/>CompiledTaskProgram"]
Compile --> Expert["Expert execution<br/>Atomic Skills and Gym"]
Compile --> Progress["Policy progress<br/>Post-step stage checks"]
The Franka Pick/Place walkthrough follows one configured program through those boundaries. Use entry points to choose the interface for YAML, Python, or an MLLM response.
Ownership boundaries#
Layer |
Package |
Main contract |
|---|---|---|
Language |
|
Normalizes YAML or JSON and decodes the bounded program tree into |
Semantics |
|
Defines Semantic Calls, canonical scene entities and affordances, robot resource bindings, effects, and evidence. |
Compiler |
|
Builds |
Integrations |
|
Composes the trusted catalog from configuration and supplies factories for live observations, motions, transports, and evidence. |
Runtime |
|
Executes the compiled sequence or parallel block and advances semantic task state under the selected effect policy. |
Atomic Skills and motion |
|
Plan and issue controller commands from a typed goal and bound resources. The selected skill and policy determine the planning backend. |
Gym and recording |
|
Adapt actions to |
A Semantic Call such as place refers to a held object and a destination.
An Atomic Skill such as Place receives the grounded goal, robot resources,
and options as a SkillInvocation. The program can be reused when another
deployment satisfies its semantic scene and resource contracts. See
Atomic Skills for the skill execution boundary.
Entry points#
Goal |
Entry point |
Result |
|---|---|---|
Run a configured expert task |
|
Selects an environment, composes its integration, and runs the program through the Gym demo executor. |
Run the Franka expert program with direct Sim stepping |
|
Creates a |
Load YAML or decode a mapping |
|
An owned |
Compile against static scene identities |
|
A |
Compose the semantic deployment from Python |
|
A |
Compile and run in an existing expert environment |
|
Uses the environment’s |
Accept an MLLM response |
|
Applies the frontend’s restrictions to explicit JSON. The host supplies the scene, profile, and preset selection. |
Execute a typed motion directly |
|
Takes an explicit |
For a complete Python example, see Authoring a Task Program in Python.
load_task_program() takes a filesystem path. The launcher also resolves
installed package references. The MLLM frontend accepts the sequential subset
with pick, place, or hand_over and uses host-owned resource bindings.
See choosing a form for its JSON shape.
The Task Engine is an upstream authoring path. It produces candidate semantic graphs and requirements. The deployment binds their logical entities to a physical scene and selects a compatible embodiment and policy for the resulting Task Program.
What a program can call#
Program syntax |
Semantic Call and Atomic Skill |
Declaration |
|---|---|---|
|
|
The object and an optional grasp affordance. |
|
|
The held object and a pose, support, or container destination. |
|
|
The object, source and destination resource roles, and an optional final target. The profile can supply default resources. |
|
|
The held object and a target pose under a verified retention policy. |
|
|
A registered |
|
Registered call with a configured nominal motion source |
The deployment’s named Demo Skill alias and asset-defined roles. |
The language defines the call shapes. The selected integration and policy
preset supply the concrete availability, resource defaults, and argument
contracts. To inspect them, use --json --explain with the
deployment inspector.
contracts describes the selected catalog. calls lists the resolved resources
and authored path for every expanded call occurrence.
Services used during expert execution#
What the runtime needs |
Source |
|---|---|
Semantic identity and geometry |
A |
Robot capabilities and commands |
|
Planning and tracking |
Atomic Skills use the selected motion strategy, IK and planner backends, such as MotionGenerator where configured. The policy also selects tracking, runner, and recovery settings. |
Physical evidence |
The integration supplies registered observation and evidence ports for effects such as grasp and release. Environment sensors supply measurements, and evaluation rules interpret them for the selected checks. |
Trajectory recording and expansion |
Gym uses |
Configure a simulation environment#
A runnable deployment selects the physical environment, embodiment, program, integration, and execution policy. The Franka Quickstart uses this file.
id: TaskProgramRepeatedPickPlace-Franka-v1
environment:
default: envs/default.yaml
newton: envs/newton.yaml
task_program:
program: task_program/program.yaml
integration: task_program/integration.yaml
execution_policy: ../../../components/execution_policies/trajectory_open_loop.yaml
embodiment:
component: ../../../components/embodiments/franka_panda.yaml
overrides:
init_rot: [0.0, 0.0, 180.0]
The environment owns physical scene entities and the physics backend. The
embodiment owns the robot, sensors, and reusable skill profile. The program owns
object-level flow, targets, and segment checks. integration.yaml maps
semantic scene entities to physical UIDs and declares task-specific resource
defaults, skill options, monitors, and allowlisted services. The execution policy
selects motion, tracking, recovery, and effect assurance. See
Configure and verify a deployment for the configuration ownership table and Scene registry
for the scene_binding structure.
The Gym configuration loader resolves component paths relative to the runnable
YAML, selects one physical environment file, and checks each semantic root
against its physical binding. It composes the catalog and injects the trusted
scene-registry, robot-profile, and preset IDs as a TaskProgramIntegrationCfg.
The host registers the common EmbodiedEnv under the deployment’s Gym ID.
The launcher can select a compatible program file with --task-program.
Program schema#
A TaskProgramCfg holds the program ID, the selected integration,
optional overall instruction, named targets, and one bounded program tree.
The YAML selected by a configured deployment carries the program declaration.
The deployment supplies its integration selection during loading.
SequenceCfg orders steps, RepeatCfg repeats a bounded body, and
SegmentCfg gives a group of steps an instruction and observable outcome.
InvokeCfg holds one call. ParallelCfg contains branches and a
BarrierCfg. Shorthand normalizes to these same nodes. The decoder
checks field names, values, references, and expansion limits. See
Configuration authoring for the two YAML forms and Task and segment language for expert data
for how root and segment instructions are recorded.
Load and compile#
Normalize and decode. Expand shorthand, bind the supplied integration, and validate typed call arguments, targets, and structural bounds. Diagnostics map back to the source YAML or JSON paths.
Compile the static program. Compilation resolves canonical references against the scene manifest. The compiled structure preserves parallel blocks and provides stable segment and call indices as its bounded repeats are expanded. A
cyclic_poseselects a pose from the nearest repeat’s iteration. Ascene_relativetarget retains its reference and local pose until live grounding.Preflight the compiled calls against the catalog. Confirm that the selected resource bindings, policies, and required lowerers or monitors satisfy the compiled program. The deployment inspector uses this check.
The result is a provider-free CompiledTaskProgram. The configured
adapter checks the integration selection and registration before creating the
live runtime. Planning then uses the current environment observations.
Runtime lifecycle#
In expert mode, EmbodiedEnv.create_demo_segments() selects the program and
the adapter creates a TaskProgramDemoBridge. The bridge yields DemoSegment
objects with lazy controller actions. The normal Gym demo executor consumes
those actions and owns stepping, recording, and reset.
sequenceDiagram
accTitle: Expert execution feedback loop
accDescr: The Gym executor consumes controller actions, steps the environment, and acknowledges each action before the bridge advances.
participant Host as Gym executor
participant Bridge as Demo bridge
participant Runtime as Call executor
participant Skills as Atomic Skills
Host->>Bridge: Consume a segment
Bridge->>Runtime: Start and ground the call
Runtime->>Skills: Plan a SkillInvocation
loop Controller frames
Skills-->>Bridge: Command frame
Bridge-->>Host: ControllerAction
Host->>Host: env.step(action)
Host->>Bridge: Acknowledge action
Bridge->>Runtime: Advance after the step
end
Bridge-->>Host: Effect and segment results
The bridge checks segment prerequisites and captures any required entry
measurements before dispatch. For each call, SemanticCallExecutor reads a
fresh planning observation and asks SemanticCallCompiler to ground its goal,
resources, and effect contract. This binds scene-relative targets to that
observation. AtomicSkillEngine plans the invocation and ExecutionRunner
advances its command and feedback lifecycle. The bridge encodes command frames
for Gym, then advances its clock after the action is consumed. Configured
recovery handles failed attempts using the same execution lifecycle.
Standalone simulation#
With a CUDA installation, run the packaged Franka Pick/Place Task Program in headless Default physics.
embodichain run-example sim/task_program/franka_pick_place
The example resolves the existing task.franka.yaml components, creates a
SimulationManager, spawns the configured Franka and cube, and calls
sim.prepare(). It binds the configured adapter to the simulation, robot,
and control interval. The adapter compiles the program and creates the bridge.
The example owns the command loop and calls sim.update() directly.
def _run_program(
host: _SimulationHost, bridge: TaskProgramDemoBridge, sim_steps_per_control: int
) -> bool:
physics_dt = host.sim.sim_config.physics_dt
env_ids = bridge.env_ids.tolist()
for segment in bridge.iter_segments():
for action in segment.actions:
targets = action.value
host.robot.set_qpos(qpos=targets["qpos"], env_ids=env_ids, target=True)
host.robot.set_qvel(qvel=targets["qvel"], env_ids=env_ids, target=True)
host.sim.update(physics_dt=physics_dt, step=sim_steps_per_control)
# Validate the segment before requesting the next one from the bridge.
accepted = segment.validator()
print(f"{segment.name}: accepted={accepted.tolist()}")
completion = bridge.completion_mask
print(f"{bridge.program_id}: completion_mask={completion.tolist()}")
return bool(completion.all())
The host selects joint_command_mode: position_velocity, so each yielded
action carries qpos and qvel. The deployment’s velocity_targets: auto
preserves planned velocities or derives them from the final joint samples.
The example uses two native physics substeps per 10 ms manager interval to
refine contact integration during release. One controller action covers four
manager intervals, or 40 ms of simulation time.
The loop applies both targets before the same sim.update() call and advances
sim_steps_per_control physics intervals. Resuming the iterator after those
intervals acknowledges the action and advances the bridge clock once. The
example exhausts each segment’s actions, including post-policies, and calls its
validator before requesting the next segment. It prints the per-segment masks
and returns a nonzero exit status if the final completion_mask rejects the run.
The packaged program uses projected effects. To also measure the cube’s
resting position after each Place, download the existing
two_moves_checked.yaml and select
it from the working directory.
embodichain run-example sim/task_program/franka_pick_place --program two_moves_checked.yaml
This variant waits for settling and checks the measured cube position against
rest_pose for both Place segments. See the Customize your first expert trajectory for the target
definitions and acceptance tolerance.
Policy progress#
With task_program.execution: policy, ActionManager translates the policy’s
actions into control commands. After each environment step, TaskProgramProgress
updates ordered stage achievements using the configured measured conditions.
program_stage_reward and program_stage_condition read those results for
reward and termination. The mode uses the compiled program as the stage
structure and keeps control with the policy. See
expert execution and policy progress
for the configuration and limits.
Effect assurance is mandatory#
The execution policy explicitly chooses effect_assurance. With verified,
measured evidence authorizes semantic effects. Curated Pick, Place, and
HandOver calls require corresponding monitor declarations. With projected,
command completion applies the expected symbolic effect and the integration
supplies an empty effect-monitor mapping.
Boundary |
What to check |
|---|---|
Per-call effect |
The runtime reports the projected or verified transition for the call. In a verified task, evidence can establish attachment during Pick or release during Place. |
Segment post-policy |
The bridge performs configured follow-up behavior, such as holding the robot while it waits for an object to settle. |
Segment acceptance |
Validators and any segment contract outcomes determine which environment rows are accepted. |
Episode and dataset |
The environment combines program completion with its configured final and process requirements. The recorder commits eligible data and metadata as a separate step. |
Follow the run verification guide to inspect these results at their respective boundaries.
Parallel programs#
Each parallel branch is a sequential lane. Parallel execution requires disjoint
robot resource claims and runtime targets, control-grid alignment,
conflict-free symbolic writes, a ParallelCommandSafetyValidator, and an
explicit fail-fast barrier. The executor coordinates the lanes on one clock and
checks the combined commands before dispatch. The selected integration supplies
the safety validator.
Registered calls#
Registered calls select an integration-owned lowerer by name. Open Drawer
uses this declaration to map a semantic articulation handle to the Slide
Atomic Skill.
registered:
call_id: simulation.articulation_link_slide
arguments:
handle: drawer_handle
The registration declares the call ID, revision, target skill descriptor, and argument rules. Preflight checks those declarations. Live assembly creates a fresh lowerer that binds the invocation using the registered runtime services. Named Demo Skills reuse the same mechanism with an occurrence-bound nominal source. See Named Demo Skills.
Reference tasks#
Trace the Franka Pick and Place example#
task.franka.yamlselectstask_program/program.yaml, the scene registrytask_program_repeated_pick_place, thefranka_pandaskill profile, and thetrajectorypreset. The integration’s semanticcubebinds to the physicalcubeUID and declares thecube_graspaffordance.The
repeatbody schedulespick_cubeandplace_cubethree times. The three Place occurrences selectdrop_posevalues in order A → B → A.The Pick and Place resource defaults select
primary_manipulator. Franka’s profile binds its motion endpoint toarmand the grasp endpoint toeef. Atomic Skills use the preset’sik_interpstrategy to generate commands, and the normal Gym executor advances the environment.The preset projects the expected held and released states after the calls complete. The checked Quickstart adds
wait_stableand a validator againstrest_poseto measure where the cube settles. The recorded episode carries those results alongside the trajectory.
program:
repeat:
count: 3
body:
- segment: pick_cube
instruction: Grasp and lift the cube.
steps:
pick:
object: cube
- segment: place_cube
instruction: Place the cube at the next target position and release it.
steps:
place:
object: cube
at: drop_pose
Environment |
What it illustrates |
|---|---|
|
Bounded repeat, cyclic targets, and the projected expert flow above. |
|
UR5 expert deployment with a separate expansion declaration. |
|
A registered call lowered to |
|
Coordinated |
|
Registered held-object transport and |
|
Ordered measured lift and stacking conditions evaluated during policy execution. |
The repeated Pick/Place and Open Drawer deployment files select either Default or Newton physical environments using the same Gym ID. See select a task and environment.
Recommended change sites#
Change |
Owning source |
|---|---|
AST values, shorthand, or strict decoding |
|
Bounded program structure and static scene resolution |
|
Semantic analysis, grounding, and |
|
Catalog declarations, component composition, and live service factories |
|
Call execution, effect transitions, recovery, and scheduling |
|
Gym adapter and segment lifecycle |
|
Atomic planning and controller scheduling |
|
Focused validation#
Use the deployment inspector for changes to configured tasks. For implementation changes, choose the tests covering the affected boundary.
pytest -q tests/lab/task_program
pytest -q tests/gym/envs/task_program
pytest -q tests/sim/atomic_skills
python docs/scripts/check_api_docs.py
Physical qualification requires runs on the intended environment, with controlled seeds, measured checks, and persisted acceptance metadata.
Further reading#
See Configuration authoring for the language forms, target types, and segment contracts.
See Scene registry and Robot skill profiles for physical scene and robot bindings.
Use Customize your first expert trajectory to run and record the Franka example.
Use Configure and Run an Embodied Task Program to build a compatible deployment.