Roblucks
A few years ago my son and I entered the PI Wars (https://piwars.org/) competition. This is a non-destructive competition for robots built using Raspberry PIs (https://www.raspberrypi.org). The tasks included manual (through a wireless device) and automated control (through sensors) of the robot.
I really enjoyed the chance to combine programming with a bit of physical engineering while working through some real challenges just for the fun of it while spending time with my then 8 year old son. We blogged about the build (https://techadventure.wixsite.com/roblucks/blog) which details the steps we went through.
It was a simple enough idea, to take the existing control from a radio-control car and just add the PI. What could go wrong?
The controls of the car were from an Electronic Speed Control (ESC) which regulates the speed and direction of the motor and a servo to turn direction. The difficulty was that a Raspberry PI 3 could not send or maintain accurate enough signals to control the car. After a few seconds, it would accelerate or turn.
The answer was to introduce an Arduino Uno to control the ESC and servo as well as read from the sensors for the automated tasks. The Raspberry PI issued commands to the Arduino and accepted readings from the sensors and an XBOX controller via Bluetooth for manual tasks. The car network looked something like this:
The code for Roblucks can be found in the following GitHub repository. The Arduino controller is written in C++ while the Raspberry PI code is written in Python.
Python