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.

Linux

For those on Linux, refer to the official f1tenth_gym_ros guide. https://github.com/f1tenth/f1tenth_gym_ros

Prerequisites for Windows 10/11

Download:

iGPU/NVIDIA Install (Recommended)

This method allows the simulation to utilize an integrated or NVIDIA GPU.

  1. Download and install Docker Desktop before installing WSL.

  2. 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.

  3. Install Ubuntu 20.04 using the following command:

    wsl.exe --install Ubuntu-20.04
    
  4. 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.

    image

  5. 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 .
    
  6. 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.

iGPU/NVIDIA Launch

  1. 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 in C:\Users\<USERNAME>\f1tenth_gym_ros.

  2. source /opt/ros/foxy/setup.bash
    source install/local_setup.bash
    ros2 launch f1tenth_gym_ros gym_bridge_launch.py
    
    

Launch Recommendation

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:

image

noVNC Install (Fast)

Fastest and easiest install. Access the simulation from your web browser.

  1. Open PowerShell/Terminal and run:
    git clone https://github.com/f1tenth/f1tenth_gym_ros
    
  2. cd f1tenth_gym_ros
    
  3. Have Docker Desktop running:
    docker compose up
    

noVNC Launch

  1. Have Docker Desktop running:
    docker exec -it f1tenth_gym_ros-sim-1 /bin/bash
    
  2. source /opt/ros/foxy/setup.bash
    source install/local_setup.bash
    ros2 launch f1tenth_gym_ros gym_bridge_launch.py
    
    
  3. Go to: http://localhost:8080/vnc.html
⚠️ **GitHub.com Fallback** ⚠️