8Blaster Brains and Eyes

Before we get too much farther in the build, let’s take a quick break to go through the blaster’s basic logic:

Find target → Move toward target → If target is dead ahead, fire blaster

Based on the components we’ve amassed, let’s use this logic to identify who or what is responsible for each step.

1. The webcam on top of the turret will send the video to Processing. This is how the target will be found.

2. Processing, via the OpenCV library (remember—a few chapters back?), looks for a target. When it finds one, it notes the target’s placement in relation to the center of the webcam video. If the target is to the right of center, we’ll need the blaster to move to the right. If it’s to the left, we’ll move left. So, based ...

Get Build Your Own Autonomous NERF Blaster now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.