nopenpilot/tools/sim
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
..
lib Convert format strings strings to f-strings (#23241) 2021-12-16 14:58:17 +01:00
Dockerfile.sim camerad: remove camera frame stream (#23045) 2021-11-27 21:58:21 -08:00
README.md improve sim readme 2021-10-10 15:50:30 -07:00
bridge.py Pyupgrade 3.6: Update syntax with Python 3.6+ features (#23305) 2021-12-24 11:18:39 -08:00
build_container.sh sim/build_container.sh: fix container name 2021-03-23 13:20:59 +01:00
launch_openpilot.sh CARLA: send YUV and RGB over visionipc from bridge.py (#23012) 2021-11-26 16:58:25 +01:00
start_carla.sh sim: improve carla performance (#23046) 2021-11-28 11:32:37 +01:00
start_openpilot_docker.sh sim: mount working dir to the same dir in the container (#20908) 2021-05-14 20:00:13 -07:00
tmux_script.sh sim: fix race condition in tmux script (#22365) 2021-09-28 14:07:41 -07:00

README.md

openpilot in simulator

openpilot implements a bridge that allows it to run in the CARLA simulator.

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 to find more parameters to tune that might increase performance on your system.

Running the simulator

First, start the CARLA server in one terminal.

./start_carla.sh

Then, start the bridge and openpilot in another terminal.

./start_openpilot_docker.sh

To engage openpilot press 1 a few times while focused on bridge.py to increase the cruise speed.

Controls

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.