USB rocket launcher + webcam + face tracking = sentinel.py
Python Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Sentinel

Sentinel is a cross-platform USB missile launcher face-tracking solution. It will attempt to track faces, continually point the missile launcher at the clearest face, and optionally shoot foam missiles.

Impress your friends! Intimidate your enemies!

Demonstration of Sentinel

1. How it Works
1.1. Video Demonstration
2. Hardware Requirements
3. Software Requirements and Installation
3.1. Linux
3.2. Windows
3.3. Mac OS X
4. Usage

1. How it Works

I wrote an article about how we implemented Sentinel using OpenCV.

1.1. Video Demonstration

Here's a quick video that we put together due to popular demand. Sentinel is usually significantly faster at homing in on the target, but our computers were bogged down while we were recording the video.

Link to Youtube video

2. Hardware Requirements

3. Software Requirements and Installation

3.1. Linux

If you're on Ubuntu 12.04+ or Debian (tested with Linux Mint Debian), you can simply run the included installation script:

> sudo install/ubuntu_debian.sh

Otherwise (or if the script doesn't work for you), install the following dependencies:

  • Python 2.7, 32-bit
  • libusb 1.0 (in Ubuntu/Debian, sudo apt-get install libusb-dev)
  • PyUSB 1.0 (https://github.com/walac/pyusb)
  • OpenCV 2.3+ with Python bindings
    • In Ubuntu 12.04+ or latest Debian, sudo apt-get install python-opencv will install the correct version
    • In older versions of Ubuntu, you can follow these instructions or use this bash script (tested with 11.10)
    • In ArchLinux, pacman -S python2-numpy then pacman -S opencv 2.4.0_a-4
  • streamer (in Ubuntu/Debian, sudo apt-get install streamer)
  • ImageMagick (in Ubuntu/Debian, sudo apt-get install imagemagick)

After installing all of the software requirements, you can run Sentinel:

> sudo ./sentinel.py

3.2. Windows

Install the following dependencies:

After installing all of the software requirements, you can run Sentinel from Python IDLE or from the command line:

> C:\Python27\python sentinel.py

3.3. Mac OS X

If you have Homebrew, you can simply run the included installation script:

> sudo install/mac_osx.sh

Otherwise (or if the script doesn't work for you), install the following dependencies:

  • Python 2.7, 32-bit (if not pre-installed)
  • libusb 1.0 (sudo port install libusb or sudo brew install libusb-devel +universal)
  • PyUSB 1.0 (https://github.com/walac/pyusb)
  • NumPy (pip install numpy)
  • OpenCV 2.3+ with Python bindings (sudo port -v install opencv +python27 or sudo brew install opencv)

After installing all of the software requirements, you can run Sentinel:

> sudo python ./sentinel.py

4. Usage

Usage: sentinel.py [options]

Options:
  -h, --help            show this help message and exit
  -d, --disarm          track faces but do not fire any missiles
  -r, --reset           reset the turret position and exit
  --nd, --no-display    do not display captured images
  -c NUM, --camera=NUM  specify the camera # to use. Default: 0
  -s WIDTHxHEIGHT, --size=WIDTHxHEIGHT
                        image dimensions (recommended: 320x240 or 640x480).
                        Default: 320x240
  -b SIZE, --buffer=SIZE
                        size of camera buffer. Default: 2
  -v, --verbose         detailed output, including timing information