Write Runtime Config#

Preview: PolicyRuntime and the config system are planned APIs. The examples below document the target design.

A runtime config describes a robot control workflow before execution starts.

# runtime.yaml
runtime:
  class_path: physicalai.runtime.PolicyRuntime
  init_args:
    fps: 30
    robot:
      class_path: physicalai.robot.so101.SO101
      init_args:
        port: /dev/ttyACM0
    model:
      class_path: physicalai.inference.InferenceModel
      init_args:
        export_dir: ./exports/act_policy
    cameras:
      wrist:
        class_path: physicalai.capture.UVCCamera
        init_args:
          device: /dev/v4l/by-id/usb-Example_Wrist_Camera-video-index0
          width: 640
          height: 480
    execution:
      class_path: physicalai.runtime.SyncExecution
      init_args:
        mode: chunk

You can load the same file from Python.

from physicalai.runtime import PolicyRuntime

runtime = PolicyRuntime.from_config("runtime.yaml")
runtime.run(duration_s=60)

You can also run the same config from the CLI.

physicalai run --config runtime.yaml --duration-s 60

Nested components use the same class_path and init_args shape.

class_path: module.ClassName
init_args:
  key: value

The config file remains passive data. The workflow starts only when PolicyRuntime.run() is called.