<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Tech Off - Kinect Wave Gesture Recognition</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Tech Off - Kinect Wave Gesture Recognition</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Thu, 23 May 2013 21:25:58 GMT</pubDate>
	<lastBuildDate>Thu, 23 May 2013 21:25:58 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>4</c9:totalResults>
	<c9:pageCount>-4</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Tech Off - Kinect Wave Gesture Recognition</title>
		<description><![CDATA[<p>I'm using the code from a textbook &quot;Beginning Kinect Programming with the Microsoft Kinect SDK&quot; from chapter 6 wave gesture part. However, I've got 2 errors:&nbsp;</p><p>1. Inconsistent accessibility: parameter type 'WaveGesture.MainWindow.WaveGestureState' is less accessible than method 'WaveGesture.MainWindow.UpdateState (WaveGesture.MainWindow.WaveGestureState, long)'</p><p>2. Inconsistent accessibility: parameter type 'WaveGesture.MainWindow.WavePosition' is less accessible than method 'WaveGesture.MainWindow.UpdatePosition (WaveGesture.MainWindow.WavePosition, long)'</p><p>If I change those enumerations to public, I get so many errors. Can anyone please tell me whats wrong?</p><p>The code:<pre class="brush: csharp">
private enum WavePosition
        {
            None = 0,
            Left = 1,
            Right = 2,
            Neutral = 3
        }

        private enum WaveGestureState
        {
            None = 0,
            Success = 1,
            Failure = 2,
            InProgress = 3
        }

        private struct WaveGestureTracker
        {
            public void Reset()
            {
                IterationCount = 0;
                State = GestureState.None;
                Timestamp = 0;
                StartPosition = WavePosition.None;
                CurrentPosition = WavePosition.None;
            }

            public int IterationCount;
            public WaveGestureState State;
            public long Timestamp;
        }

        public class WaveGesture
        {
            private const float WAVE_THRESHOLD = 0.1f;
            private const int WAVE_MOVEMENT_TIMEOUT = 5000;
            private const int REQUIRED_ITERATIONS = 4;
            private WaveGestureTracker[,] _PlayerWaveTracker = new WaveGestureTracker[6, 2];
            public event EventHandler GestureDetected;

            public void Update(Skeleton[] skeletons, long frameTimestamp)
            {
                if (skeletons != null)
                {
                    Skeleton skeleton;
                    for (int i = 0; i &lt; skeletons.Length; i&#43;&#43;)
                    {
                        skeleton = skeletons[i];
                        if (skeleton.TrackingState != SkeletonTrackingState.NotTracked)
                        {
                            TrackWave(skeleton, true,
                            ref this._PlayerWaveTracker[i, LEFT_HAND], frameTimestamp);
                            TrackWave(skeleton, false,
                            ref this._PlayerWaveTracker[i, RIGHT_HAND], frameTimestamp);
                        }
                        else
                        {
                            this._PlayerWaveTracker[i, LEFT_HAND].Reset();
                            this._PlayerWaveTracker[i, RIGHT_HAND].Reset();
                        }
                    }
                }
            }

        }

        private void TrackWave(Skeleton skeleton, bool isLeft, ref WaveGestureTracker tracker, long timestamp)
        {
            JointType handJointId = (isLeft) ? JointType.HandLeft : JointType.HandRight;
            JointType elbowJointId = (isLeft) ? JointType.ElbowLeft : JointType.ElbowRight;
            Joint hand = skeleton.Joints[handJointId];
            Joint elbow = skeleton.Joints[elbowJointId];

            if (hand.TrackingState != JointTrackingState.NotTracked &amp;&amp; elbow.TrackingState != JointTrackingState.NotTracked)
            {
                if (tracker.State == WaveGestureState.InProgress &amp;&amp; tracker.Timestamp &#43; WAVE_MOVEMENT_TIMEOUT &lt; timestamp)
                {
                    tracker.UpdateState(WaveGestureState.Failure, timestamp);
                }
                else if (hand.Position.Y &gt; elbow.Position.Y)
                {
                    //Using the raw values where (0, 0) is the middle of the screen.
                    //From the user's perspective, the X-Axis grows more negative left
                    //and more positive right.
                    if (hand.Position.X &lt;= elbow.Position.X - WAVE_THRESHOLD)
                    {
                        tracker.UpdatePosition(WavePosition.Left, timestamp);
                    }
                    else if (hand.Position.X &gt;= elbow.Position.X &#43; WAVE_THRESHOLD)
                    {
                        tracker.UpdatePosition(WavePosition.Right, timestamp);
                    }
                    else
                    {
                        tracker.UpdatePosition(WavePosition.Neutral, timestamp);
                    }

                    if (tracker.State != WaveGestureState.Success &amp;&amp; tracker.IterationCount == REQUIRED_ITERATIONS)
                    {
                        tracker.UpdateState(WaveGestureState.Success, timestamp);

                        if (GestureDetected != null)
                        {
                            GestureDetected(this, new EventArgs());
                        }
                    }
                }
                else
                {
                    if (tracker.State == WaveGestureState.InProgress)
                    {
                        tracker.UpdateState(WaveGestureState.Failure, timestamp);
                    }
                    else
                    {
                        tracker.Reset();
                    }
                }
            }
            else
            {
                tracker.Reset();
            }
        }

        public void UpdateState(WaveGestureState state, long timestamp)
        {
            state = State;
            timestamp = Timestamp;
        }

        public void Reset()
        {
            IterationCount = 0;
            State = WaveGestureState.None;
            Timestamp = 0;
            StartPosition = WavePosition.None;
            CurrentPosition = WavePosition.None;
        }

        public void UpdatePosition(WavePosition position, long timestamp)
        {

            if (CurrentPosition != position)
            {
                if (position == WavePosition.Left || position == WavePosition.Right)
                {
                    if (State != WaveGestureState.InProgress)
                    {
                        State = WaveGestureState.InProgress;
                        IterationCount = 0;
                        StartPosition = position;
                    }

                    IterationCount&#43;&#43;;
                }

                position = CurrentPosition;
                timestamp = Timestamp;
            }
        }</pre></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Kinect-Wave-Gesture-Recognition/23e998817d5148c2ba95a15a00088250#23e998817d5148c2ba95a15a00088250</link>
		<pubDate>Sun, 03 Feb 2013 00:30:58 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Kinect-Wave-Gesture-Recognition/23e998817d5148c2ba95a15a00088250#23e998817d5148c2ba95a15a00088250</guid>
		<dc:creator>Yovi</dc:creator>
		<slash:comments>4</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Yovi/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Kinect Wave Gesture Recognition</title>
		<description><![CDATA[<p>Have you contacted the authors of the book directly? I believe James Avery's contact information is in the &quot;About the Authors&quot; section?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Kinect-Wave-Gesture-Recognition/8d509b5028e34664aacaa15b01576fc0#8d509b5028e34664aacaa15b01576fc0</link>
		<pubDate>Mon, 04 Feb 2013 20:50:24 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Kinect-Wave-Gesture-Recognition/8d509b5028e34664aacaa15b01576fc0#8d509b5028e34664aacaa15b01576fc0</guid>
		<dc:creator>Greg Duncan</dc:creator>
		<slash:comments>4</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/gduncan411/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Kinect Wave Gesture Recognition</title>
		<description><![CDATA[<p>@<a href="/Forums/TechOff/Kinect-Wave-Gesture-Recognition#c8d509b5028e34664aacaa15b01576fc0">gduncan411</a>:&nbsp;I just emailed him. Hopefully he'll reply. Thank you.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Kinect-Wave-Gesture-Recognition/526828b71c8549909860a15f00064b7d#526828b71c8549909860a15f00064b7d</link>
		<pubDate>Fri, 08 Feb 2013 00:22:55 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Kinect-Wave-Gesture-Recognition/526828b71c8549909860a15f00064b7d#526828b71c8549909860a15f00064b7d</guid>
		<dc:creator>Yovi</dc:creator>
		<slash:comments>4</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Yovi/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Kinect Wave Gesture Recognition</title>
		<description><![CDATA[<p>@<a href="/Forums/TechOff/Kinect-Wave-Gesture-Recognition#c23e998817d5148c2ba95a15a00088250">Yovi</a>:&nbsp; The code should go into a WaveGesture class instead of just straight into your MainWindow class.&nbsp; I think you'll find that the compile issues go away if you do this.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Kinect-Wave-Gesture-Recognition/2c19aa6193544b119c30a1610180bfa6#2c19aa6193544b119c30a1610180bfa6</link>
		<pubDate>Sun, 10 Feb 2013 23:20:49 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Kinect-Wave-Gesture-Recognition/2c19aa6193544b119c30a1610180bfa6#2c19aa6193544b119c30a1610180bfa6</guid>
		<dc:creator>James Ashley</dc:creator>
		<slash:comments>4</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/jamesashley/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>