Skip to main content
A policy is any callable that maps observations to actions:
Use @rfx.policy to make a function deployable from the CLI.

Minimal policy

my_policy.py
Deploy:

Named joint control

Use MotorCommands to build actions from joint names instead of raw tensor indices:
See MotorCommands for the full API.

Stateful policies

A policy can be any callable, including a class with state. @rfx.policy wraps a factory function — the returned callable becomes the policy:

Torch and tinygrad

LoadedPolicy handles torch / tinygrad conversion automatically at deploy time. Policies can be authored in either framework as long as the callable contract holds.