DonkeyCar Autonomous Driving

UC San Diego — Fall Quarter 2025 (September – December)

Code


Overview

This project explored autonomous lap driving on the DonkeyCar platform across four configurations — starting in simulation and progressing to a physical RC car with multiple sensing modalities. Each variant tested a different approach to perception and control: behaviour cloning from human demonstrations, GPS-based waypoint following, and computer vision lane tracking.


DonkeySim — Deep Learning Autonomous Laps

Human expert demonstrations were collected by driving manually around a simulated track, recording image frames alongside steering angle and throttle at each timestep. A TensorFlow Lite model was trained via behaviour cloning / imitation learning on this data and tasked with completing 3 autonomous laps. The model was evaluated both locally and on a remote server, with the remote session streamed live on Twitch.

Local autonomous laps

Remote laps streamed on Twitch


DonkeyCar Hardware

The physical DonkeyCar was built on a standard RC chassis with the following hardware stack:

DonkeyCar wiring diagram
Hardware wiring diagram showing connections between Raspberry Pi, ESC, VESC, GPS, camera, and power system.

Hardware Demo

Fully assembled DonkeyCar driven via RC remote on the outdoor track.


DonkeyCar — Deep Learning Autonomous Laps

The same behaviour cloning approach from the simulation was applied to the physical car using the OAK-D Lite camera on an outdoor track. Human demonstrations were collected on the physical platform and used to train a TensorFlow Lite model for 3 autonomous laps.


DonkeyCar — GNSS Autonomous Laps

Using the PointOneNav GNSS module, the car navigated a figure-8 lap route on the UCSD Snake Path autonomously via GPS waypoint following with tuned PID values. The track below shows the figure-8 lap path overlaid on the course.

GPS lap track at UCSD Snake Path
Figure-8 lap route at the UCSD Snake Path used for GNSS autonomous laps.

DonkeyCar — OpenCV Autonomous Laps

Yellow strips were placed along an outdoor path as lane markers. A ROS2 computer vision module running inside a Docker container (djnighti/ucsd_robocar) on the Raspberry Pi processed OAK-D Lite frames through a tuned color filter to detect the strips. PID values were tuned to complete 3 autonomous laps using the detected lane center as the control signal.


← Back to Portfolio