This Predator-Style, Shoulder-Mounted Nerf Blaster Uses a Raspberry Pi to Track Faces
Engineering After Hours used a Raspberry Pi and Google Coral Edge TPU to replicate the legendary plasmacaster in glorious Nerf blaster form.
1987’s Predator is quite possibly the most masculine movie ever made. In this action classic, Arnold Schwarzenegger and his muscle-bound pals attempt to use sweat, testosterone, and big ol’ guns to defend themselves against the titular alien hunter. In the end, Schwarzenegger’s character Dutch has to use his brains—not brawn and bullets—to defeat his otherworldly enemy. That’s because the Predator was bigger than Arnie and had better weapons. The most iconic of all of those weapons is the shoulder-mounter plasma cannon that the Predator is capable of firing without having to lift a finger. The proprietor of the Engineering After Hours YouTube channel used a Nerf blaster and a Raspberry Pi to replicate that functionality.
The Predator’s shoulder cannon, called the “plasmacaster” in-universe, is capable of automatically targeting enemies. In the movie Alien vs. Predator, it is implied that that this weapon was designed to hunt Xenomoprhs as part of a rite of passage trial. But it is shown to work just fine on humans, too. The Nerf blaster used in this project probably won’t faze a Xenomorph, but it is able to automatically target people. That targeting is handled by TensorFlow Lite, which utilizes machine learning to recognize objects. That is running on a Raspberry Pi 4 Model B that has been upgraded with a Google Coral Edge TPU to dramatically improve the overall performance and speed of the object recognition model.
When the TensorFlow Lite model detects a person, it will draw a bounding rectangle around them. The center point of that rectangle is then calculated and the camera is moved so the center of the frame moves to that point. That is a Raspberry Pi camera that is attached to the front of the Nerf blaster, which is, in turn, attached to a Pimoroni Pan-Tilt HAT. The center of the camera frame is effectively where the Nerf darts will land, so moving that to point at the middle of a person’s bounding box usually results in a hit when the blaster is fired. A simple wireless relay module is used to actually trigger the blaster to fire. A bunch of batteries are used to power all of those components, which are all mounted to a harness. The Nerf blaster is, of course, attached to the shoulder. The movement motors are a bit jittery, but this proves that technology that was once purely science fiction is now attainable using off-the-shelf parts.