Skip to main content

a OpenAI gym environment for high performance autonomous racing

Project description

PyPI PyPI - Python Version GitHub

Learn-to-Race

Learn-to-Race is an OpenAI gym compliant, multimodal control environment where agents learn how to race. Unlike many simplistic learning environments, ours is built around Arrival’s high-fidelity racing simulator featuring full software-in-the-loop (SIL), and even hardware-in-the-loop (HIL), simulation capabilities. This simulator has played a key role in bringing autonomous racing technology to real life in the Roborace series, the world’s first extreme competition of teams developing self-driving AI.


missing

An overview of the Learn-to-Race framework


Documentation

Please visit our official docs for a comprehensive guide on getting started with the environment. Happy racing!

Learn-to-Race Task

While learning-based agents continue to demonstrate superhuman performance in many areas, we believe that they still lack in terms of generalization abilities and often require too many interactions. In summary, agents will have the ability to learn on training racetracks, but will be evaluated on their performance on an unseen evaluation track. However, the evaluation track is not truly unseen. Much like a Formula-1 driver, we will let agents interact with the new track for 60 minutes during a pre-evaluation stage before true evaluation.

Baseline Agents

We provide multiple baseline agents to demonstrate how to use Learn-to-Race including both classical and learning-based controllers. The first is a RandomActionAgent to show basic functionality. We also include a Soft Actor-Critic agent, tabula rasa, trained for 1000 epsiodes. On the Las Vegas track, it is able to consistently complete laps in under 2 minutes each using only visual features from the virtual camera as input.


missing

Episode 1

missing

Episode 100

missing

Episode 1000


Customizable Sensor Configurations

One of the key features of this environment is the ability to create arbitrary configurations of vehicle sensors. This provides users a rich sandbox for multimodal, learning based approaches. The following sensors are supported and can be placed, if applicable, at any location relative to the vehicle:

  • RGB cameras
  • Depth cameras
  • Ground truth segmentation cameras
  • Fisheye cameras
  • Ray trace LiDARs
  • Depth 2D LiDARs
  • Radars

Additionally, these sensors are parameterized and can be customized further; for example, cameras have modifiable image size, field-of-view, and exposure. We provide a sample configuration below which has front, birdseye, and side facing cameras both in RGB mode and with ground truth segmentation.

Left Facing Front Facing Right Facing Birdseye
LeftRGB FrontRGB RightRGB Front
Left, Segmented Front, Segmented Right, Segmented Birdseye, Segmented

Please visit our documentation for more information about sensor customization.

Requirements

Python: We use Learn-to-Race with Python 3.6 or 3.7.

Graphics Hardware: An Nvidia graphics card & associated drives is required. An Nvidia 970 GTX graphics card is minimally sufficient to simply run the simulator, but a better card is recommended.

Docker: Commonly, the racing simulator runs in a Docker container.

Container GPU Access: If running the simulator in a container, the container needs access to the GPU, so nvidia-container-runtime is also required.

Installation

Due to the container GPU access requirement, this installation assumes a Linux operating system. If you do not have a Linux OS, we recommend running Learn-to-Race on a public cloud instance that has a sufficient GPU.

  1. Request access to the Racing simulator. We recommmend running the simulator as a Python subprocess which simply requires that you specify the path of the simulator in the env_kwargs.controller_kwargs.sim_path of your configuration file. Alternatively, you can run the simulator as a Docker container by setting env_kwargs.controller_kwargs.start_container to True. If you prefer the latter, you can load the docker image as follows:
$ docker load < arrival-sim-image.tar.gz
  1. Download the source code from this repository and install the package requirements. We recommend using a virtual environment:
$ pip install virtualenv
$ virtualenv venv                           # create new virtual environment
$ source venv/bin/activate                  # activate the environment
(venv) $ pip install -r requirements.txt 

Research

Please cite this work if you use L2R as a part of your research.

@misc{herman2021learntorace,
      title={Learn-to-Race: A Multimodal Control Environment for Autonomous Racing}, 
      author={James Herman and Jonathan Francis and Siddha Ganju and Bingqing Chen and Anirudh Koul and Abhinav Gupta and Alexey Skabelkin and Ivan Zhukov and Andrey Gostev and Max Kumskoy and Eric Nyberg},
      year={2021},
      eprint={2103.11575},
      archivePrefix={arXiv},
      primaryClass={cs.RO}
}

Project details


Download files

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

Source Distribution

l2r-0.0.2.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

l2r-0.0.2-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file l2r-0.0.2.tar.gz.

File metadata

  • Download URL: l2r-0.0.2.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for l2r-0.0.2.tar.gz
Algorithm Hash digest
SHA256 cd80c56a81b5e18e01de4c4a7176ae564ba214c2974c76fb321929d12df66600
MD5 7d93f658f0247f6f9a0ade45997ae58c
BLAKE2b-256 e38890f4aac4544e42c0a227d1b86cfbf5f23e3e090a5e2a399bdd279d8683fe

See more details on using hashes here.

File details

Details for the file l2r-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: l2r-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for l2r-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 29681a70d5b2c9d9ae1f06e8b78f4fe49ed890c393ae0c9855c8a41ca99f969c
MD5 7dafa072fea4fd7536e3317979cc60a4
BLAKE2b-256 59afa36139ae2a3f192fe62d9ba22432792b340d47674cf2d0816c7b8431b592

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page