openpilot tools and the following setup steps are developed and tested on Ubuntu 20.04, MacOS 10.14.2 and, Python 3.8.2.
openpilot is developed and tested on **Ubuntu 20.04**, which is the primary development target aside from the [supported embdedded hardware](https://github.com/commaai/openpilot#supported-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
Setup
============
============
1. Run `ubuntu_setup.sh` or `mac_setup.sh`, and make sure that everything completed correctly
1. Clone openpilot into home directory:
2. Compile openpilot by running ```scons``` in the openpilot directory
or alternatively run ```./openpilot_build.sh``` (uses a pre-configured docker container)
3. Try out some tools!
Tool examples
============
Replay driving data
-------------
**Hardware needed**: none
`unlogger.py` replays data collected with [dashcam](https://github.com/commaai/openpilot/tree/dashcam) or [openpilot](https://github.com/commaai/openpilot).
Use the panda's OBD-II port to connect with your car and a usb cable to connect the panda to your pc.
Also, connect a joystick to your pc.
`joystickd.py` runs a deamon that reads inputs from a joystick and publishes them over zmq.
Tools
`boardd` sends the CAN messages from your pc to the panda.
============
`debug_controls` is a mocked version of `controlsd.py` and uses input from a joystick to send controls to your car.
Make sure the conditions are met in the panda to allow controls (e.g. cruise control engaged). You can also make a modification to the panda code to always allow controls.
[Plot logs](plotjuggler)
-------------
Usage:
Easily plot openpilot logs with [PlotJuggler](https://github.com/facontidavide/PlotJuggler), an open source tool for visualizing time series data.
```
python carcontrols/joystickd.py
# In another terminal:
BASEDIR=$(pwd) selfdrive/boardd/boardd
# In another terminal:
[Run openpilot in a simulator](sim)
python carcontrols/debug_controls.py
-------------
```
Test openpilots performance in a simulated environment. The [CARLA simulator](https://github.com/carla-simulator/carla) allows you to set a variety of features like:

* Weather
* Environment physics
* Cars
* Traffic and pedestrians
Stream replayed CAN messages to EON
[Replay a drive](replay)
-------------
-------------
**Hardware needed**: 2 x [panda](panda.comma.ai), [debug board](https://comma.ai/shop/products/panda-debug-board/), [EON](https://comma.ai/shop/products/eon-gold-dashcam-devkit/).
Review video and log data from routes and stream CAN messages to your device.
It is possible to replay CAN messages as they were recorded and forward them to a EON.
Connect 2 pandas to the debug board. A panda connects to the PC, the other panda connects to the EON.
Usage:
[Debug car controls](carcontrols)
```
-------------
# With MOCK=1 boardd will read logged can messages from a replay and send them to the panda.
* Support for other platforms other than Ubuntu 20.04.
* Support for other platforms other than Ubuntu 20.04.
* Performance improvements: the tools have been developed on high-performance workstations (12+ logical cores with 32+ GB of RAM), so they are not optimized for running efficiently. For example, `ui.py` might not be able to run real-time on most PCs.
* Performance improvements: the tools have been developed on high-performance workstations (12+ logical cores with 32+ GB of RAM), so they are not optimized for running efficiently. For example, `ui.py` might not be able to run real-time on most PCs.
* More tools: anything that you think might be helpful to others.
* More tools: anything that you think might be helpful to others.
Use the panda's OBD-II port to connect with your car and a usb cable to connect the panda to your pc.
Also, connect a joystick to your pc.
`joystickd.py` runs a deamon that reads inputs from a joystick and publishes them over zmq.
`boardd` sends the CAN messages from your pc to the panda.
`debug_controls` is a mocked version of `controlsd.py` and uses input from a joystick to send controls to your car.
Make sure the conditions are met in the panda to allow controls (e.g. cruise control engaged). You can also make a modification to the panda code to always allow controls.
@ -30,6 +30,14 @@ You can control openpilot driving in the simulation with the following keys
To see the options for changing the environment, such as the town, spawn point or precipitation, you can run `./start_openpilot_docker.sh --help`.
To see the options for changing the environment, such as the town, spawn point or precipitation, you can run `./start_openpilot_docker.sh --help`.
This will print the help output inside the docker container. You need to exit the docker container before running `./start_openpilot_docker.sh` again.
This will print the help output inside the docker container. You need to exit the docker container before running `./start_openpilot_docker.sh` again.
## Performance
openpilot doesn't have any extreme hardware requirements, however CARLA is very resource-intensive and may not run smoothly on your system. For this case, we have a low quality mode you can activate by running:
```
./start_openpilot_docker.sh --low_quality
```
You can also check out the [CARLA python documentation](https://carla.readthedocs.io/en/latest/python_api/) to find more parameters to tune that might increase performance on your system
## Further Reading
## Further Reading
The following resources contain more details and troubleshooting tips.
The following resources contain more details and troubleshooting tips.
* [CARLA on the openpilot wiki](https://github.com/commaai/openpilot/wiki/CARLA)
* [CARLA on the openpilot wiki](https://github.com/commaai/openpilot/wiki/CARLA)