Self-driving cars are in the news almost daily, but they are not exactly in my automotive budget for this decade. Today, that has changed.
While this car might be smaller and not capable of giving me a ride, it’s still autonomous and, best of all, it is a project that I absolutely want to build!
The vehicle is a creation of University of Gothenburg student Dimitris Platis and his team of Makers — Yilmaz Caglar, Aurélien Hontabat, David Jensen, Simeon Ivanov, Ibtissam Karouach, Jiaxin Li, and Petroula Theodoridou — who collectively go by the name Team Pegasus. The team’s work is impressive, they’re GPLv3 licensed, and their documentation is quite good. The project is ripe to enable other interested Makers to jump right in and create their own fork of the project.
Originally, Platis’ class assignment directions suggested using a single-board computer, webcam, elaborate simulation software package called OpenDaVinci, and an aesthetically unattractive chassis, all of which he wasn’t too excited about. So, he and the team decided to dump the suggested components and solve the problem set using their own approach.
Here’s an overview of the project.
The electronics layout inside the car should look pretty familiar to anyone who has used Arduino to prototype a project. The Arduino MEGA connects with three ultrasonic sensors, two of which are mounted on the front of the car and one on the rear bumper. Three IR sensors also wire to the MEGA and are deployed in a similar fashion. A gyroscope and 9 degree-of-freedom inertial measurement boards round out the sensor package, but are placed within the chassis of the vehicle.
Steering directions are transmitted from an onboard Android phone running vision processing and transmitted over Bluetooth, and the electronic speed control (ESC)
and Adafruit motor shield handle the car’s acceleration (not shown).
Correction: Originally I wrote that an Adafruit motor control shield was used in the project, it was not. Dimitris Platis corrected me and has this to add. “This vehicle does *not* use a motor shield (just an ESC) or the Smartcar Core library. The Smartcar Core library, was used in different vehicle (which in turn indeed uses a motor shield), from another group of students, who also made something really interesting, that I should write about soon.”
Finally, and also not shown in the layout, is an ATtiny85 microcontroller that is programmed with its own sketch to handle LEDs control for such are things as breaking, turning, and illuminating the roadway.
The code leverages AndroidCar.h, a custom library built by Team Pegasus, and polls sensor data on the car, which is then sent via Bluetooth to the onboard cellular phone.
Then, the API handles the transmission of steering commands from the phone’s computations and alters the servo position. To learn more about the API, check out the Smartcar Core example sketches. For documentation on the code that glues the Arduino code with the Android phone, you want to check out the Android-Car-duino repository. And for an overall approach to adapting this set of libraries to your own vehicle this wiki is for you.