Skip to main content

dora-policy-inference

Project description

dora-policy-inference

Load pre-trained policies and execute them in real-time to control robots based on camera observations and current robot state.

Quick Start

1. Installation

# Source your venv
cd dora/node-hub/dora-policy-inference
uv pip install -e .

2. Usage Guide

Create a dataflow file, see examples/lerobot-dataset/policy_inference.yml:

nodes:
  # Policy inference
  - id: policy_inference
    build: pip install -e ../../dora-policy-inference
    path: dora-policy-inference
    inputs:
      # your Cameras should be same as the dataset trained policy is on.
      laptop: laptop_cam/image
      front: front_cam/image
      robot_state: robot/pose
    outputs:
      - robot_action
      - status
    env:
      # Required settings
      MODEL_PATH: "/path/to/your/lerobot/model"
      TASK_DESCRIPTION: "pick up the cup"
      INFERENCE_FPS: "30"

      # Camera configuration
      CAMERA_NAMES: "laptop,front"
      CAMERA_LAPTOP_RESOLUTION: "480,640,3"
      CAMERA_FRONT_RESOLUTION: "480,640,3"

  # Robot controller
  - id: robot_controller
    path: your-robot-controller
    inputs:
      action: policy_inference/robot_action # predicted joint state(rad)
    outputs:
      - pose

3. Start Policy Inference

dora build policy_inference.yml
dora run policy_inference.yml

The node will process camera inputs and robot state to generate actions for robot control.

Configuration

Required Environment Variables

Variable Description Example
MODEL_PATH Path to trained LeRobot policy model directory "outputs/train/your_policy/checkpoints/last/pretrained_model"
CAMERA_NAMES Comma-separated camera names "laptop,front,top"
CAMERA_*_RESOLUTION Resolution for each camera (height,width,channels) "480,640,3"
INFERENCE_FPS Inference frequency "30"
TASK_DESCRIPTION Task description for task-conditioned policies "Grab the red cube and and drop in the box."

Camera Configuration

For each camera defined in CAMERA_NAMES, you must set the resolution:

export CAMERA_NAMES="laptop,front,top"
export CAMERA_LAPTOP_RESOLUTION="1080,1920,3"
export CAMERA_FRONT_RESOLUTION="480,640,3"
export CAMERA_TOP_RESOLUTION="480,640,3"

Model Requirements

The node expects LeRobot trained models with:

  • A config.json file in the model directory
  • Model weights compatible with LeRobot's from_pretrained() method

Device Selection

The node automatically selects the best available device:

  • CUDA GPU (if available)
  • MPS (Apple Silicon)
  • CPU (fallback)

Device selection is handled by LeRobot's get_safe_torch_device() function.

See the examples/lerobot-dataset/policy_inference.yml for complete dataflow configurations.

License

This project is released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dora_policy_inference-0.0.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dora_policy_inference-0.0.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file dora_policy_inference-0.0.0.tar.gz.

File metadata

File hashes

Hashes for dora_policy_inference-0.0.0.tar.gz
Algorithm Hash digest
SHA256 532f75c05e80b5d8329e8a21cf12a5fd14aa4fc8f7aa7fdefc78bc3a136e2b94
MD5 4c628869188417ee95356a888802008e
BLAKE2b-256 7678fd57550a4115e4f1ed1184d3a7cdf8c6b3ea3aed468a9c2dcca128138fbf

See more details on using hashes here.

File details

Details for the file dora_policy_inference-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dora_policy_inference-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5818fe5a486ad5d4b791b3baf759a05bd90913d63c5ce4baa51f1d7aaf9e9da
MD5 b0100f7fe184509bff3e9c00ee730278
BLAKE2b-256 1aed2366d06e78fe08e8a8aec12a0f5c665b8fb61428ac6e47964c5416873a8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page