Kinect to Netduino [Cross post]

The next in our Kinecting to Hardware week is kind of a cheat. I've already written and published this project, but on the Coding4Fun Blog, Connecting your Netduino to your Kinect, and not here in the Gallery. So incase you missed it there, I'll cover it again here (in Gallery form). Also coincidently, this the first in a project author double-shot...


This code is an example of how the Kinect's gesture recognition features could be used to control a servo via a Netduino


David Catuhe has dome some hard work to add gesturing support on top of the Microsoft Kinect SDK. The links below describe how the gesturing library works and from where it can be downloaded.

This YouTube video demonstrates what the code in this repository will produce when fully used. * Demonstration YouTube video

Setup/Install Notes
    • Get the Netduino Plus connected to your machine via USB
    • Plug the Plus into the network via an Ethernet cable
    • Configure the Plus using MFDeploy to get the networking connection working
    • Hook a servo up to the Netduino Plus on one of the digital pins that supports PWM - 5,6,9, or 10 according to The Netduino Spec Page
    • Deploy the code to the Netduino Plus, or debug on it directly. Note, the default port is 8080, so the URL will be http://[PLUS.IP.Address.Here]:8080/servo/180 where 180 is the angle, between 0 and 180, to which you wish to have the servo turn.
      • Modify the Kinect GUI code so that it points to your Netduino Plus URL. Specifically, there is a line of code in the WebServoClient.cs file that reads string urlBase = "http://YOUR-NETDUINO-IP-HERE:8080/servo/{0}"; that you'll need to change.
    • Hook up your Kinect
    • Try to browse to your Netduino Plus URL until you see your servo respond.
    • Run the GUI code. You might want to tinker with the example code provided on the Kinect Toolkit CodePlex page to get a handle on the sensitivity, or disable the code in the GUI that calls the Netduino URL until you're comfortable gesturing and seeing the Kinect pick up your behavior on the screen.
    • If everything is communicating properly, you should see your Netduino Servo respond accordingly.

Project Information URL:

Project Source URL:






    void OnGestureDetected(string gesture)
        swipeLeft.Background = new SolidColorBrush(Colors.White);
        swipeRight.Background = new SolidColorBrush(Colors.White);
        if (gesture.Equals("SwipeToLeft", StringComparison.CurrentCultureIgnoreCase))
            swipeLeft.Background = new SolidColorBrush(Colors.Red);
        if (gesture.Equals("SwipeToRight", StringComparison.CurrentCultureIgnoreCase))
            swipeRight.Background = new SolidColorBrush(Colors.Red);
    void OnVideoFrameReady(object sender, ImageFrameReadyEventArgs e)
        kinectDisplay.Source = streamManager.Update(e);
    void OnSkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
    void ProcessFrame(ReplaySkeletonFrame frame)
        Dictionary<int, string> stabilities = new Dictionary<int, string>();
        foreach (var skeleton in frame.Skeletons)
            if (skeleton.TrackingState != SkeletonTrackingState.Tracked)
            barycenterHelper.Add(skeleton.Position.ToVector3(), skeleton.TrackingID);
            stabilities.Add(skeleton.TrackingID, barycenterHelper.IsStable(skeleton.TrackingID) ? "Stable" : "Unstable");
            if (!barycenterHelper.IsStable(skeleton.TrackingID))
                .First(j => j.ID.Equals(JointID.HandRight)).Position, 

Contact Information:

Follow the discussion

  • Oops, something didn't work.

    Getting subscription
    Subscribe to this conversation

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.