nopenpilot/tools/sim
Josh Smith 77321dbac4
Add type hints, small cleanups (#21080)
* improve tools.lib.kbhit and tools.sim.lib.keyboard_ctrl

* unpack more efficiently

* minor improvements

* agnos.py match spec better

* manual_ctrl test missing queue arg

* fix incorrect type annotation

* queues are generic

* varname reuse resulting in incorrect type inference

* bytes().hex() rather than bytes.hex(bytes())

* a bit of type hinting stuff
2021-06-03 12:21:04 +02:00
..
lib Add type hints, small cleanups (#21080) 2021-06-03 12:21:04 +02:00
.gitignore Cleanup simulator and add usage instructions (#1050) 2020-02-04 19:46:57 -08:00
Dockerfile.sim Minimize sim docker image size (#20324) 2021-03-11 19:04:29 -08:00
README.md update simulator README 2021-03-17 00:42:32 -07:00
bridge.py Add type hints, small cleanups (#21080) 2021-06-03 12:21:04 +02:00
build_container.sh sim/build_container.sh: fix container name 2021-03-23 13:20:59 +01:00
install_carla.sh Fix simulator docker: CPU only for now (#20227) 2021-03-07 23:02:57 -08:00
launch_openpilot.sh Manager cleanup (#20231) 2021-03-05 11:03:23 +01:00
start_carla.sh optimizing simulator performance (#20295) 2021-03-09 23:48:46 -08: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 Add Flags to Control Simulator (#2246) 2020-09-29 14:00:03 -07:00

README.md

openpilot in simulator

Running the simulator

First, start the CARLA server.

./start_carla.sh

Then start bridge and openpilot.

./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.

System Requirements

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

NOTE: CARLA requires an NVIDIA graphics card.

You can also check out the CARLA python documentation to find more parameters to tune that might increase performance on your system

Further Reading

The following resources contain more details and troubleshooting tips.