Skip to main content

reaf-sim

CI PyPI version Documentation Status Open In Colab License

reaf-sim is a PyTorch simulation framework built by the MuJoCo team on top of MuJoCo and MuJoCo Warp, and using the Robotics Environment Authoring Framework (REAF).

reaf-sim is designed explicitly for sim-to-real robotics workflows. To achieve this, we decouple hardware and sensor I/O from task logic. The hardware layer is called the DeviceLayer, which wraps sim in an interface that is consistent with physical hardware. The task logic is implemented in the TaskLayer, which handles MDP processing of actions, observations, terminations, and rewards. Critically, the TaskLayer has no access to privileged simulation state, which makes sim workflows portable to real hardware.

This project adheres to the GDM Robotics Environment interface.

Installation

Install reaf-sim from PyPI (Python 3.12+):

uv pip install "reaf-sim>=1.0"

Cartpole Example

For a quick preview into reaf-sim, let's create an environment controlling a cartpole alongside a camera rendering RGB observations across 16 parallel environments on GPU (impl="warp"). Step the environments with control commands and capture visual rollouts:

import mujoco
from reaf.simulation.torch import ActuatorDevice, CameraDevice, flat_scene
from reaf.simulation.torch.examples.cartpole import CARTPOLE_XML
import torch

spec = mujoco.MjSpec.from_string(CARTPOLE_XML)

# configure the environment
config = flat_scene.Environment(
    base_scene=spec,
    sim=flat_scene.Sim(
        nworld=16,
        xpu_device="cuda:0",
        impl="warp",
        simulation_timestep=0.01,
        control_timestep=0.05,
    ),
    device_layer=flat_scene.DeviceLayer(
        devices={
            "slider": flat_scene.Component(
                ActuatorDevice, targets=["slider"]
            ),
            "camera": flat_scene.Component(
                CameraDevice,
                cam_name="fixed",
                cam_resolution=(160, 120),
                render_rate_hz=20.0,
                output_name_prefix="camera/",
            ),
        }
    ),
    observation_adapter={
        "camera/fixed_rgb": flat_scene.ObsGroup(
            terms={
                "rgb": flat_scene.Obs("camera/fixed_rgb").configure(
                    output_shape=(120, 160, 3), dtype="uint8"
                ),
            }
        ),
    },
)

# build the environment
env = flat_scene.build_env(config)

# step the environment with batched actions and extract camera frames
timestep = env.reset()
for _ in range(100):
  commands = torch.rand((env.nworld, 1), device="cuda:0") * 2.0 - 1.0
  timestep = env.step({"slider/ctrl": commands})
  camera_frames = timestep.observation["camera/fixed_rgb"]  # (16, 120, 160, 3)

For the complete, runnable script that loads the Cartpole model and generates the tiled grid video below, see reaf/simulation/torch/examples/cartpole.py.

16-environment parallel Cartpole rollout on GPU

Documentation & Contributing

Citation

If you use reaf-sim in your work, please cite it as follows (see the GitHub contributors page for the full list of contributors):

@software{reaf_sim_2026,
  author = {{reaf-sim Contributors}},
  title = {{reaf-sim: Robotics Environment Authoring Framework - Simulation}},
  url = {https://github.com/google-deepmind/reaf-sim},
  year = {2026},
}

Acknowledgements

We are grateful to all members of the MuJoCo team for their support in developing reaf-sim. Additionally, we thank the authors of REAF, mjlab, and Isaac Lab for inspiring reaf-sim.

License & Disclaimer

reaf-sim is released under the Apache 2.0 license. See LICENSE for details.

This is not an official Google product.

Metadata

Release files for reaf-sim 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for reaf-sim 1.1.0
File Size Uploaded Provenance Actions
reaf_sim-1.1.0.tar.gz 247.5 kB Without provenance Details for reaf_sim-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for reaf-sim 1.1.0
File Interpreter ABI Platform Actions
reaf_sim-1.1.0-py3-none-any.whl Python 3 none any Details for reaf_sim-1.1.0-py3-none-any.whl

Total release size: 579.9 kB

Release files / reaf_sim-1.1.0.tar.gz

Download URL reaf_sim-1.1.0.tar.gz
Size 247.5 kB
Tags Source
SHA-256 checksum
How to use checksums
94984a66a9185c17977fccdf0ed54b782f9bdf95a4f6cbb6de3942a50c80bfda
BLAKE2b-256 checksum
How to use checksums
e87d6a31d7b67f41c583ad708d3438b28516abc6ab383d541a5597a7cc77e3e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / reaf_sim-1.1.0-py3-none-any.whl

Download URL reaf_sim-1.1.0-py3-none-any.whl
Size 332.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3fb4f03b7ea38527cf7ab898bf848009212b0ba63661ce530760406b84c2190
BLAKE2b-256 checksum
How to use checksums
0bf83a2aaa6dcfbe3880dfcffbd43cba22c0269d639470a0d63e956976875a52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for reaf-sim 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page