Skip to main content

Robotics Environment Authoring Framework (REAF)

The Robotics Environment Authoring Framework (REAF) simplifies creating environments that adhere to the GDM Robotics Environment interface.

How to install

reaf can be installed from PyPI using pip:

pip install reaf

Directory Structure

Currently, the directory structure is designed as standalone subdirectories with a well-defined dependency graph.

reaf
├── core: Core libraries and interfaces for REAF.
├── testing: General tooling for testing REAF interfaces and environments.
├── common: Libraries with shared functionality across setups and platforms.

Design

REAF is a framework designed to simplify the creation of robotics environments. It adopts a layered architecture to promote modularity and reusability. The core components of a REAF environment are:

  1. Environment: The top-level interface for interacting with the environment, conforming to the GDM Robotics Environment interface. It handles stepping, resetting, and action/observation specs.
  2. Task Logic Layer (TLL): Responsible for defining the task itself, including reward calculation, termination conditions, features generation, and commands processing.
  3. Data Acquisition and Control Layer (DACL): Interfaces with the physical or simulated robotic setup, managing commands to actuators and retrieving measurements from sensors.
  4. Adapters: Bridge the gap between the abstract GDMR interfaces and the specific requirements of the TLL. These adapters translate agent actions into TLL commands and TLL features into agent observations.
  5. Reset and End of Episode Handlers: Support customized behavior during environment resets and episode termination.

Environment

The Environment class serves as the primary interface for interacting with the robotic environment. It coordinates the interactions between the TLL and DACL, manages the environment's state, and handles stepping through the environment. Key functionalities include:

  • reset_with_options(): Resets the environment to a new initial state based on the provided options. This involves resetting the DACL, computing initial features and observations.
  • step(): Advances the environment by one step. This method takes an agent action, processes it into commands, steps the DACL, computes features, reward, discount, termination conditions, and new observations, and returns a TimeStep object containing this information.
  • action_spec(): Returns the specification for valid agent actions. This is determined by the ActionSpaceAdapter.
  • timestep_spec(): Returns the specification for the TimeStep objects returned by step() and reset().
  • Logging: Facilitates adding and removing loggers to monitor internal operations.

Task Logic Layer (TLL)

The TLL defines the logic and rules governing the robotic task. It comprises several core components:

  • FeaturesProducer: Generates additional features based on existing features and measurements from the DACL. Each producer has a produced_features_spec() defining the features it generates and required_features_keys() indicating the features it depends on.
  • CommandsProcessor: Modifies commands before they are sent to the DACL. Processors can transform, filter, or augment commands. The consumed_commands_spec() describes the commands accepted by the processor, and produced_commands_keys() defines the output commands.
  • RewardProvider: Calculates the reward signal based on the current features. It exposes a reward_spec() defining the structure of the reward.
  • TerminationChecker: Determines whether the episode should terminate based on features and returns a TerminationResult indicating the type of termination.
  • DiscountProvider: Computes the discount factor based on features and the termination state.
  • FeaturesObserver: Passive components that observe features without modifying them. This is useful for logging or analysis.
  • Logger: Records measurements, features, and commands during environment interactions. Methods like record_measurements(), record_features(), and record_commands_processing() are called at specific points in the environment's lifecycle.

The TLL also provides methods to:

  • compute_all_features(): Computes all features based on measurements from the DACL and the output of FeaturesProducers.
  • compute_final_commands(): Processes the policy's commands using the CommandsProcessors and outputs the DACL command.
  • compute_reward(): Calculates the reward using the RewardProvider.
  • check_for_termination(): Checks termination conditions using TerminationCheckers.
  • compute_discount(): Computes the discount using the DiscountProvider.
  • validate_spec(): Verifies the consistency of the specs across the TLL and DACL.

Data Acquisition and Control Layer (DACL)

The DACL serves as the bridge between the REAF environment and the robotic hardware. It's responsible for sending commands to the robot and receiving measurements from sensors. The DACL is built around:

  • Device: Represents a single hardware component (e.g., robot arm, camera). It provides methods like set_commands() and get_measurements() for interacting with the hardware.
  • DeviceCoordinator: Manages a collection of Device objects, coordinating their actions and data exchange. It provides lifecycle management through start() and stop() methods and synchronization points through before_set_commands() and before_get_measurements().

The DACL's key functions are:

  • begin_stepping(): Initializes the DACL and returns the initial measurements.
  • step(): Sends commands to the devices, retrieves new measurements, and returns them.
  • end_stepping(): Performs cleanup operations at the end of an episode.
  • commands_spec(): Returns the specification for valid commands. The user is expected to pass the full command dictionary.
  • measurements_spec(): Returns the specification for the measurements returned by get_measurements().

Adapters

REAF utilizes adapters to translate between the generic agent interface and the specific format required by the TLL.

  • ActionSpaceAdapter: Converts the agent's actions into a commands dictionary understood by the TLL.
  • ObservationSpaceAdapter: Transforms the features generated by the TLL into observations suitable for the agent.

Reset and End of Episode Handler

  • EnvironmentReset: Defines the reset behavior of the environment, including a do_reset() method and a default reset configuration. The reset is a complex step and very hard to predict how this will be written. The intention is to leave complete control to the user so they can pass whatever object is needed to the reset without any restrictions. The user can use this to check that everything is working properly, reset the state of any features producers, etc...
  • EndOfEpisodeHandler: Provides a callback function, on_end_of_episode_stepping(), that is invoked at the end of each episode after the last step. This is useful for logging, cleanup, or custom logic that needs to be executed when an episode ends.

Licence and Disclaimer

Copyright 2025 Google LLC

All software is licensed under the Apache License, Version 2.0 (Apache 2.0); you may not use this file except in compliance with the Apache 2.0 license. You may obtain a copy of the Apache 2.0 license at: https://www.apache.org/licenses/LICENSE-2.0

All other materials are licensed under the Creative Commons Attribution 4.0 International License (CC-BY). You may obtain a copy of the CC-BY license at: https://creativecommons.org/licenses/by/4.0/legalcode

Unless required by applicable law or agreed to in writing, all software and materials distributed here under the Apache 2.0 or CC-BY licenses are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the licenses for the specific language governing permissions and limitations under those licenses.

This is not an official Google product.

Download files

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

Source Distribution

reaf-1.1.0.tar.gz (87.3 kB view details)

Uploaded Source

Built Distributions

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

reaf-1.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (567.0 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

reaf-1.1.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (540.1 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

reaf-1.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (566.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

reaf-1.1.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (539.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

reaf-1.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (566.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

reaf-1.1.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (539.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

reaf-1.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (566.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

reaf-1.1.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (538.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

reaf-1.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (565.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

reaf-1.1.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (538.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

File details

Details for the file reaf-1.1.0.tar.gz.

File metadata

  • Download URL: reaf-1.1.0.tar.gz
  • Upload date:
  • Size: 87.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for reaf-1.1.0.tar.gz
Algorithm Hash digest
SHA256 92baaec9b07511be78845e7350695812ac58ed621b4c5457d315201d57a394f3
MD5 6546d752253380e58c9f619937f8784f
BLAKE2b-256 2ba9f3c41a9d8f6b3291d902b46910a6770c7bb14a3242208ad129badf41a538

See more details on using hashes here.

File details

Details for the file reaf-1.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for reaf-1.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b033ebccb26477fac45ee5e97dc9586b838d5087a02e2829a72cec296773e2ec
MD5 9f1c964eb3c7bfc63599d383284cd52b
BLAKE2b-256 bed060ba29e7320fbe3ed146f4a9dedd3c8e7870164ba773baa42c914058029f

See more details on using hashes here.

File details

Details for the file reaf-1.1.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for reaf-1.1.0-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9fcedf5ad3d65910234ae30f2485a0141b48a71b93f183044daf9dd5d13a49af
MD5 11311cac5dce22476ce1f0c7185c79b6
BLAKE2b-256 bab174365cc6aac648434d2b3d4a543502a34e862a754ab8a8ce5c3781572b25

See more details on using hashes here.

File details

Details for the file reaf-1.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for reaf-1.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d85865e18f3a86769db047e99496f14d88a1f4894cc7634ae4f622689525d56a
MD5 856bccab31d0ab162a06d53109fd9715
BLAKE2b-256 25d6e92e703d7bf086e237c95a30aab4b85bdb00158d83cba6fc6e3d89bbdc59

See more details on using hashes here.

File details

Details for the file reaf-1.1.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for reaf-1.1.0-cp313-cp313-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6ca187c7287a9ec576c2b4b6c18ba252d1b5922dd75b6cb7e3d529849304265c
MD5 68d69d70d9d33fa1be8842081341fc25
BLAKE2b-256 2d07e60822c317211e737f19feaa3931d1d1ee43bca66aa46b001a4822059645

See more details on using hashes here.

File details

Details for the file reaf-1.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for reaf-1.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0893bd839d8db04e9f8d444c4ec529fec40f79697542c2ec20c179c8d43445ae
MD5 0211bdf93262aab5676132407bb8e166
BLAKE2b-256 46d26386d88cd68788fbfb9f0d9d8fbc6655711025b12a9f4670e69669a9a654

See more details on using hashes here.

File details

Details for the file reaf-1.1.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for reaf-1.1.0-cp312-cp312-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 276951eb779b4c573a024025ff0d3001722c45147fcea67bbd99f11f7d5bf675
MD5 e4c16eea025c3c20698b9a1ad625a9ec
BLAKE2b-256 95fa8794bc0c09c9600bec9be5631b96b5314f4bff239cc15febd718ddceda3d

See more details on using hashes here.

File details

Details for the file reaf-1.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for reaf-1.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ce4e88655eb87f2336cbbc32d3637164df2e3b3e5a28959dc7655a6af3c198bf
MD5 e21d61fa17fefcf6da7e29a0f8e8560b
BLAKE2b-256 5af5f320d48beb698fbd3dacbd7ae285bb28e8db22cfb037975b2a2fcafc780a

See more details on using hashes here.

File details

Details for the file reaf-1.1.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for reaf-1.1.0-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 135d3f3435e740e59bbfc82a9e6be4ba4cad0f60626b6f6dc3f2c3361b36d637
MD5 8fa9efb080b12f000ac058e6d30afd2b
BLAKE2b-256 2e04756fce0cdaafb49d11e95f91d1aba4cccb170f5ce4252b619c9d9ff202b3

See more details on using hashes here.

File details

Details for the file reaf-1.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for reaf-1.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 522ffd56159227e9c2071bd26bdbdc038e25ca20daf92b51dfe9e5a402e16462
MD5 d82e754192012c2a3143f039e6ef6c17
BLAKE2b-256 90dcfa124234cf605c2f176e1c488a383c81d04f6a4e1a6ac9693570bed22303

See more details on using hashes here.

File details

Details for the file reaf-1.1.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for reaf-1.1.0-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 14ca6675168bf0b158bd91b684f87cc5acf836b254144b6f26b0466e274b5f7b
MD5 6558a3d51113876e99b032df0c399c49
BLAKE2b-256 bb4bd18929dbf4abc6c240fb9191cb692b4f154d7358f7b1f090912781bff58c

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