Author: Marvin Baral (firstname.lastname@example.org)
A project for shooting airballons with a modified LEGO Cannon automatically by the use of image processing. Everything is controlled by a RaspberryPi. The Camera is the 160° 5MP RaspberryPi Camera. If you want to boost performance you can run the Qt-program on your laptop and connect an Arduino and a USB Webcam to it. The camera can be any camera available on your PC. Red airballons can succesfully be hit and destroyed with the LEGO cannon IF they hold still. The flightpath calculation uses physical formulars and trigonometry and relies on the given size of the balloon (23 cm). To configure it you have to edit the constants defined in config.cpp and recompile. If you want to use your Laptop/PC with Arduino, change HARDWARE_VERSION to V1_1.
I made this project for my oral A level in computer technology. Therefore I am able to offer you a wonderfully colored presentation (in German): https://docs.google.com/presentation/d/1Q0u6JJvU0JhhG1BdvJM-5qi7tFbW3g5N5EWulWlf5u8/edit?usp=sharing
DIY (Do It Yourself)
- l - lock - locks the servos, the turret will neither move nor shoot
- c - clearance - clearance to shoot
- m - manual mode - control the turret with keys and shoot with enter
- a - let the program automatically detect and shoot at a airballoon (red)
- r - reset connection to Arduino, resetting servo positions
Works ok, but not perfect. ~70% hit rate, best hit quote in horizontal level.
1. PC makes the big ComputerVision-Processing, Arduino controls Servos, USB Webcam
2. RaspberryPi + RaspberryPi 160° Camera, everything done on RaspberryPi
- https://www.youtube.com/watch?v=UD78xyKbrfk - Using QSerialPort
- https://www.youtube.com/watch?v=XdBDx7ZQaok - Flightpathcalculation