nopenpilot/tools/sim/README.md

47 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

2020-03-10 14:38:40 -06:00
openpilot in simulator
=====================
2021-10-10 16:50:30 -06:00
openpilot implements a [bridge](bridge.py) that allows it to run in the [CARLA simulator](https://carla.org/).
## System Requirements
openpilot doesn't have any extreme hardware requirements, however CARLA requires an NVIDIA graphics card and 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.
dockerize carla + openpilot (#2011) * dockerize carla + openpilot * separate dockerfile * bring back CI dockerfile * cleanup bridge * add op docker build and start script * build container in CI * fix camerad hack * remove most magic numbers from bridge.py * openpilot-sim docker build and run scripts * fix dmonitoring hacks * revert controlsd hacks * clean up build scripts * singular * fix path * fix image name * modify sim readme * sim readme and start script changes * dockerfile with working opengl * working opengl + passing panda build_st in docker * fix bug in sim docker file * bugfix sim docker file * bugfix all op-sim docker issues * modify readme + run script * IT DRIVES * clean this up * more cleanup * cleanup docker stuff * more cleanup * start with openpilot-base * install carla python package * Script is not in lib * chmod * everything should be running in docker now, the code may not be nice though * works locally... * rhdChecked is deprecated * Checkout using git lfs when building sim container * try to pass the tests * pull latest docker * gps should not throw an error on openpilot launch in bridge.py * fixed a coding style error * Only start ubloxd in car * fixed more style problems * revert typo * Use enviromental variable to prevent errors in a simulator * Remove unused import * Attempt to fix missing enviromental variable * fix typo * less work for users, auto tmux engagement * less work for users, auto tmux engagement * fix check for nvidia * clean up nvidia check * remove typo, shorted dockerfile Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Willem Melching <willem.melching@gmail.com> Co-authored-by: Bruce Wayne <batman@workstation-eu-gregor.eu.local> Co-authored-by: Gregor Kikelj <gregor1234567890@gmail.com>
2020-09-10 04:14:49 -06:00
## Running the simulator
2021-10-10 16:50:30 -06:00
First, start the CARLA server in one terminal.
```
dockerize carla + openpilot (#2011) * dockerize carla + openpilot * separate dockerfile * bring back CI dockerfile * cleanup bridge * add op docker build and start script * build container in CI * fix camerad hack * remove most magic numbers from bridge.py * openpilot-sim docker build and run scripts * fix dmonitoring hacks * revert controlsd hacks * clean up build scripts * singular * fix path * fix image name * modify sim readme * sim readme and start script changes * dockerfile with working opengl * working opengl + passing panda build_st in docker * fix bug in sim docker file * bugfix sim docker file * bugfix all op-sim docker issues * modify readme + run script * IT DRIVES * clean this up * more cleanup * cleanup docker stuff * more cleanup * start with openpilot-base * install carla python package * Script is not in lib * chmod * everything should be running in docker now, the code may not be nice though * works locally... * rhdChecked is deprecated * Checkout using git lfs when building sim container * try to pass the tests * pull latest docker * gps should not throw an error on openpilot launch in bridge.py * fixed a coding style error * Only start ubloxd in car * fixed more style problems * revert typo * Use enviromental variable to prevent errors in a simulator * Remove unused import * Attempt to fix missing enviromental variable * fix typo * less work for users, auto tmux engagement * less work for users, auto tmux engagement * fix check for nvidia * clean up nvidia check * remove typo, shorted dockerfile Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Willem Melching <willem.melching@gmail.com> Co-authored-by: Bruce Wayne <batman@workstation-eu-gregor.eu.local> Co-authored-by: Gregor Kikelj <gregor1234567890@gmail.com>
2020-09-10 04:14:49 -06:00
./start_carla.sh
```
dockerize carla + openpilot (#2011) * dockerize carla + openpilot * separate dockerfile * bring back CI dockerfile * cleanup bridge * add op docker build and start script * build container in CI * fix camerad hack * remove most magic numbers from bridge.py * openpilot-sim docker build and run scripts * fix dmonitoring hacks * revert controlsd hacks * clean up build scripts * singular * fix path * fix image name * modify sim readme * sim readme and start script changes * dockerfile with working opengl * working opengl + passing panda build_st in docker * fix bug in sim docker file * bugfix sim docker file * bugfix all op-sim docker issues * modify readme + run script * IT DRIVES * clean this up * more cleanup * cleanup docker stuff * more cleanup * start with openpilot-base * install carla python package * Script is not in lib * chmod * everything should be running in docker now, the code may not be nice though * works locally... * rhdChecked is deprecated * Checkout using git lfs when building sim container * try to pass the tests * pull latest docker * gps should not throw an error on openpilot launch in bridge.py * fixed a coding style error * Only start ubloxd in car * fixed more style problems * revert typo * Use enviromental variable to prevent errors in a simulator * Remove unused import * Attempt to fix missing enviromental variable * fix typo * less work for users, auto tmux engagement * less work for users, auto tmux engagement * fix check for nvidia * clean up nvidia check * remove typo, shorted dockerfile Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Willem Melching <willem.melching@gmail.com> Co-authored-by: Bruce Wayne <batman@workstation-eu-gregor.eu.local> Co-authored-by: Gregor Kikelj <gregor1234567890@gmail.com>
2020-09-10 04:14:49 -06:00
2021-10-10 16:50:30 -06:00
Then, start the bridge and openpilot in another terminal.
2020-09-11 09:42:12 -06:00
```
2020-09-11 09:42:31 -06:00
./start_openpilot_docker.sh
2020-11-05 15:11:41 -07:00
```
dockerize carla + openpilot (#2011) * dockerize carla + openpilot * separate dockerfile * bring back CI dockerfile * cleanup bridge * add op docker build and start script * build container in CI * fix camerad hack * remove most magic numbers from bridge.py * openpilot-sim docker build and run scripts * fix dmonitoring hacks * revert controlsd hacks * clean up build scripts * singular * fix path * fix image name * modify sim readme * sim readme and start script changes * dockerfile with working opengl * working opengl + passing panda build_st in docker * fix bug in sim docker file * bugfix sim docker file * bugfix all op-sim docker issues * modify readme + run script * IT DRIVES * clean this up * more cleanup * cleanup docker stuff * more cleanup * start with openpilot-base * install carla python package * Script is not in lib * chmod * everything should be running in docker now, the code may not be nice though * works locally... * rhdChecked is deprecated * Checkout using git lfs when building sim container * try to pass the tests * pull latest docker * gps should not throw an error on openpilot launch in bridge.py * fixed a coding style error * Only start ubloxd in car * fixed more style problems * revert typo * Use enviromental variable to prevent errors in a simulator * Remove unused import * Attempt to fix missing enviromental variable * fix typo * less work for users, auto tmux engagement * less work for users, auto tmux engagement * fix check for nvidia * clean up nvidia check * remove typo, shorted dockerfile Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Willem Melching <willem.melching@gmail.com> Co-authored-by: Bruce Wayne <batman@workstation-eu-gregor.eu.local> Co-authored-by: Gregor Kikelj <gregor1234567890@gmail.com>
2020-09-10 04:14:49 -06:00
2020-11-05 15:11:41 -07:00
To engage openpilot press 1 a few times while focused on bridge.py to increase the cruise speed.
2020-06-03 13:54:49 -06:00
## Controls
dockerize carla + openpilot (#2011) * dockerize carla + openpilot * separate dockerfile * bring back CI dockerfile * cleanup bridge * add op docker build and start script * build container in CI * fix camerad hack * remove most magic numbers from bridge.py * openpilot-sim docker build and run scripts * fix dmonitoring hacks * revert controlsd hacks * clean up build scripts * singular * fix path * fix image name * modify sim readme * sim readme and start script changes * dockerfile with working opengl * working opengl + passing panda build_st in docker * fix bug in sim docker file * bugfix sim docker file * bugfix all op-sim docker issues * modify readme + run script * IT DRIVES * clean this up * more cleanup * cleanup docker stuff * more cleanup * start with openpilot-base * install carla python package * Script is not in lib * chmod * everything should be running in docker now, the code may not be nice though * works locally... * rhdChecked is deprecated * Checkout using git lfs when building sim container * try to pass the tests * pull latest docker * gps should not throw an error on openpilot launch in bridge.py * fixed a coding style error * Only start ubloxd in car * fixed more style problems * revert typo * Use enviromental variable to prevent errors in a simulator * Remove unused import * Attempt to fix missing enviromental variable * fix typo * less work for users, auto tmux engagement * less work for users, auto tmux engagement * fix check for nvidia * clean up nvidia check * remove typo, shorted dockerfile Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> Co-authored-by: Willem Melching <willem.melching@gmail.com> Co-authored-by: Bruce Wayne <batman@workstation-eu-gregor.eu.local> Co-authored-by: Gregor Kikelj <gregor1234567890@gmail.com>
2020-09-10 04:14:49 -06:00
2020-09-11 09:42:12 -06:00
You can control openpilot driving in the simulation with the following keys
| key | functionality |
| :---: | :---------------: |
| 1 | Cruise up 5 mph |
| 2 | Cruise down 5 mph |
| 3 | Cruise cancel |
| q | Exit all |
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.
## Further Reading
The following resources contain more details and troubleshooting tips.
* [CARLA on the openpilot wiki](https://github.com/commaai/openpilot/wiki/CARLA)