Giter Club home page Giter Club logo

kinectkannon's Introduction

Inside KinectKannon - The Semi-autonomous Robotic T-Shirt Cannon

The Kinect Kannon is a semi-autonomous robotic T-Shirt that is augmented by Kinect for Windows which fires by opening a valve releasing approximatley 100 PSI of CO2.

Video

Checkout the Video demo of the KinectKannon.

How its Made

The Kinect Kannon has been put together with mostly store-bought parts. The parts list includes:

The TShirt Cannon is mounted to the Pan and Tilt control with a piece of 2 by 4 wood. This keeps the cannon attached firmly allowing for more precise control.

To secure the Pan/Tilt control, a wooden box was made from oak plywood. This provides a very sturdy base for the control as it will be shifting its center of gravity as the cannon is moved and aimed.

An empty space is provided in the box with a missing wall. Inside are a few things:

  • Power Strip
  • USB 8 Motor Servo Controller (to manipulate pan/tilt)
  • USB Relay controller
  • USB Hub (to reduce clutter)
  • CO2 tank and hose
  • XBOX 360 Wireless USB Adapter

The space allows us to easily tuck away all the wires required to run the cannon, making for easier operation.

2 Single USB cables, one for the Kinect (it requires USB3) and a USB hub for the relay, XBOX controller and servo controller interface to the laptop. With a single plug from a wall outlet to the powers trip within the box, the system comes alive.

What's running on the computer?

A WPF (Windows Presentation Foundation) desktop application is used with the Kinect SDK as well as some auxiliary libraries for the XBOX controller as well as the servo and relay controllers. The application is organized using a high level code behind file for the Main XAML window and a few singleton classes:

  • PanTiltController - A singleton class which provides high level on/off and panning methods.
  • FiringController - A singleton class which provides a 'virtual' safety as well as a high level firing method.
  • Automator - A small class that handles controlling the PanTiltController based on audible or skeletal input.
  • Renderer - A class that handles rendering the color, infrared and skeletal streams.
  • HudRenderer - A class that handles rendering the Heads-up Display
  • App - The main app file which controls high-level states of the application such as tracking mode and the state of the safety.

Rational behind technology decisions

Like any other engineering project, we were under a tight timeline. We had approximately 4 weeks before we needed to showcase it at a large presentation. We chose the path of least resistance.

The Kinect SDK works only on Windows, although there is an open source implementation that can be used on Mac OS X and Linux. The SDK works out of the box seamlessly with the Kinect and already has very nice wrappers for C#. We decided to use the SDK as it provided samples in C# for skeletal, audio and color frame rendering. It made things way faster by simply taking the code examples and organizing them into a larger application.

Why WPF and not a modern Windows 8 App? .NET and Windows APIs have a different surface area for the Windows 8 app environment. In this environment not all APIs available on the desktop are accessible. Although the Kinect SDK v2.0 supports Windows 8 apps, the drivers for the servo controller, relay controller and possibly the open source library for the XBOX controller had dependencies on legacy desktop APIs. We also have no intention of publishing the app on the store because the Kinect Kannon is quite expensive!

How to Operate KinectKannon

The Kinect Kannon is easy to operate but requires a few key pieces of knowledge and warnings.

Warning

CO2 Tank

The CO2 tank when full can contain up to 3000 PSI of gas. This is a very dangerous amount of pressure when mishandled. Here are a few tips to keep you and everyone safe:

  • When flying with the CO2 tanks, TSA regulations require the tanks be emptied AND the valve unscrewed. Refer to the paintball tank labeling for this.
  • When shipping federal regulations require that the CO2 tanks are emptied.
  • Do NOT leave the CO2 tank in your car as the heat may cause it to explode.
  • When attaching and detaching the CO2 tank ensure that you are not unscrewing the valve as this can be deadly.
  • When moving Kinect Kannon, close the CO2 tank valve on the remote line and release and remaining pressure in the cannon by pressing the red button on the electronic valve (pictured below).
  • Always fill it up at a paintball store like Sports Authority

No Range Stops

The Kinect Kannon Pan/Tilt does not return a position to the main application. Therefore Kinect Kannon does not know its position and its up to you to ensure that it does not turn too far left or right, which can RIP OUT CORDS AND CAUSE TERRIBLE DAMAGE. Please be sure to keep an eye on the controller and if the cannon gets out of control for any reason (computer freezes, program crashes etc.) KILL THE POWER TO KINECT KANNON.

Getting Setup

Ensure that you have a fast dedicated machine to use. You need an i7 Surface Pro 3, Lenovo X1 Carbon or faster.]

Install the following:

Running Kinect Kannon

Clone this repository and open the solution file.

Ensure that Kinect Kannon is powered on by plugging in the powers trip to a wall power outlet. Plugin the Kinect USB cable and the USB hub cable to the laptop. Ensure that at least the Kinect USB cable is plugged into a USB 3.0 (blue) port.

Press F5 to run the application, it will say 'Kinect Kannon Fully Initialized'. The Kinect Kannon camera should render on the screen with cross hairs and on the top left the System Status should read Operational.

To pair an XBOX 360 controller to the cannon, press the wireless pairing button on top of your controller (not the XBOX button) and press the pairing button on the wireless adapter. After a few seconds it should kinect and you are ready to operate Kinect Kannon.

Operating Kinect Kannon

When you start up the Kinect Kannon you will be presented with the Camera (Color Stream) and Heads Up Display (HUD).

Kinect Kannon has 3 operational modes:

  • Manual Mode
  • Skeletal Tracking Mode
  • Audible Trackign Mode

Manual Mode

In manual mode you can control Kinect Kannon on the X and Y axis by moving the left analog stick. This mode is the default mode of Kinect Kannon and can be reached by pressing X on the XBOX control.

Skeletal Mode

In skeletal mode, you cannon control the Kinect Kannon in either the X or Y direction. The Kannon will move to track any detected skeletons in its view. To change the targeted skeleton press Left and Right on the directional pad (this only works if there is > 1 skeleton on the screen). Press A on the XBOX control to get to this mode.

Audible Mode

Audible mode prevents you from controlling Kinect Kannon in the X direction but you can control it in the Y direction. Kinect Kannon will autonomously pan left and right depending on point sounds it recognizes from its directional microphone. Press B on the XBOX control to get to this mode.

Night vision

The Kinect is equipped with an infrared sensor and therefore can see at night. Press Y on the controller to activate night vision mode. This doesn't change any functionality of Kinect Kannon - skeletal and audible tracking work the same.

The video window will be a bit smaller because Kinect's infrared resolution is smaller than its camera.

Firing the Kinect Kannon

In all modes you can control the firing and for safety reasons, Kinect Kannon will NEVER fire on its own.

To fire the control follow these steps:

  1. Ensure that the Kinect Kannon is loaded with a rolled, rubberbanded T-Shirt
  2. Ensure that the CO2 tank is attached to the remote line and that the remote line valve is open.
  3. On your XBOX controller, press the left and right triggers simultaneously. This deactivates the safety and Kinect Kannon will say 'System Armed. Pull Both Triggers Simultaneously to Fire'. The Safety Status on the HUD will say 'ENGAGED - READY TO FIRE'.
  4. Ensure that nobody is directly in front of the Kinect Kannon and do not aim it directly at anyone. Pull both left and right triggers and with a loud noise, the T-Shirt should be launched!

kinectkannon's People

Contributors

nathanielrose avatar sedouard avatar seeingsounds avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kinectkannon's Issues

Integrate Wireless Xbox 360 Controller

The Xbox 360 game controller can be used with a PC. The code is already setup to use the Keyboard which should be the same interface as a controller.

Using this guide http://www.ehow.com/how_6207835_use-xbox-360-controller-pc.html, we can purchase a Xbox 360 wireless receiver and use the game pad as an input device.

There should be a intuitive mapping for game controller buttons for the application. (For example, the right trigger should be the final thin in the firing sequence to fire the cannon).

Servo Controller Code Integration

The Servo Controller we will use is:
http://www.trossenrobotics.com/p/phidget-advanced-usb-servo-controller.aspx

There is a .NET API Documentation here:

http://www.phidgets.com/documentation/web/NETDoc/Index.html

We need a Servo Controller class that can:

  1. Set the position of a servo
  2. Read and verify position of a servo
  3. Offer a high-level pan/tilt API to be used by the keyboard control AND autonomous control code (for skeletal and audio tracking).
  4. Ensure that Servos NEVER go past an acceptable range to avoid damage to hardware.

Autonomous Pan/Tilt X-Y Control Needed

When in skeletal mode you can track a particular skeleton as a target. The application should be able to direct the CannonX and CannonY values toward the target. When the target is within 200 pixels if the center of the image it should return those Values to 0.

This simulates moving the Pan/Tilt controller allowing for targeting.

Firing Controller Needed

We will be using a Phidgets Relay board found here:
http://www.trossenrobotics.com/p/phidgets-004.aspx

The .NET APIs can be found here:
http://www.phidgets.com/documentation/web/NETDoc/Index.html

A 'Firing Controller' is needed to:

  1. Signal the relay controller to ON or OFF (this signal will launch the T-shirt cannon)
  2. Most importantly, implement the logic of the safety process to enable the cannon to be Fired.

In addition, additional UI must be added to the HudRenderer to reflect how the user can enable the cannon to be fired.

Add Voice/Music Feedback

The speech synthesis class (or just pre-recorded audio) should be used to add music and voice to the user experience.

  1. A noise or a female robotic voice 'Target Aquired' should play when in SKELETAL tracking

  2. Background music/noise would be great as well (not so much it would ruin audible tracking)

There exists a speech synthesis library which can probably do a robotic sounding voice pretty easily:

http://msdn.microsoft.com/en-us/library/system.speech.synthesis.speechsynthesizer(v=vs.110).aspx

'Night Vision' Mode

We should be able to switch the color stream to a 'night vision' stream using the infrared stream from the Kinect. This will add a cool effect.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.