Skip to content

This is the repository of the F1TENTH Gym environment.

License

Notifications You must be signed in to change notification settings

WE-Autopilot/f1tenth_gym

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python 3.8 3.9 Docker

The F1TENTH Gym environment

This is the repository of the F1TENTH Gym environment.

You can find the documentation of the environment here.

General Setup

Make sure you have Git installed through here

Once you have downloaded Git, you should be able to clone the repository onto your PC.

git clone https://github.com/WE-Autopilot/f1tenth_gym.git

Windows Setup

We recommend installing the simulation inside a virtual environment to not affect any of your other Python installations.

You must make sure your execution policy allows for scripts to run automatically.

IMPORTANT: Run Windows PowerShell as Administrator, otherwise the following two commands will not work.

If the command below outputs anything other than RemoteSigned, Run the next command.

Get-ExecutionPolicy                                                                        
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

Follow with the steps on the screen, you might have to type in "Y" to accept the changes.

Next, you must download pyenv. To do so, run the following command after RESTARTING PowerShell.

Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"

Then, you must download the following specific version of python through pyenv.

pyenv install 3.10.11

Navigate to your File Explorer to find the location of where pyenv is installed. It should be in a similar directory as below:

%USERPROFILE%\.pyenv\pyenv-win\versions\

For Example:

C:\Users\<YourUsername>\.pyenv\pyenv-win\versions\3.10.11

Now, we get to the good stuff...

Go to where you cloned your repository and navigate to the root directory of your workspace and open a terminal.

Run the following command within your directory to create a virtual environment with the previously installed Python version.

<Your_Path_Without_Quotes> -m venv .venv

#For Example:

C:\Users\<YourUsername>\.pyenv\pyenv-win\versions\3.10.11\python.exe -m venv .venv

Then, install all the dependencies by running the following:

pip install -e .
# This command will take a while, so don't ear, just let it run!

You are almost done!!!

Change Directory to the example Python file, and run that file:

cd .\examples\
python .\waypoint_follow.py

It will take a second to run, once it does you should be all good!

MacOS/Linux Setup

We recommend installing the simulation inside a virtual environment to not affect any of your other Python installations.

You can install the environment any way you like. Instructions to do it with virtualenv are below.

Make sure to use python version 3.10. We've tested 3.10.11 and 3.10.15 and both have worked.

virtualenv gym_env
source gym_env/bin/activate

Then clone the repo

git clone https://github.com/WE-Autopilot/f1tenth_gym.git
cd f1tenth_gym

Set some versions by hand to avoid magic, tracebackless errors.

pip install "pip<24.1"
pip install "setuptools==65.5.0"
pip install "wheel<0.40.0"

Then run the gym setup

pip install -e .

You can run a quick waypoint follow example by:

cd examples
python waypoint_follow.py

It will take a second to run, once it does you should be all good!

Known issues

You might see an error similar to

f110-gym 0.2.1 requires pyglet<1.5, but you have pyglet 1.5.20 which is incompatible.

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

Questions?

Contact one of the execs or your leads on Discord and ask any questions and we will help ASAP

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.9%
  • Dockerfile 1.1%