How We Built The Quintessential Sentry Gun: (Updated Sept. 26th)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11
At a glance
Powered by AI
The author built a prototype sentry gun that could track and shoot targets using computer vision algorithms and discussed testing it and plans for future improvements.

 
Sentry Gunhttp://cs-people.bu.edu/aaron/turret/turret.htm1 of 119/26/2005 7:56 PM
How We Built the Quintessential Sentry Gun
(Updated Sept. 26th)
 
VideosFAQHigh-Res Press Photos
test1test2 (NEW!)FAQcut outnot cut outsunstanding
 
Sentry Gunhttp://cs-people.bu.edu/aaron/turret/turret.htm2 of 119/26/2005 7:56 PM
There will be a Mark II version.About the new video: --------------
Test2 actually has the first test we ever did as the last cut. Notice that we hadn't messed withmany of the settings for outdoors, so the gun jumps around a bit because it's detecting Ezra as anumber of blobs. He was also standing too close to the gun, because we weren't aware that itwould track at such long distances. It's also a bit more painful up close...sorry about that, Ez.Another problem was that the gun jumping from blob to blob made the "freeze" setting think ezra was moving...when he wasn't, so it caught us all a little off-guard. I'm glad I could improvethe software during that day of testing. Nothing like freezing and then getting perforated. Thegun swings around at the end because the size threshold wasn't properly set at that point, and itwas trying to aim at leaves and grass. Basically, I just put that shot up there because it's funny.The middle shot is when we're recalibrating the gun because the recoil and turret motion hadmisaligned our camera. You'll also notice that he's able to duck under the motion range of thegun. This was because it was still set up for a smaller tripod. No more ducking for Ez.----------------Okay, "quintessential" might be going a little far, but it's enough to frighten me. The idea of this project was to create a fully-automated sentry gun, capable of picking out a human targetand accurately tracking and shooting him or her in the heart. Really, the idea was to find a coolrobotics project for the summer while I was working at an advertising agency, and I'd only everseen sentry guns in movies (like Congo) and video games (Half-Life 1, Half-Life 2, TeamFortress Classic). I couldn't find any record of anyone building one, even the military, althoughit seems likely I just didn't look hard enough. It's a pretty simple technology. One of my friendsdid mention the Phalanx anti-missile gun, which is of similar design, but uses radar for trackinginstead of an optical method. The Phalanx has been around since the early 80's. He was alsoquick to add that there are some pretty good reasons for not building an optical sentry gun, abig one being that it's generally a good idea to shoot down any missile headed in your direction,but that same philosophy may not be the best when applied to humans. If you're here just to seemy little brother get shot with it, scroll to the bottom. :) I'm sorry this webpage sucks, it will getbetter with time. 
Construction
The first part of this fun little summer project was to write all of the necessary computer code tocontrol the turret. I started by learning Microsoft's DirectShow technology and utilizing theOpenCV library according to the tutorial by R. Laganiere to access the pixels being sent by myweb cam. If you try to use the tutorial, you'll have to use the new library paths for DirectX 9because the ones in the tutorial are a little outdated. I used simple algorithms from a MachineVision course I took at Boston University to develop the aiming program. For those interested,it's just background differencing, thresholding, recursive region segmentation, your standardbinary morphological operators to clean up static, and my own quick algorithm (basicallysimple template matching) to take care of camera shake and reduce background motion
5
 
Sentry Gunhttp://cs-people.bu.edu/aaron/turret/turret.htm3 of 119/26/2005 7:56 PM
interference. A couple of servos from Craigslist and a Mini SSC II servo controller later, I was ready to start. The Mini SSC II didn't come with any code for C++, so I had to write my own control code thatworked through serial. I set up a small test turret that just rotated a laser pointer so I could work out the proper methods for calibrating the turret to the camera view area and aiming data.My little brother, Ezra, helped me assemble the full turret. The gun on the turret is a cheapautomatic Airsoft replica of an FN P90 that shoots .2 gram 6mm BB's. The gun was an obviouschoice because it was light and has an unusual horizontal magazine that made it easier tomount. We used plywood and the extent of my middle school wood shop experience toassemble all of the major components. My uncle helped with some of the trickier woodworkingtechniques.The thumb hole in the P90 made a nice place through which to put a bolt that tightened the twopieces of plywood together. The hole in the middle is for the wooden dowel that we used for anaxle between two bearings from Ace Hardware. The mount consists of three major pieces, thegun attachment (above), the tilt head, and the pan base (below).
5
 
Sentry Gunhttp://cs-people.bu.edu/aaron/turret/turret.htm4 of 119/26/2005 7:56 PM
We used a lazy susan bearing that had an annoying amount of play in it for the main support of the gun weight. Notice the dowel in the center of the bearing. On top is the nylon gear thatconnects to the servo which will turn the tilt head.This is the underside of the tilt head. The part in the middle is the drive shaft of the servo.Those circles are concentric, but the larger circle wasn't evenly drilled. We didn't have a drillpress and usually resorted to repeatedly using a square to make sure the drill was perpendicularto the wood. That didn't work particularly well on this occasion.
5
5
5
5
5
5
5
5

Reward Your Curiosity

Everything you want to read.
Anytime. Anywhere. Any device.
No Commitment. Cancel anytime.
576648e32a3d8b82ca71961b7a986505