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.
 
 
 
 
 
 
Justin Newberry db839e887d Simulator: blinkers and lane changes (#30107) 2 years ago
..
bridge Simulator: blinkers and lane changes (#30107) 2 years ago
lib Simulator: blinkers and lane changes (#30107) 2 years ago
tests Simulator: split bridge and world into two files (#30091) 2 years ago
Dockerfile.sim bump submodules (#29705) 2 years ago
Dockerfile.sim_nvidia simulator: run simulator test in ci (#24691) 3 years ago
README.md Simulator: update documentation for metadrive (#30002) 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: passthrough BLOCK on launch script (#30040) 2 years ago
rgb_to_nv12.cl sim: Converting RGB frames to NV12 format in OpenCL (#26169) 3 years ago
run_bridge.py Simulator: update documentation for metadrive (#30002) 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

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.