This project was inspired by a spirit of self-driving cars. I like to construct small cars from Arduino kits, but now decided to make something more than just a toy.
One day I found a tank chassis made from glossy aluminum. Self-driving tank sounds even better than car, so that was an inception.
I took off some parts from a small car I already assembled: Raspberry, power converter, motor driver, battery — and put them on the chassis. The tank became alive. I developed a simple REST interface with Python for Raspberry and even more simple app for Android. Then I was able to control the tank from my phone.
The thank is supposed to be vision-driven. Then I set up a camera. A first case was cheap and bad, so eventually the camera was mounted by yellow electric tape.
There is the alpha-version with cardboard plate.
I intended to develop the tank to be able a lot of things:
- Build a map of the room
- Learn routes inside the room and follow them
- Locate objects in the room and head towards them
- Follow a line on the floor
It started with OpenCV, but quickly was impressed by TensorFlow and its abilities to detect objects on photos. I found TF for Raspberry built by Sam Abrahams. It worked but performance was not very good.
During the further search, I discovered OpenCV made a big step toward neural networks. Its new module DNN (Deep Neural Networks) provides an ability to use already prepared neural network without even having TensorFlow installed. There were some tricks — at first, the latest version of TF-network was not compatible with OpenCV and I had to find the right one.
Second, I did not find OpenCV 3.4.1 (with stable DNN) for Raspberry Pi and I had to do it on my own. That was a working solution to detect objects right on the tank, lightweight (no whole TensorFlow required) and local (no external calculations or data exchange).
I put the built OpenCV 3.4.1 to GitHub.
Also I did some more improvements before to make it really self-driving:
- develop an Android app to control the tank manually
- set up a video stream from tank camera to the phone
- mount a pan-and-tilt stand for the camera
- cut a nice plate from black acrylic for the electricals
- added an ultrasonic distance meter
With all that stuff the tank is ready for AI experiments.