I built my own Self-Driving (RC) Car!

Rodrigo Cava
3 min readJul 4, 2018

--

Mr. Robot

During a good part of my career I always worked with development and data analysis/science. Although I love it, it’s an abstract work where the results are programs and presentations. And I confess that I envy jobs that build “real world palpable things”, such as Architects or Chefs.

So a few months ago I stumbled upon this awesome video of an autonomous remote control (RC) car, and binding this with the constant growth of the Maker culture, it became a real inspiration for me. But it wasn’t until I joined Uber that I truly got motivated to make my own.

Just an FYI: I’m not the first one to build this. But almost all the projects that I saw were too complicated (remote servers, more hardware, etc) and I’d like a simpler way to tackle this. Also, I saw this as a great opportunity to learn more about Deep Learning and other technologies.

To build this I used a Raspberry Pi board, an external battery, an RC Car from AliExpress and a controller board called L298N.

The first step was to be able to control the RC car from the computer. I used an L298N controller to be able to control both motors and used the raspberry pi to control everything. At this point, I had a Computer-Controller Car, sweet!

Then I collected hundreds of images while I driving the RC car, matching my commands with pictures from the car. With that, I trained a Deep Learning Neural Network using Keras+Tensorflow based on this NVidia paper. After several tests, I got a staggering 90% of accuracy!

I also developed a stop sign identification using Haar feature-based cascade classifiers with OpenCV and a pre-trained model from here. That way the car could stop by itself when I put a stop sign in its front.

And just to put a cherry on top, I also developed a site so I could see what the car is seeing, control the car and activate the self-driving all from my smartphone.

So, after almost 2 months of work-after-work, I’ve finally made it! \o/ In the example below, using the web interface on the left I’ve activated the self-driving mode to move along the track and it stops by itself when it identified the stop sign.

Web Remote vs. Realtime actions

The final version run entirely on a Raspberry Pi, you can see its camera and control it using your smartphone (or any browser), it can self-drive in a white paper road and it also has a stop sign identifier. You can check more details about how it functions on my GitHub.

This was definitely one of the most amazing works I’ve developed so far. I’ve learned a TON with this project and super happy to finally become a Maker :D

--

--