nopenpilot/tools
Ewout ter Hoeven 332f568a82
Pyupgrade 3.6: Update syntax with Python 3.6+ features (#23305)
Updated Python code with Python 3.6+ features:
- utf-8 encoding is now the default (PEP 3120)
- Replace list comprehensions by Generator Expressions (PEP 289)
- Replace yield loop by yield from (PEP 380)
- Remove the (object) subclass when defining a class
- Replace the IOError alias by OSError (PEP 3151)
- Define sets with curly braces {} instead of set()
- Remove "r" parameter from open function, which is default

Co-Authored-By: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-Authored-By: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>

Co-authored-by: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-authored-by: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>
2021-12-24 11:18:39 -08:00
..
joystick Python: Replace more lists with generators (#23116) 2021-12-03 22:57:19 -08:00
lib Pyupgrade 3.6: Update syntax with Python 3.6+ features (#23305) 2021-12-24 11:18:39 -08:00
plotjuggler juggle: add demo flag and improve README 2021-11-28 14:19:49 -08:00
replay Convert format strings strings to f-strings (#23241) 2021-12-16 14:58:17 +01:00
scripts Convert format strings strings to f-strings (#23241) 2021-12-16 14:58:17 +01:00
serial faster connect 2021-09-22 12:31:48 -07:00
sim Pyupgrade 3.6: Update syntax with Python 3.6+ features (#23305) 2021-12-24 11:18:39 -08:00
ssh update ssh readme for c3 2021-08-07 11:36:34 -07:00
webcam update to python 3.8.5 (#20217) 2021-03-09 13:38:22 -08:00
zookeeper cleanup unused pip packages (#22947) 2021-11-17 16:23:03 +01:00
CTF.md Sphinx docs generation (#22697) 2021-10-28 15:14:37 +02:00
README.md link to ctf in tools readme 2021-11-19 21:16:49 -08:00
__init__.py merge in tools 2020-01-17 10:07:22 -08:00
mac_setup.sh macOS: Fix missing pip command issue. (#22924) 2021-11-17 11:23:05 +01:00
openpilot_build.sh build script that uses docker container (#1944) 2020-08-30 17:02:36 -07:00
openpilot_env.sh macOS: Fix missing pip command issue. (#22924) 2021-11-17 11:23:05 +01:00
ubuntu_setup.sh ubuntu_setup.sh: add option to continue on unsupported os 2021-11-16 14:30:51 -08:00

README.md

openpilot tools

CTF

Learn about the openpilot ecosystem and tools by playing our CTF.

SSH

Connect to your comma device using SSH

System requirements

openpilot is developed and tested on Ubuntu 20.04, which is the primary development target aside from the supported embdedded hardware. 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.

Setup your PC

  1. Clone openpilot into your home directory:
cd ~
git clone --recurse-submodules https://github.com/commaai/openpilot.git
  1. Run the setup script:

Ubuntu 20.04 LTS:

openpilot/tools/ubuntu_setup.sh

MacOS:

openpilot/tools/mac_setup.sh
  1. Ensure you have a working OpenCL runtime:

You can verify your OpenCL installation with the clinfo command.

If you do not have any working platforms, you can download drivers from your GPU vendor's site. On Ubuntu you can just install one of the packages returned by apt search opencl-icd.

  1. Activate the Python environment:

Execute the following command in root openpilot directory:

pipenv shell

Your shell prompt should change to something similar to (openpilot) user@machine:~/openpilot$ .

  1. Build openpilot by running SCons in the root of the openpilot directory
cd openpilot && scons -j$(nproc)
  1. Try out some tools!

NOTE: you can always run update_requirements.sh to pull in new python dependencies.

Windows

Neither openpilot nor any of the tools are developed or tested on Windows, but the Windows Subsystem for Linux (WSL) should get Windows users a similiar experience to Ubuntu. WSL 2 specifically has been reported by several users to be a seamless experience.

Follow these instructions 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.

GUI applications do not work with WSL out of the box. You will have to either upgrade your system to Windows 11 or set up an Xorg server.

Tools

Plot logs

Easily plot openpilot logs with PlotJuggler, an open source tool for visualizing time series data.

Run openpilot in a simulator

Test openpilots performance in a simulated environment. The CARLA simulator allows you to set a variety of features like:

  • Weather
  • Environment physics
  • Cars
  • Traffic and pedestrians

Replay a drive

Review video and log data from routes and stream CAN messages to your device.

Debug car controls

Use a joystick to control your car.

Welcomed contributions

  • Documentation: code comments, better tutorials, etc
  • Support for platforms other than Ubuntu 20.04
  • Performance improvements
  • More tools: anything that you think might be helpful to others.

Imgur