After watching the Expanse I was inspired to build a PDC. [point defense cannon]
Here is my attempt to bring that idea to life. (at a very small scale, and in a much cheaper fashion)
To keep the scope small and design simple I decided that the project should have the following requirements:
- Utilize a Pan and Tilt Platform
- Implement facial tracking for targeting
- Integrate some sort of plastic dart launcher
I first needed to assemble the pan and tilt platform and attach it to some sort of base.
I decided to 3D print the base.
The device was ultimately controlled with a raspberry pi, raspberry pi camera, PWM controller, pan and tilt platform, and dual output power supply. A fan was also added as the object-recognition processing was very resource-intensive and caused the CPU to heat up quite a bit.
The demo video demonstrates the device in action. I initially utilized pyimagesearch’s opencv4 control logic to detect faces and then massaged it a bit to work with the Adafruit PCA9685 PWM control library to manipulate the pan and tilt device.
After that was complete I refactored the code a bit, so that several modes could be implemented. Mainly one mode to train new face models and add them to a blacklist and another mode to deploy the device into sentry mode to track the blacklisted faces.
https://github.com/aejx00/facial_tracking
Later, I stumbled on R/C helicopter that had a plastic turret accessory and was able to source that part from aliexpress. I quickly added it to the sentry platform and this was the final product:
After fiddling with the firing control logic a bit I was able to add crosshairs to the opencv output to highlight blacklisted targets. Additional logic was added to keep track of ammo, fine tune targeting to compensate for the launcher offset, as well as add safety features to avoid accidential misfires.
I eventually repacked a lot of the components into a box to clean up overall wiring/packaging solution and added a higher resolution camera to improve the tracking/targeting accuracy. Also for fun I added a small speaker that would taunt the targets when they were in firing range with audio snippets from the Dreadnought Davian Thule. (these changes are not reflected in github repository)
In conclusion I think the overall project was a success and I learned a lot about computer vision and pwm control in the process. In the future I would like to build a much larger PDC with a few notable changes.
- I would need a much beefier pan and tilt platform to support the weight of a small paintball gun or pepperball launcher.
- Instead of a regular camera I would use a depth AI camera like OAK-D. This would allow me to get depth information from the camera for targeting purposes and the image processing would happen at the edge, reducing the processing load on the raspberry pi and speed up the target acquisition.
- Possibly make the entire platform battery powered and add a low-latency wireless communication protocol so that it could be deployed virtually anywhere.
Ultimately, I’ve run out of money and time to support this project so the future iteration of the PDC will have to be added back to my backlog 🙁