F1TENTH Gym ROS ‐ Install Guide - CPP-F1TENTH-SDP/Labs GitHub Wiki
NOTE: Some code blocks contain multiple lines with appropriate spacing. This allows you to copy and paste in PowerShell/Terminal and run multiple commands at once. To paste, RIGHT click in PowerShell/Terminal.
For those on Linux, refer to the official f1tenth_gym_ros guide. https://github.com/f1tenth/f1tenth_gym_ros
Download:
Video Guide: https://youtu.be/AbwStv7PQ1A
This method allows the simulation to utilize an integrated or NVIDIA GPU.
-
Download and install Docker Desktop before installing WSL.
-
Install WSL from the Microsoft Store.
OR
Open PowerShell/Terminal and run:
wsl --install
The above command will install both WSL and Ubuntu. Use the Microsoft Store to only install WSL.
-
Install Ubuntu 20.04 using the following command:
wsl.exe --install Ubuntu-20.04
-
wsl --set-default Ubuntu-20.04 2
Check if Ubuntu-20.04 is default (star before Ubuntu-20.04) using:
wsl -l -v
If Ubuntu-20.04 is "Stopped", restart Docker Desktop.
-
Start Docker Desktop (if it isn't already), open PowerShell/Terminal and run:
git clone https://github.com/f1tenth/f1tenth_gym_ros
cd f1tenth_gym_ros
docker build -t f1tenth_gym_ros -f Dockerfile .
-
Open another window/tab of PowerShell/Terminal and run:
bash
sudo apt-get install python3-venv
⚠️ If python3-venv is not being installed try:sudo apt-get update
sudo apt-get install libpython3-dev
sudo apt-get install python3-venv
After python3-venv is installed:
mkdir -p ~/rocker_venv python3 -m venv ~/rocker_venv cd ~/rocker_venv . ~/rocker_venv/bin/activate pip install wheel pip install git+https://github.com/osrf/rocker.git
The installation is now complete.
-
Have Docker Desktop running:
bash
. ~/rocker_venv/bin/activate
Replace
<USERNAME>
with your Windows username. You can find this by opening PowerShell/Terminal.iGPU:
rocker --x11 --volume .:/sim_ws/src/f1tenth_gym_ros/Users/<USERNAME>/f1tenth_gym_ros -- f1tenth_gym_ros
NVIDIA:
rocker --nvidia --x11 --volume .:/sim_ws/src/f1tenth_gym_ros/Users/<USERNAME>/f1tenth_gym_ros -- f1tenth_gym_ros
The rocker command is based on the assumption that the files from
git clone https://github.com/f1tenth/f1tenth_gym_ros
, are inC:\Users\<USERNAME>\f1tenth_gym_ros
. -
source /opt/ros/foxy/setup.bash source install/local_setup.bash ros2 launch f1tenth_gym_ros gym_bridge_launch.py
It is recommended to save a .txt or VSCode file with your personal username. This will allow you to copy and paste the commands to launch the simulation.
Here is an example:
Fastest and easiest install. Access the simulation from your web browser.
- Open PowerShell/Terminal and run:
git clone https://github.com/f1tenth/f1tenth_gym_ros
-
cd f1tenth_gym_ros
- Have Docker Desktop running:
docker compose up
- Have Docker Desktop running:
docker exec -it f1tenth_gym_ros-sim-1 /bin/bash
-
source /opt/ros/foxy/setup.bash source install/local_setup.bash ros2 launch f1tenth_gym_ros gym_bridge_launch.py
- Go to: http://localhost:8080/vnc.html