Open source hardware and software platform to build a small scale self driving car.
See the code
Donkeycar is a minimalist and modular self driving library for Python. It is developed for hobbyists and students with a focus on allowing fast experimentation and easy community contributions. It is being actively used at the high school and university level for learning and research. It offers a rich graphical interface and includes a simulator so you can experiment with self-driving even before you build a robot.

Donkeycar is designed to be the 'Hello World' of automomous driving; it is simple yet flexible and powerful. No specific prequisite knowledge is required, but it helps if you have some knowledge of:
myconfig.py, is a Python file. You mostly just uncomment the sections you want to change and edit them; you can avoid common mistakes if you know how Python comments and indentation works.After building a Donkeycar and installing the Donkeycar software you can choose your autopilot template and calibrate your car and get driving!
Donkeycar includes a number of pre-built templates that make it easy to get started by just changing configuration. The pre-built templates are all you may ever need, but if you want to go farther you can change a template or make your own. A Donkeycar template is organized as a pipeline of software parts that run in order on each pass through the vehicle loop, reading inputs and writing outputs to the vehicle's software memory as they run. A typical car has a parts that:
If there isn't a Donkeycar part that does what you want then write your own part and add it to a vehicle template.
#Define a vehicle to take and record pictures 10 times per second.
import time
from donkeycar import Vehicle
from donkeycar.parts.cv import CvCam
from donkeycar.parts.tub_v2 import TubWriter
V = Vehicle()
IMAGE_W = 160
IMAGE_H = 120
IMAGE_DEPTH = 3
#Add a camera part
cam = CvCam(image_w=IMAGE_W, image_h=IMAGE_H, image_d=IMAGE_DEPTH)
V.add(cam, outputs=['image'], threaded=True)
#warmup camera
while cam.run() is None:
time.sleep(1)
#add tub part to record images
tub = TubWriter(path='./dat', inputs=['image'], types=['image_array'])
V.add(tub, inputs=['image'], outputs=['num_records'])
#start the drive loop at 10 Hz
V.start(rate_hz=10)
Donkeycar uses uv for environment management. Install uv first:
curl -LsSf https://astral.sh/uv/install.sh | sh
Then create a persistent virtual environment and activate it on login by
adding the source line to your shell profile.
Camera support (picamera2, libcamera) requires system packages that are
not on PyPI. Install them first:
sudo apt install python3-libcamera python3-picamera2
Then create the venv using the system Python (3.13 on Raspberry Pi OS Trixie)
with --system-site-packages so the venv can see the camera libraries:
uv venv ~/env --python 3.13 --system-site-packages
echo 'source ~/env/bin/activate' >> ~/.zshrc
source ~/env/bin/activate
User install (from PyPI):
uv pip install donkeycar[pi]
Developer install (from a git clone):
uv pip install -e ".[pi,dev]"
uv venv ~/.venvs/donkeycar --python 3.12
echo 'source ~/.venvs/donkeycar/bin/activate' >> ~/.zshrc
source ~/.venvs/donkeycar/bin/activate
User install (from PyPI):
uv pip install donkeycar[macos]
Developer install (from a git clone):
uv pip install -e ".[macos,dev]"
uv venv ~/.venvs/donkeycar --python 3.12
echo 'source ~/.venvs/donkeycar/bin/activate' >> ~/.zshrc
source ~/.venvs/donkeycar/bin/activate
User install (from PyPI):
uv pip install donkeycar[pc]
Developer install (from a git clone):
uv pip install -e ".[pc,dev]"
Once the venv is activated in your shell profile the donkey command is
available from any directory without needing uv run.
See home page, docs or join the Discord server to learn more.
Overall
Maintained
Code review
PyPI
Latest release
Releases this year
772 followers · starred Jul 2017
1,961 followers · starred May 2023
109 followers · starred Sep 2018
255 followers · starred Jul 2019
Open source hardware and software platform to build a small scale self driving car.
See the code
Donkeycar is a minimalist and modular self driving library for Python. It is developed for hobbyists and students with a focus on allowing fast experimentation and easy community contributions. It is being actively used at the high school and university level for learning and research. It offers a rich graphical interface and includes a simulator so you can experiment with self-driving even before you build a robot.

Donkeycar is designed to be the 'Hello World' of automomous driving; it is simple yet flexible and powerful. No specific prequisite knowledge is required, but it helps if you have some knowledge of:
myconfig.py, is a Python file. You mostly just uncomment the sections you want to change and edit them; you can avoid common mistakes if you know how Python comments and indentation works.After building a Donkeycar and installing the Donkeycar software you can choose your autopilot template and calibrate your car and get driving!
Donkeycar includes a number of pre-built templates that make it easy to get started by just changing configuration. The pre-built templates are all you may ever need, but if you want to go farther you can change a template or make your own. A Donkeycar template is organized as a pipeline of software parts that run in order on each pass through the vehicle loop, reading inputs and writing outputs to the vehicle's software memory as they run. A typical car has a parts that:
If there isn't a Donkeycar part that does what you want then write your own part and add it to a vehicle template.
#Define a vehicle to take and record pictures 10 times per second.
import time
from donkeycar import Vehicle
from donkeycar.parts.cv import CvCam
from donkeycar.parts.tub_v2 import TubWriter
V = Vehicle()
IMAGE_W = 160
IMAGE_H = 120
IMAGE_DEPTH = 3
#Add a camera part
cam = CvCam(image_w=IMAGE_W, image_h=IMAGE_H, image_d=IMAGE_DEPTH)
V.add(cam, outputs=['image'], threaded=True)
#warmup camera
while cam.run() is None:
time.sleep(1)
#add tub part to record images
tub = TubWriter(path='./dat', inputs=['image'], types=['image_array'])
V.add(tub, inputs=['image'], outputs=['num_records'])
#start the drive loop at 10 Hz
V.start(rate_hz=10)
Donkeycar uses uv for environment management. Install uv first:
curl -LsSf https://astral.sh/uv/install.sh | sh
Then create a persistent virtual environment and activate it on login by
adding the source line to your shell profile.
Camera support (picamera2, libcamera) requires system packages that are
not on PyPI. Install them first:
sudo apt install python3-libcamera python3-picamera2
Then create the venv using the system Python (3.13 on Raspberry Pi OS Trixie)
with --system-site-packages so the venv can see the camera libraries:
uv venv ~/env --python 3.13 --system-site-packages
echo 'source ~/env/bin/activate' >> ~/.zshrc
source ~/env/bin/activate
User install (from PyPI):
uv pip install donkeycar[pi]
Developer install (from a git clone):
uv pip install -e ".[pi,dev]"
uv venv ~/.venvs/donkeycar --python 3.12
echo 'source ~/.venvs/donkeycar/bin/activate' >> ~/.zshrc
source ~/.venvs/donkeycar/bin/activate
User install (from PyPI):
uv pip install donkeycar[macos]
Developer install (from a git clone):
uv pip install -e ".[macos,dev]"
uv venv ~/.venvs/donkeycar --python 3.12
echo 'source ~/.venvs/donkeycar/bin/activate' >> ~/.zshrc
source ~/.venvs/donkeycar/bin/activate
User install (from PyPI):
uv pip install donkeycar[pc]
Developer install (from a git clone):
uv pip install -e ".[pc,dev]"
Once the venv is activated in your shell profile the donkey command is
available from any directory without needing uv run.
See home page, docs or join the Discord server to learn more.
Overall
Maintained
Code review
PyPI
Latest release
Releases this year
772 followers · starred Jul 2017
1,961 followers · starred May 2023
109 followers · starred Sep 2018
255 followers · starred Jul 2019