Building and training a self-driving robocar takes several iterations of hardware and software improvements. Especially training a competitive model is a time consuming process that involves going back-and-forth to the track several times to either check or improve model predictive performance by recording additional samples1. Computer simulation is an alternative, however setting up a simulation environment can be a demanding task. In this post, I outline my effort to build and test a compact indoor track that can be used to train and validate autonomous driving models quickly and easily.
The idea is to “emulate” the driving behavior of a tiny car on a track that would be small enough to print on a large piece of paper (think A0, for instance). I calculated the size of such a vehicle, given usual Ackermann steering vehicle proportions, to around 3cm (1.18 inch). It is understandable that it is quite challenging to load such a small vehicle with sensors and computing power to drive around by itself. One could think of offloading computing power to an external, powerful processor (as early versions of the Donkey platform have done), however performing all the functions among collecting, processing and sending captured images, as well as receiving data and activating motors and servos, calls for several components that would need to be crammed in a tiny chassis. Thus an idea here is to have a larger vehicle emulate the behavior of a tiny car.
However, it is also possible to emulate an Ackermann steering vehicle using a simple differential rover (skid steering), without the need for sull degrees of freedom. What’s more, it turns out that the size of the vehicle does not really matter; a differential vehicle of any size can be used, as long as the wheel axis is placed at the correct distance relevant to the camera, and the motors are activated according to a certain scheme. In the following sections I outline the building of the track and the differential steering vehicle.
The track is a simple spline with turns of varying radius. In fact, due to using splines to model the track, the turns do not have a constant radius, and some of them are a bit wobbly. I decided to have the track itself being a different color instead of having lines at the edges of the track, because I think this way the vehicle will be able to recognize more easily if it is on track or not.
The track is printed black and white on A0 size regular paper, to save on costs. The central dotted line is painted yellon on top of the print, although I’m planning to experiment with different colors as well. The track is available as a free PDF file below:
If you make use of it, please make sure you attribute this post and the Burro project.
I’ve written an extensive post on using differential thrust to emulate the steering behavior of Ackermann steering vehicles. The vehicles described here are based on information therein.
I set on making a vehicle that can emulate a tiny car, and pack the processing power to drive autonomously. The first prototype I made was a balancing differential steering design that eliminated the need for a caster wheel, like the one below:
However it quickly became obvious that a balancing differential steering design, while eliminating the need for a caster wheel, will result in vertical movement of the camera as the chassis rolls while speeding up or down. Such movement would have a detrimental effect on the performance of the neural net. My second design was much more conservative (and much more spacious):
The chassis was laser cut out of 5mm clear acrylic, in order to minimize self-shadowing in front of the camera. As you can see there is no caster wheel, rather balance is via a zip-tie tied in a loop. The usual hardware is present, Raspberry Pi 2 and the Adafruit Motor HAT. A 3300mAh 3S battery piowers the setup. A 3A UBEC (ebay listing) is used for stepping down the voltage to drive the Pi.
As pointed out earlier, size of the actual vehicle does not really matter. By tuning the activation of the motors according to the scheme presented, it was possible to emulate a micro-car of around 3-4 cm length (1.2 – 1.5 inch), while the prototype differential steering vehicle had an overal length of around 25cm (10 inch).
The changes in the differential steering algorithm have made it into the latest version of Burro. Using Burro, you can emulate an Ackermann steering vehicle faithfully using a differential steering rover. All you need to do is input the dimensions of your vehicle in the user config (
config/user.ini), and the Burro differential mixer takes care of proper driving of the motors. Note that most geometry settings in Burro only affect differential steering vehicles; the behavior of real Ackermann steering cars is defined by the actual configuration of their parts. The only required option in this case (which Burro includes) is the maximum steering angle.
Below is a short video that demonstrates a few minutes of driving on the track. The neural network model shown in the video will soon be included with Burro:
This post discussed the idea of miniaturizing autonomous driving setups with the aim of decreasing model training-validation cycle times. Aspects of vehicle geometry and motor driving with the aim of emulating the behavior of a miniature vehicle using larger counterparts, has been discussed. Having such a setup at hand, I plan to quickly move forward with experimenting on throttle and obstacle avoidance, among others.
What do you think of this experiment? How could driving behavior be improved? Share your ideas and experiments in the comments below.
Sign up to Backyard Robotics
- This concerns the so-called imitation learning, where the vehicle learns to imitate human driving. Other types of learning, such as reinforcement learning, have different requirements
- A holonomic vehicle has three degrees of freedom in two dimensions. Therefore, it could be used to emulate the behavior of any kind of driving condition using the appropriate control algorithm. One could for instance emulate car drifting in software without having to physically implement the dynamics of sliding wheels on the ground.