setup README: Native on 20.04, WSL on windows, otherwise devcontainer (#29928)

* Main README: Webcam needs work, don't mention

* Update README.md

* Link to VSCode guide

* Update README.md

* Fix formatting

* Update README.md

* little more

---------

Co-authored-by: Kacper Rączy <gfw.kra@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
pull/29967/head
Harald Schäfer 2 years ago committed by GitHub
parent 8aad9758cf
commit 4b55d90af9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 40
      tools/README.md

@ -2,55 +2,55 @@
## System Requirements ## System Requirements
openpilot is developed and tested on **Ubuntu 20.04**, which is the primary development target aside from the [supported embedded hardware](https://github.com/commaai/openpilot#running-on-a-dedicated-device-in-a-car). We also have a CI test to verify that openpilot builds on macOS, but the tools are untested. For the best experience, stick to Ubuntu 20.04, otherwise openpilot and the tools should work with minimal to no modifications on macOS and other Linux systems. openpilot is developed and tested on **Ubuntu 20.04**, which is the primary development target aside from the [supported embedded hardware](https://github.com/commaai/openpilot#running-on-a-dedicated-device-in-a-car).
## Setup your PC Running natively on any other system is not recommended and will require modifications. On Windows you can use WSL, and on macOS or incompatible Linux systems, it is recommended to use the dev containers.
First, clone openpilot: ## Native setup on Ubuntu 20.04
``` bash
cd ~ **1. Clone openpilot**
git clone --recurse-submodules https://github.com/commaai/openpilot.git
# or do a partial clone instead for a faster clone and smaller repo size Either do a partial clone for faster download:
``` bash
git clone --filter=blob:none --recurse-submodules --also-filter-submodules https://github.com/commaai/openpilot.git git clone --filter=blob:none --recurse-submodules --also-filter-submodules https://github.com/commaai/openpilot.git
```
cd openpilot or do a full clone:
``` bash
git clone --recurse-submodules https://github.com/commaai/openpilot.git
``` ```
Then, run the setup script: **2. Run the setup script**
``` bash ``` bash
# for Ubuntu 20.04 LTS cd openpilot
tools/ubuntu_setup.sh tools/ubuntu_setup.sh
# for macOS
tools/mac_setup.sh
``` ```
Activate a shell with the Python dependencies installed: Activate a shell with the Python dependencies installed:
``` bash ``` bash
cd openpilot && poetry shell poetry shell
``` ```
Build openpilot with this command: **3. Build openpilot**
``` bash ``` bash
scons -u -j$(nproc) scons -u -j$(nproc)
``` ```
### Dev Container ## Dev Container on any Linux or macOS
openpilot supports [Dev Containers](https://containers.dev/). Dev containers provide customizable and consistent development environment wrapped inside a container. This means you can develop in a designated environment matching our primary development target, regardless of your local setup. openpilot supports [Dev Containers](https://containers.dev/). Dev containers provide customizable and consistent development environment wrapped inside a container. This means you can develop in a designated environment matching our primary development target, regardless of your local setup.
Dev containers are supported in [multiple editors and IDEs](https://containers.dev/supporting), including [Visual Studio Code](https://code.visualstudio.com/docs/devcontainers/containers). Dev containers are supported in [multiple editors and IDEs](https://containers.dev/supporting), including Visual Studio Code. Use the following [guide](https://code.visualstudio.com/docs/devcontainers/containers) to start using them with VSCode.
#### X11 forwarding on macOS #### X11 forwarding on macOS
GUI apps like `ui` or `cabana` can also run inside the container by leveraging X11 forwarding. To make use of it on macOS, additional configuration steps must be taken. Follow [these](https://gist.github.com/sorny/969fe55d85c9b0035b0109a31cbcb088) steps to setup X11 forwarding on macOS. GUI apps like `ui` or `cabana` can also run inside the container by leveraging X11 forwarding. To make use of it on macOS, additional configuration steps must be taken. Follow [these](https://gist.github.com/sorny/969fe55d85c9b0035b0109a31cbcb088) steps to setup X11 forwarding on macOS.
### Windows ## WSL on Windows
Neither openpilot nor any of the tools are developed or tested on Windows, but the [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/about) should provide a similar experience to native Ubuntu. [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/compare-versions) specifically has been reported by several users to be a seamless experience. [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/about) should provide a similar experience to native Ubuntu. [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/compare-versions) specifically has been reported by several users to be a seamless experience.
Follow [these instructions](https://docs.microsoft.com/en-us/windows/wsl/install) to setup the WSL and install the `Ubuntu-20.04` distribution. Once your Ubuntu WSL environment is setup, follow the Linux setup instructions to finish setting up your environment. See [these instructions](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps) for running GUI apps. Follow [these instructions](https://docs.microsoft.com/en-us/windows/wsl/install) to setup the WSL and install the `Ubuntu-20.04` distribution. Once your Ubuntu WSL environment is setup, follow the Linux setup instructions to finish setting up your environment. See [these instructions](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps) for running GUI apps.

Loading…
Cancel
Save