nopenpilot/tools/README.md

88 lines
2.5 KiB
Markdown
Raw Normal View History

openpilot tools
2020-01-17 11:07:22 -07:00
============
SSH
============
Connect to your comma device using [SSH](ssh/README.md)
System requirements
2020-01-17 11:07:22 -07:00
============
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#running-on-pc). 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.
2020-01-17 11:07:22 -07:00
Setup your PC
2020-01-17 11:07:22 -07:00
============
2021-06-16 23:23:12 -06:00
1. Clone openpilot into your home directory:
``` bash
cd ~
2021-06-16 23:23:12 -06:00
git clone --recurse-submodules https://github.com/commaai/openpilot.git
```
2021-06-16 23:23:12 -06:00
2. Run the setup script:
2020-01-17 11:07:22 -07:00
Ubuntu:
2021-06-16 23:23:12 -06:00
``` bash
openpilot/tools/ubuntu_setup.sh
2020-01-17 11:07:22 -07:00
```
MacOS:
2021-06-16 23:23:12 -06:00
``` bash
openpilot/tools/mac_setup.sh
2020-02-28 21:01:55 -07:00
```
2020-01-17 11:07:22 -07:00
2021-06-16 23:23:12 -06:00
3. Build openpilot by running SCons in the root of the openpilot directory
``` bash
cd openpilot && scons -j$(nproc)
```
2020-01-17 11:07:22 -07:00
4. Try out some tools!
2020-01-17 11:07:22 -07:00
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 get Windows users a similiar experience to Ubuntu.
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.
2020-01-17 11:07:22 -07:00
Tools
============
2020-01-17 11:07:22 -07:00
[Plot logs](plotjuggler)
-------------
2020-04-27 11:49:40 -06:00
Easily plot openpilot logs with [PlotJuggler](https://github.com/facontidavide/PlotJuggler), an open source tool for visualizing time series data.
2020-01-17 11:07:22 -07:00
[Run openpilot in a simulator](sim)
-------------
2020-01-17 11:07:22 -07:00
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
2020-01-17 11:07:22 -07:00
2021-06-17 00:56:35 -06:00
[Replay a drive](replay)
2020-01-17 11:07:22 -07:00
-------------
Review video and log data from routes and stream CAN messages to your device.
2020-01-17 11:07:22 -07:00
Fixup joystick (#21129) * some common changes * rename to joystick * add alert and update controlsd to work with joystick * update joystickd * Update Joystick readme * assume we have inputs * only send gb or steer when engaged_toggle is true * Update instructions * fix --ip * Easier to understand at a glance * much better * -a * receive events and send msg in same loop * always import * Update selfdrive/controls/lib/events.py Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> * Update selfdrive/controls/lib/events.py Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> * combine logic and clean up * use argparse * outdated, and use normal class * rm * bit of a refactor * refactor part 2 / 3 * much better (3 / 3) * Simplify * bump cereal and update readme * capitalize * Update tools/joystick/joystickd.py Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> * Update tools/joystick/joystickd.py Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> * make joystick abstraction class clearer * use interp, clearer without comments * no need to use apply_deadzone * more explicit * define btns and axes once * split function by use_keyboard again, but simpler * we can use handle_button as a reset function * need to flip sign * remove * invert axes map for kb, easier to read the button mapping * apply changes from review * new lateral log for debug mode * bump * add saturated * static alert * joystick_mode * conditionally subscribe * Update selfdrive/controls/controlsd.py Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> * move params instantiation * Spoof active and enabled * Only allow car to engage * no startup alert if joystick * Update controlsd.py * Should be orange not enabled, green enabled * no more button states * should work * blue * submaster conflates, so only send when we have an update * final change * remove msg * clean up a bit sort of clean up clean up a bit remove msg * this was right * Apply suggestions from code review Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> * lowercase * suggestions from code review * forgot laptop * bump to latest * fixes Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com>
2021-06-11 15:33:17 -06:00
[Debug car controls](joystick)
-------------
Use a joystick to control your car.
2020-01-17 11:07:22 -07:00
Welcomed contributions
=============
2021-06-16 23:23:12 -06:00
* Documentation: code comments, better tutorials, etc
* Support for platforms other than Ubuntu 20.04
* Performance improvements
2020-01-17 11:07:22 -07:00
* More tools: anything that you think might be helpful to others.
![Imgur](https://i.imgur.com/IdfBgwK.jpg)