Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


This project was the winner of the 2014 HackKentucky hackathon.

See our ChallengePost submission for more info, including photos and video of our hack in action.

What is this?

This repository allows one to use a USB DreamCheeky dart launcher and a webcam to shoot at or play music for people depending on whether their faces are recognized.

There are two main parts:

  1. A wrapper for to make controlling the dart launcher easier.
  2. Face detection/recognition/training


  • Robbie Cooper
  • Lorinda Peoples
  • Tegjyot Sethi
  • Anuteja Mallampati

Setup and Usage

Disclaimer: As the hackathon was only 24 hours and we no longer have access to the dart launcher, we can't test these instructions thoroughly. If you have any issues or questions, feel free to file an issue or pull request.

Retaliation wrapper

The wrapper lets you specify absolute angles to aim the turret. Without the wrapper, you can only do movement relative to where you are currently aiming. The USB interface does not support introspection about its aim, which is why this wrapper exists.

When the wrapper starts, it will "zero" the turret by moving both left and down until it thinks it can't go any farther.


  • -- Basic USB turret control (see the original repo)
  • -- Absolute aiming by angle
  • -- Absolute aiming by image coordinate

Each one depends on the previous ones.


Dependencies: pyusb, python-urllib3

This should work:

$ sudo apt-get install python-urllib3 python-pip
$ sudo pip install pyusb


$ chmod +x

Controlling the turret

There are two ways to control the turret, and allows aiming the turret at absolute angles relative to a "zero" position. is a wrapper around that maps an XY coordinate in an image to a turret angle. Since it does everything can do plus more, you might as well just use it instead.


You may need to tweak globals in the files to calibrate the turret. The movement speed of the turret is particularly important. It varies depending on how powerful your USB port is. Aiming the turret accurately depends on having a good measurement of this speed. We used a stopwatch to time how long it took for the turret to make a full rotation and calculated the speed from that.

To control the turret directly:

$ ./

This gives you an interactive prompt to control the turret.

Turret> aim Turret> fire <num_shots> Turret> attack (Aims and then fires) Turret> stop Turret> zero (To move back to leftmost lowest position) Turret> reset (If it stops working) Turret> exit

Also, you'll probably have to run as root for it to work. Otherwise, you'll probably lack permissions for the low-level USB control that needs.

$ sudo ./ has the same interface as, but adds the following commands:

WebcamTurret> offsets (Set the current aim without moving, useful when you want to zero manually) WebcamTurret> center (Aim at the center of the image) WebcamTurret> centered (Consider the current aim to be the center of the image) WebcamTurret> image (Aim at the given image coordinate) WebcamTurret> lock (Assume that the webcam is attached to the turret and moves with it--untested) WebcamTurret> unlock (Assume that the webcam is close to the turret, but not connected to it--default behavior)

Face recognition and detection and spotify integration

Depends on:

  • spotify api (python library included here?)
  • espeak
  • opencv

See these files:

  • -- Train the face recognition
  • -- Run the entire MDDS system. Remember: you'll probably need sudo for USB.

Spotify api key

You'll need a file named spotify_appkey.key.

Other info

The dataset files are in the att_faces folder

  • is used for recording faces for positive dataset
  • uses Eigen Faces to classify the detected faces
  • reads the live feed and classifies the faces
  • fetches starred playlist of user
  • uses the username and reads the songs list off of the data.txt file and then uses it to play music.