Skip to content

This is the repository of the F1TENTH Gym environment.

License

Notifications You must be signed in to change notification settings

kohonda/f1tenth_gym

 
 

Repository files navigation

The F1TENTH Gym environment

This is the repository of the F1TENTH Gym environment.

This project is still under heavy developement.

You can find the documentation of the environment here.

Tested Native Environment

  • Ubuntu Focal 20.04 (LTS)
  • with only CPU

Quickstart

Docker Installation

Install Docker

Installation guide

# Install from get.docker.com
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo groupadd docker
sudo usermod -aG docker $USER

Setup GPU for Docker

Installation guide

curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
  && curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
    sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
    sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list 

sudo apt-get update

sudo apt-get install -y nvidia-container-toolkit nvidia-container-runtime

sudo nvidia-ctk runtime configure --runtime=docker

sudo systemctl restart docker

Setup with Docker

NOTE: Currently, tested on Ubuntu 20.04 with CPU-only.

# build container (without GPU support)
make build-cpu
# or build container (with GPU support)
# make build-gpu

Open remote container via Vscode (Recommend)

  1. Open the folder using vscode
  2. Ctrl+P and select 'devcontainer rebuild and reopen in container' Then, you can skip the following commands
# [Optional] Run container via terminal (without GPU support)
make bash-cpu
# Or Run container via terminal (with GPU support)
# make bash-gpu

Then you can run a quick waypoint follow example by:

cd examples
python3 waypoint_follow.py

Known issues

  • Library support issues on Windows. You must use Python 3.8 as of 10-2021
  • On MacOS Big Sur and above, when rendering is turned on, you might encounter the error:
ImportError: Can't find framework /System/Library/Frameworks/OpenGL.framework.

You can fix the error by installing a newer version of pyglet:

$ pip3 install pyglet==1.5.11

And you might see an error similar to

gym 0.17.3 requires pyglet<=1.5.0,>=1.4.0, but you'll have pyglet 1.5.11 which is incompatible.

which could be ignored. The environment should still work without error.

Citing

If you find this Gym environment useful, please consider citing:

@inproceedings{okelly2020f1tenth,
  title={F1TENTH: An Open-source Evaluation Environment for Continuous Control and Reinforcement Learning},
  author={O’Kelly, Matthew and Zheng, Hongrui and Karthik, Dhruv and Mangharam, Rahul},
  booktitle={NeurIPS 2019 Competition and Demonstration Track},
  pages={77--89},
  year={2020},
  organization={PMLR}
}

About

This is the repository of the F1TENTH Gym environment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.3%
  • Dockerfile 1.3%
  • Makefile 0.4%