Skip to main content

Gym-Ignition: A toolkit for developing OpenAI Gym environments simulated with Ignition Gazebo.

Project description

gym-ignition

WhatWhyHowSetupCitation

CI Docker Image Continuous Integration PyPI Release Codacy Badge License

Open In Colab

⚠️ Warning, Here be Dragons ⚠️

You just reached a very unstable corner.
Welcome, but mind your step.

What

Gym-Ignition provides the capability of creating reproducible robotics environments for reinforcement learning research.

The project is composed of the following components:

Component Description
ignition A set of classes to interface gympp with the new Ignition Gazebo simulator, part of the Ignition Robotics suite.
plugins Ignition Gazebo plugins.
gym_ignition Python package for creating OpenAI Gym environments. Environments can be implemented either in C++ using gympp or in Python using the SWIG binded classes of the ignition component.
gym_ignition_data SDF and URDF models and Gazebo worlds.
gympp An experimental C++ port of the OpenAI Gym interfaces, used to create pure C++ environments.

Why

Refer to the Citation for the extended rationale behind this project.

TL;DR

We designed Gym-Ignition driven by the following reasons:

  • Advances in RL research are pushed by the development of more complex environments, and vice versa.
  • There's no standard framework in the robotics community for creating simulated robotic environments.
  • Environments that can be transferred from simulation to reality with minimal changes do not exist.
  • Alternative solutions are not developed by roboticists for roboticist, and therefore they do not use familiar tools.
  • Existing robotics environments are typically difficult to adapt to run on different physics engines and different robotic platforms.
  • Only few solutions offer realistic rendering capabilities.

How

This project interfaces with the new generation of the Gazebo simulator, called Ignition Gazebo. It is part of the new Ignition Robotics suite developed by Open Robotics.

Ignition Robotics is currently under heavy development and is not yet stable. Though, it already offers enough functionalities for this project's aims:

  • Simulator-as-a-library
  • New modular architecture
  • C++ utilities developed with a robotic mindset
  • New abstractions of physics engines and rendering engines that exploit runtime plugins
  • Full support of DART and coming support of bullet3
  • Support of distributed simulations
  • Well maintained and packaged
  • Ignition Fuel database to download models and worlds

Features

At the time of writing, Gym-Ignition offers the following features:

  • Environments compatible with OpenAI Gym
  • Worlds and models are SDF descriptions
  • Reproducibility guarantees
  • Accelerated and multiprocess execution
  • Environments are a combination of three elements:
    • Task: the logic of the decision-making problem. It defines how to process the given action, how to calculate the reward, how to structure the observation, and how to reset the environment. Task objects are robot-independent and runtime-independent.
    • Robot: unified interface to access to robot resources. It is used to gather data and send commands to either simulated or real robot in a seamless way.
    • Runtime: implements the actual step of the environment. Simulated runtimes step the simulator, real-time runtimes deal with real-time execution constraints. A Task object can be executed by any runtime without any change.
  • Experimental support to create C++ environments

Setup

The setup instructions expect a Ubuntu distribution with at least Python 3.6.

The process is different whether you're an user that wants to create environments using Gym-Ignition or you are a developer that wants to edit the Python and C++ code. Common steps:

  1. Install SWIG with apt install swig

Are you a user?

  1. Install the Ignition Robotics suite following the official documentation
  2. Install Gym-Ignition with pip install gym-ignition (preferably in a virtual environment)
  3. Execute the following to export the required environment variables:
    # Worlds and models path
    data_path=$(python -c "import gym_ignition_data ; (gym_ignition_data.__path__[0])")
    export IGN_GAZEBO_RESOURCE_PATH=${data_path}:${data_path}/worlds
    
    # Gazebo plugins
    module_path=$(python -c "import gym_ignition ; print(gym_ignition.__path__[0])" | grep gym_ignition)
    export IGN_GAZEBO_SYSTEM_PLUGIN_PATH=${module_path}/plugins
    

After these steps, you should be able to execute the example launch_cartpole.py.

Are you a developer?

  1. Install all the Ignition Robotics suite except ignition-gazebo2 following the official documentation
  2. Install ign-gazebo from our temporary fork
  3. Clone this repository
  4. Build and install the CMake project
    mkdir build
    cd build
    cmake -DCMAKE_INSTALL_PREFIX=<installprefix> ..
    cmake --build .
    cmake --build . --target install
    
  5. Install the Python package in editable mode:
    pip3 install -e .
    
  6. Export the following environment variables:
    # Worlds and models path
    export IGN_GAZEBO_RESOURCE_PATH=<installprefix>/share/gympp/gazebo/worlds:<installprefix>/share/gympp/gazebo/models
    
    # Gazebo plugins
    export IGN_GAZEBO_SYSTEM_PLUGIN_PATH=<installprefix>/lib/gympp/plugins
    
    # C++ bindings
    export PYTHONPATH=<installprefix>/lib/python3.6/site-packages
    

After these steps, you should be able to execute the example launch_cartpole.py.

Citation

@inproceedings{ferigoGymIgnition2019,
  title = {Gym-Ignition: Reproducible Robotic Simulations for Reinforcement Learning},
  author = {Ferigo, Diego and Traversaro, Silvio and Pucci, Daniele},
  booktitle = {RSS 2019 Workshop on Closing the Reality Gap in Sim2real Transfer for Robotic Manipulation},
  year = {2019},
}

paper.pdf


Disclaimer: Gym-Ignition is an independent project and is not related by any means to OpenAI and Open Robotics.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

gym-ignition-1.0b0.tar.gz (123.1 kB view details)

Uploaded Source

Built Distribution

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

gym_ignition-1.0b0-cp36-cp36m-manylinux1_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.6m

File details

Details for the file gym-ignition-1.0b0.tar.gz.

File metadata

  • Download URL: gym-ignition-1.0b0.tar.gz
  • Upload date:
  • Size: 123.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

File hashes

Hashes for gym-ignition-1.0b0.tar.gz
Algorithm Hash digest
SHA256 41fbdb8ad5b7edbf96fd54b8daa898ad2207b745dac1962690c558c54699b2d7
MD5 290a9ce34e4ae5dd857746de027c8d0c
BLAKE2b-256 8d6e00a2ce2bc0a6c27d14c5cc2e92817e2bd93da3e3a2f607b973966165ad0b

See more details on using hashes here.

File details

Details for the file gym_ignition-1.0b0-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: gym_ignition-1.0b0-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

File hashes

Hashes for gym_ignition-1.0b0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 627376818aa0b0e45eb15c8b37856522cb0fdb5c91ed802de9e2c08d731e51fd
MD5 e77fadce97e51300641400c123afd32a
BLAKE2b-256 5a349648f6719f456436b69e429f266396200a904b7e87f3c7959ddb66bd38a7

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