openpilot is an open source driver assistance system. openpilot performs the functions of Automated Lane Centering and Adaptive Cruise Control for over 200 supported car makes and models.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Kacper Rączy 9cd71f897a locationd: remove models unused in openpilot (#30481) 1 year ago
..
bridge Metadrive: fix slow acceleration and enable past 50 mph (#30171) 2 years ago
lib adding --local-partial-types mypy opt (#30491) 1 year ago
tests adding --local-partial-types mypy opt (#30491) 1 year ago
Dockerfile.sim locationd: remove models unused in openpilot (#30481) 1 year ago
Dockerfile.sim_nvidia simulator: run simulator test in ci (#24691) 3 years ago
README.md remove carla dependency (#30139) 2 years ago
__init__.py Simulator Tests (#24274) 3 years ago
build_container.sh misc jenkins fixups (#24840) 3 years ago
launch_openpilot.sh Simulator: set params enabled (#30195) 2 years ago
rgb_to_nv12.cl sim: Converting RGB frames to NV12 format in OpenCL (#26169) 3 years ago
run_bridge.py Simulator: metadrive is the default (#30133) 2 years ago
start_carla.sh Updated Carla to version 0.9.14 (#29210) 2 years ago
start_openpilot_docker.sh Sim: fix openpilot directory (#29754) 2 years ago
tmux_script.sh Simulator: update documentation for metadrive (#30002) 2 years ago

README.md

openpilot in simulator

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

Launching openpilot

First, start openpilot.

# Run locally
./tools/sim/launch_openpilot.sh

Bridge usage

$ ./run_bridge.py -h
usage: run_bridge.py [-h] [--joystick] [--high_quality] [--dual_camera] [--simulator SIMULATOR] [--town TOWN] [--spawn_point NUM_SELECTED_SPAWN_POINT] [--host HOST] [--port PORT]

Bridge between the simulator and openpilot.

options:
  -h, --help            show this help message and exit
  --joystick
  --high_quality
  --dual_camera
  --simulator SIMULATOR
  --town TOWN
  --spawn_point NUM_SELECTED_SPAWN_POINT
  --host HOST
  --port PORT

Bridge Controls:

  • To engage openpilot press 2, then press 1 to increase the speed and 2 to decrease.
  • To disengage, press "S" (simulates a user brake)

All inputs:

| key  |   functionality       |
|------|-----------------------|
|  1   | Cruise Resume / Accel |
|  2   | Cruise Set    / Decel |
|  3   | Cruise Cancel         |
|  r   | Reset Simulation      |
|  i   | Toggle Ignition       |
|  q   | Exit all              |
| wasd | Control manually      |

MetaDrive

Launching Metadrive

Start bridge processes located in tools/sim:

./run_bridge.py --simulator metadrive

Carla

CARLA is also partially supported, though the performance is not great. It needs to be manually installed with:

poetry install --with=carla

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 the simulator in low quality by default.

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

Launching Carla

Start Carla simulator and bridge processes located in tools/sim:

# Terminal 1
./start_carla.sh

# Terminal 2
./run_bridge.py --simulator carla

Further Reading

The following resources contain more details and troubleshooting tips.