Skip to content

Getting Started

Kenneth L edited this page Jun 3, 2024 · 12 revisions

Background

  • Setting up ROS to run from scratch is not simple, because:
    • It is hard to run on Windows. Linux is recommended.
    • Specific ROS versions are tied to certain versions of Ubuntu. So if you install the wrong version of Ubuntu you will need to do a lot of work just to get it to run.
  • Instead, for our project we use Docker, which allows you to run a containerised Ubuntu (like a VM but with native performance) that works nicely anywhere
  • Your host OS (the computer that runs the Docker container) still needs to be Linux in order for you to access USB devices from the container, which your task requires.

Installation Instruction - Dev Environment

  • Install Ubuntu or Linux Mint on your computer, not through WSL2, any version will do

    • Remember to run sudo apt-get update to make your OS know what the newest packages are
  • Install VSCode

    sudo snap install code --classic
    
  • Install the Dev Containers extension in VSCode

  • Install Docker. You might need to install curl using sudo apt install curl.

    curl -fsSL https://get.docker.com -o get-docker.sh
    sudo sh ./get-docker.sh
  • Add your user to the docker group

    sudo usermod -aG docker $USER
    

    Restart or log out and log back in

  • Install Github Desktop (my preference and makes life easier IMO)

    sudo wget https://github.com/shiftkey/desktop/releases/download/release-3.1.1-linux1/GitHubDesktop-linux-3.1.1-linux1.deb
    sudo gdebi GitHubDesktop-linux-3.1.1-linux1.deb
  • Clone the gra (Gryphon Racing AI) repository using GitHub Desktop

  • Open the repository in VSCode

    • If you have done everything correctly up to this point, a popup should appear in VSCode asking if you want to reopen the repository in a container. Click yes, and it will start setting up the container automatically. It will probably take around 20 minutes, depending on your hardware specs. I recommend you click show log in the popup to see what’s going on in the background in case things go wrong.
  • If you got to this point, congratulations! You can start developing your package.

  • Continue to the next section if Linux is NOT installed in Virtual Machine.

Enabling GPU Acceleration

NOTE: This will not work if Linux is installed in a Virtual Machine.

Enabling GPU acceleration in Docker allows for parallel processing capabilities, which helps with object recognition and point cloud processing.

  • Verify NVIDIA Drivers: Ensure the NVIDIA drivers for your GPU are installed by running the following command in the terminal:

    nvidia-smi
    

    If the command prints information about your GPU, you have the drivers installed.

  • Add NVIDIA Package Repositories: Add the NVIDIA package repositories to get the latest NVIDIA Docker support.

    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
    

    This command identifies your Linux distribution and adds the correct NVIDIA repository.

  • Install the NVIDIA Docker Toolkit: Finally, install the NVIDIA Docker toolkit with the following command:

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

Clone this wiki locally