rfx.robot module provides the core interface for all robots, whether real or simulated.
Robot Protocol
The entire robot interface. Real or simulated robots implement the same API.Properties
Number of parallel environments (1 for real robots)
Actual state dimensionality (before padding)
Actual action dimensionality (before padding)
Padded state dim for multi-embodiment training
Padded action dim for multi-embodiment training
Device for tensors (“cuda” or “cpu”)
Methods
observe()
Get current observation as a dictionary of tensors.Dictionary containing:
state:(num_envs, max_state_dim)- joint positions/velocitiesimages:(num_envs, num_cams, H, W, 3)- RGB images (optional)language:(num_envs, seq_len)- tokenized instruction (optional)
act(action)
Execute an action on the robot.Action tensor with shape
(num_envs, max_action_dim) or (num_envs, horizon, max_action_dim)reset(env_ids=None)
Reset environments and return initial observation.(N,) tensor of environment indices to reset. If None, resets all environments.Initial observation dictionary (same format as
observe())RobotBase
Abstract base class for Robot implementations. Provides common functionality and enforces the interface.Constructor
Actual state dimensionality (e.g., 6 for SO-101)
Actual action dimensionality (e.g., 6 for SO-101)
Number of parallel environments
Padded state dimension for multi-embodiment training
Padded action dimension for multi-embodiment training
Device for tensors (“cuda” or “cpu”)
Class Methods
from_config(config_path, **kwargs)
Create a robot from a YAML config file.Path to YAML configuration file
Additional keyword arguments to override config values
RobotConfig
Configuration dataclass for a robot.Human-readable name (e.g., “SO-101”)
Path to URDF file (for simulation)
Actual DOF for state
Actual DOF for actions
Pad state to this for multi-robot training
Pad action to this for multi-robot training
List of camera configurations
List of joint configurations
Control loop frequency in Hz
Hardware-specific settings (port, IP address, etc.)
Class Methods
from_dict(d)
Create from a dictionary.from_yaml(path)
Load from a YAML file.Instance Methods
to_dict()
Convert to a dictionary.Pre-defined Configs
Pre-configured robot configurations for common platforms:SO101_CONFIG- SO-101 arm (6 DOF)GO2_CONFIG- Unitree Go2 quadruped (12 DOF)G1_CONFIG- Unitree G1 humanoid (29 DOF)INNATE_CONFIG- Innate manipulation arm (6 DOF)
CameraConfig
Configuration for a camera sensor.Camera identifier
Image width in pixels
Image height in pixels
Frames per second
Camera device ID or path
JointConfig
Configuration for a single joint.Joint name
Joint index in the robot’s DOF array
Minimum position limit (radians)
Maximum position limit (radians)
Maximum velocity (rad/s)
Maximum effort/torque (Nm)
load_config()
Load a robot configuration from a YAML file or dictionary.Path to YAML config file, or a dictionary
Configuration dictionary
