Flash Fire: Autonomous RC Car


GitHub Back to Homepage

Overview

Successful Autonomous Run

FlashFire is a group project that successfully produced an autonomous RC Car that could navigate any course using Imitation Learning. Imitation Learning works by having an "expert" perform the task a number of times and having the target (in this case an RC Car) learn from the expert. This was achieved by creating a custom Convolutional Neural Network to label each image being captured during training, and assigning that image a throttle value and steering value.


Hardware

The brain of this project was provided by the Raspberry Pi 4. Attached to the Pi was a webcam that captured 20 images per second so the network had ample training data. Along with this, a servo was attached to PCA9685 servo driver to control the front two wheels. A motor was also attached to the PI, with everything being powered by a rechargeable LiPo battery. A custom 2-tier acrylic frame sat on top of the wheels that held all of the electronics in place.


Donkey Car

This project was built off a platform known as Donkey Car. DonkeyCar is an open-source platform for building self-driving scale model cars, designed as an accessible entry point to autonomous vehicle development. It combines hardware, such as a 1/10th scale RC car, Raspberry Pi, and various sensors, with Python-based software to enable machine learning and computer vision tasks. DonkeyCar utilizes deep learning frameworks like TensorFlow and PyTorch to train models for lane following, object avoidance, and more.

However for this project, we deployed our own Convolutional Neural Network to fit the specific needs of this project using PyTorch.


Architecture

Flashfire's network is a CNN architecture designed for tasks involving image input, characterized by its compact and modular design. It begins with four convolutional layers that progressively reduce the spatial dimensions of the input while increasing feature depth, employing 5x5 and 3x3 kernels with strides of 2 and 1 to capture patterns at varying scales. Each convolutional layer is followed by a ReLU activation to introduce non-linearity. After the convolutional operations, the network flattens the feature maps and processes them through three fully connected layers, reducing the dimensionality step-by-step from a computed input size to 64, then 32, and finally to 2 output neurons (throttle and steering). This architecture ensures that the network is adaptable to different input sizes (defined by width and height) by dynamically calculating the fully connected input size based on convolutional layer outputs.


Results

After moving the training images from the PI to a hose computer, FlashFire is ready to be trained for an autnomous run on the course driven on. Running the images through FlashFire's CNN produces a model that is used as an input to the autopilot script. The script takes an image similar to the training process, runs that image through the model, and outputs a throttle and steering value for the car.


Contributors