Middleware :
authorbastiena
Mon, 19 Mar 2012 18:24:59 +0100
changeset 6 93dfb08dcc97
parent 5 d40f84d77db4
child 7 8a21bec5d45f
Middleware : User position events + detector (proximity). More parameters, like proximity bounds.
middleware/src/App.config
middleware/src/Debug/DebugParameters.xaml
middleware/src/Debug/DebugParameters.xaml.cs
middleware/src/Debug/DebugWindow.xaml.cs
middleware/src/Tracking/Events/UserPositionEventArgs.cs
middleware/src/Tracking/Events/UserPositionListener.cs
middleware/src/Tracking/Gestures/UserPositionDetector.cs
middleware/src/Tracking/KinectMain.cs
middleware/src/Trakers.csproj
--- a/middleware/src/App.config	Mon Mar 19 10:21:56 2012 +0100
+++ b/middleware/src/App.config	Mon Mar 19 18:24:59 2012 +0100
@@ -3,6 +3,9 @@
   <appSettings>
     <add key="searchMinDistance" value="1,0"/>
     <add key="searchMaxDistance" value="1,5"/>
+    <add key="minDistance" value="1,0"/>
+    <add key="maxDistance" value="4,0"/>
+    <add key="zeroPoint" value="1,7"/>
     <add key="connexionHost" value="127.0.0.1"/>
     <add key="connexionPort" value="80"/>
     <add key="timerElapsing" value="1000"/>
--- a/middleware/src/Debug/DebugParameters.xaml	Mon Mar 19 10:21:56 2012 +0100
+++ b/middleware/src/Debug/DebugParameters.xaml	Mon Mar 19 18:24:59 2012 +0100
@@ -12,7 +12,7 @@
     L'intervalle de temps entre le début et la fin du timer pour la détection des gestures.
 -->
     
-<Window x:Class="Trakers.Debug.DebugParameters" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="DebugParameters" Height="300" Width="300" Closed="Window_Closed">
+<Window x:Class="Trakers.Debug.DebugParameters" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="DebugParameters" Height="380" Width="300">
     <Grid>
         <StackPanel>
             <Label Content="Limites du champ de recherche (ex : 1.5 - 2) [1, 4] :" Height="30" HorizontalAlignment="Left" Name="label1" VerticalAlignment="Top" Width="300" />
@@ -20,17 +20,26 @@
                 <Grid.RowDefinitions>
                     <RowDefinition Height="30" />
                     <RowDefinition Height="30" />
+                    <RowDefinition Height="30" />
+                    <RowDefinition Height="30" />
+                    <RowDefinition Height="30" />
                 </Grid.RowDefinitions>
                 <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="20*" />
-                    <ColumnDefinition Width="80*" />
+                    <ColumnDefinition Width="30*" />
+                    <ColumnDefinition Width="70*" />
                 </Grid.ColumnDefinitions>
                 
                 <!-- Limites min et max du champ de recherche. -->
-                <Label Grid.Row="0" Grid.Column="0" Content="Min :" Height="25" HorizontalAlignment="Left" Name="label2" VerticalAlignment="Top" />
+                <Label Grid.Row="0" Grid.Column="0" Content="Min Mains :" Height="25" HorizontalAlignment="Left" VerticalAlignment="Top" />
                 <TextBox Grid.Row="0" Grid.Column="1" Height="25" HorizontalAlignment="Left" Name="searchMinDistanceTB" VerticalAlignment="Top" Width="120" />
-                <Label Grid.Row="1" Grid.Column="0" Content="Max :" Height="25" HorizontalAlignment="Left" Name="label3" VerticalAlignment="Top" />
+                <Label Grid.Row="1" Grid.Column="0" Content="Max Mains :" Height="25" HorizontalAlignment="Left" VerticalAlignment="Top" />
                 <TextBox Grid.Row="1" Grid.Column="1" Height="25" HorizontalAlignment="Left" Name="searchMaxDistanceTB" VerticalAlignment="Top" Width="120" />
+                <Label Grid.Row="2" Grid.Column="0" Content="Min :" Height="25" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                <TextBox Grid.Row="2" Grid.Column="1" Height="25" HorizontalAlignment="Left" Name="minDistanceTB" VerticalAlignment="Top" Width="120" />
+                <Label Grid.Row="3" Grid.Column="0" Content="Max :" Height="25" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                <TextBox Grid.Row="3" Grid.Column="1" Height="25" HorizontalAlignment="Left" Name="maxDistanceTB" VerticalAlignment="Top" Width="120" />
+                <Label Grid.Row="4" Grid.Column="0" Content="Zero :" Height="25" HorizontalAlignment="Left" VerticalAlignment="Top" />
+                <TextBox Grid.Row="4" Grid.Column="1" Height="25" HorizontalAlignment="Left" Name="zeroPointTB" VerticalAlignment="Top" Width="120" />
             </Grid>
             
             <Label Content="Serveur TUIO :" Height="30" HorizontalAlignment="Left" Name="label4" VerticalAlignment="Top" Width="300" />
--- a/middleware/src/Debug/DebugParameters.xaml.cs	Mon Mar 19 10:21:56 2012 +0100
+++ b/middleware/src/Debug/DebugParameters.xaml.cs	Mon Mar 19 18:24:59 2012 +0100
@@ -55,6 +55,9 @@
         {
             searchMinDistanceTB.Text = kinectMain.getMinDistHands().ToString();
             searchMaxDistanceTB.Text = kinectMain.getMaxDistHands().ToString();
+            minDistanceTB.Text = kinectMain.getMinDistHands().ToString();
+            maxDistanceTB.Text = kinectMain.getMaxDistHands().ToString();
+            zeroPointTB.Text = kinectMain.getMinDistHands().ToString();
             connexionHostTB.Text = kinectMain.getConnexionHost();
             connexionPortTB.Text = kinectMain.getConnexionPort().ToString();
             timerElapsingTB.Text = kinectMain.getTimerElapsing().ToString();
@@ -71,10 +74,15 @@
 
                 float minDistHands = float.Parse(searchMinDistanceTB.Text);
                 float maxDistHands = float.Parse(searchMaxDistanceTB.Text);
+                float minDist = float.Parse(searchMinDistanceTB.Text);
+                float maxDist = float.Parse(searchMaxDistanceTB.Text);
+                float zeroPoint = float.Parse(searchMinDistanceTB.Text);
                 int connexionPort = int.Parse(connexionPortTB.Text);
                 int timerElapsing = int.Parse(timerElapsingTB.Text);
 
-                if (maxDistHands <= 0 || minDistHands <= 0 || maxDistHands > 4 || minDistHands > 4 || minDistHands >= maxDistHands || connexionPort < 0 || timerElapsing < 0)
+                if (maxDistHands <= 0f || minDistHands <= 0f || maxDistHands > maxDist || minDistHands > maxDist ||
+                minDistHands >= maxDistHands || zeroPoint < maxDistHands || minDistHands < minDist ||
+                zeroPoint >= maxDist || connexionPort < 0 || timerElapsing < 0)
                 {
                     ExceptionInParametersLbl.Content = rm.GetString("loadParametersIncorrect");
                 }
@@ -82,6 +90,9 @@
                 {
                     kinectMain.setMinDistHands(minDistHands);
                     kinectMain.setMaxDistHands(maxDistHands);
+                    kinectMain.setMinDistHands(minDist);
+                    kinectMain.setMaxDistHands(maxDist);
+                    kinectMain.setMinDistHands(zeroPoint);
                     kinectMain.setConnexionHost(connexionHostTB.Text);
                     kinectMain.setConnexionPort(connexionPort);
                     kinectMain.setTimerElapsing(timerElapsing);
@@ -106,13 +117,5 @@
         {
             setParameters();
         }
-
-        /*
-         * Méthode appelée à la fermeture de la fenêtre de paramétrage.
-         */
-        private void Window_Closed(object sender, EventArgs e)
-        {
-            
-        }
     }
 }
--- a/middleware/src/Debug/DebugWindow.xaml.cs	Mon Mar 19 10:21:56 2012 +0100
+++ b/middleware/src/Debug/DebugWindow.xaml.cs	Mon Mar 19 18:24:59 2012 +0100
@@ -210,6 +210,11 @@
             }
         }
 
+        public void showProximity(UserPositionEventArgs e)
+        {
+
+        }
+
         /*
         * Affiche la détection de la main droite via un label.
         */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/middleware/src/Tracking/Events/UserPositionEventArgs.cs	Mon Mar 19 18:24:59 2012 +0100
@@ -0,0 +1,40 @@
+/*
+ * Projet : TraKERS
+ * Module : MIDDLEWARE
+ * Sous-Module : Tracking/Events
+ * Classe : UserPositionEventArgs
+ * 
+ * Auteur : alexandre.bastien@iri.centrepompidou.fr
+ * 
+ * Fonctionnalités : Cette classe contient les membres utilisés lors de l'appel au listener correspondant
+ * à l'événement : L'utilisateur se déplace dans la zone de détection.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Trakers.Communication;
+
+namespace Trakers.Tracking.Events
+{
+    public class UserPositionEventArgs : EventArgs
+    {
+        //Fenêtre de debug.
+        public readonly Debug.DebugWindow debug;
+        //Serveur TUIO.
+        public readonly Server server;
+        //Distance à Kinect.
+        public readonly float distance;
+
+        /*
+        * Constructeur : Il prend l'affichage de debug, le serveur TUIO et la distance à Kinect.
+        */
+        public UserPositionEventArgs(Debug.DebugWindow _debug, Server _server, float _distance)
+        {
+            debug = _debug;
+            server = _server;
+            distance = _distance;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/middleware/src/Tracking/Events/UserPositionListener.cs	Mon Mar 19 18:24:59 2012 +0100
@@ -0,0 +1,37 @@
+/*
+ * Projet : TraKERS
+ * Module : MIDDLEWARE
+ * Sous-Module : Tracking/Events
+ * Classe : UserPositionListener
+ * 
+ * Auteur : alexandre.bastien@iri.centrepompidou.fr
+ * 
+ * Fonctionnalités : Ce listener écoute l'événement du type : L'utilisateur s'est déplacé dans la zone de
+ * détection.
+ * Il contient le code a être éxecuté au cas où cet événement survient, à savoir :
+ * - On affiche un visuel dans le debug.
+ * - On notifie le serveur TUIO.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Trakers.Tracking.Events
+{
+    public class UserPositionListener
+    {
+        /*
+        * Méthode appelée lorsque on a l'événement : L'utilisateur s'est déplacé dans la zone de détection.
+        */
+        public void ShowOnScreen(object o, UserPositionEventArgs e)
+        {
+            //On l'indique dans le debug.
+            //e.debug.showProximity(e);
+            Console.Out.WriteLine(e.distance);
+            //On notifie le serveur TUIO.
+            //e.server.LeftHandQuit(o, e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/middleware/src/Tracking/Gestures/UserPositionDetector.cs	Mon Mar 19 18:24:59 2012 +0100
@@ -0,0 +1,141 @@
+/*
+ * Projet : TraKERS
+ * Module : MIDDLEWARE
+ * Sous-Module : Tracking/Gestures
+ * Classe : UserPositionDetector
+ * 
+ * Auteur : alexandre.bastien@iri.centrepompidou.fr
+ * 
+ * Fonctionnalités : Permet de détecter si l'utilisateur s'est déplacé dans la zone de détection, en se basant
+ * sur la distance de l'utilisateur à Kinect.
+ */
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Trakers.Tracking.Gestures
+{
+    public class UserPositionDetector
+    {
+        Debug.DebugWindow debug;
+
+        float minDistance, maxDistance, zeroPoint;
+        float searchMinDistance, searchMaxDistance;
+
+        static int n = 0;
+
+        /*
+         * Le constructeur prend en entrée le debug mais aussi les principales distances qui délimitent la
+         * zone de détection.
+         */
+        public UserPositionDetector(Debug.DebugWindow _d, float _minDistance, float _maxDistance, float _zeroPoint, float _searchMinDistance, float _searchMaxDistance)
+        {
+            minDistance = _minDistance;
+            maxDistance = _maxDistance;
+            searchMinDistance = _searchMinDistance;
+            searchMaxDistance = _searchMaxDistance;
+            zeroPoint = _zeroPoint;
+            debug = _d;
+        }
+
+        /*
+         * Getters et Setters des distances (dans le cadre d'une modification des paramètres).
+         */
+        public void setMinDistance(float dist)
+        {
+            minDistance = dist;
+        }
+        public void setMaxDistance(float dist)
+        {
+            maxDistance = dist;
+        }
+        public void setSearchMinDistance(float dist)
+        {
+            searchMinDistance = dist;
+        }
+        public void setSearchMaxDistance(float dist)
+        {
+            searchMaxDistance = dist;
+        }
+        public void setZeroPoint(float dist)
+        {
+            zeroPoint = dist;
+        }
+        public void setParams(float minDist, float maxDist, float minDistHands, float maxDistHands, float zero)
+        {
+            //On charge tous les paramètres d'un coup.
+            minDistance = minDist;
+            maxDistance = maxDist;
+            searchMinDistance = minDistHands;
+            searchMaxDistance = maxDistHands;
+            zeroPoint = zero;
+        }
+
+        public float getMinDistance()
+        {
+            return minDistance;
+        }
+        public float getMaxDistance()
+        {
+            return maxDistance;
+        }
+        public float getSearchMinDistance()
+        {
+            return searchMinDistance;
+        }
+        public float getSearchMaxDistance()
+        {
+            return searchMaxDistance;
+        }
+        public float getZeroPoint()
+        {
+            return zeroPoint;
+        }
+
+        /*
+         * Lit la position de l'utilisateur à Kinect et ressort un pourcentage de proximité.
+         * Règles : Droite affine de coefficient négatif.
+         * .
+         */
+        public float CalcProximity(float distance)
+        {
+            //Si on se trouve trop loin.
+            if (distance > maxDistance)
+                return 0.0f;
+            //Si on se trouve trop près.
+            if (distance < searchMinDistance)
+                return 0.0f;
+            //Si on n'est pas encore trop près mais qu'on dépasse le point zéro.
+            if (distance < zeroPoint)
+                return 100.0f;
+
+            //Equation, de droite affine à partir de deux points.
+            //Ici 99 tout simplement car 100 - 1, les limites de pourcentage de proximité.
+            float a = 99/((float)zeroPoint - maxDistance);
+            float b = 100 - a * zeroPoint;
+
+            return a * distance + b;
+        }
+
+        /*
+         * Estime le nombre de vidéos à afficher en fonction du pourcentage de proximité et du nombre de
+         * vidéos dans la mosaïque.
+         * .
+         */
+        public int ImagesToShow(float proximity, int N)
+        {
+            //Si la proximité est nulle, on retourne 0.
+            if (proximity == 0f)
+                return 0;
+            //Si on n'est pas encore trop près mais qu'on dépasse le point zéro.
+            if (proximity >= 90f)
+                return N;
+
+            //Pour chaque intervalle de déciles (dans les pourcentages), le nombre de dizaines
+            //du pourcentage de proximité plus un, fois le nombre de dizaines d'images seront affichées.
+            return (((int)proximity / 10) + 1) * ((int)N / 2);
+        }
+    }
+}
--- a/middleware/src/Tracking/KinectMain.cs	Mon Mar 19 10:21:56 2012 +0100
+++ b/middleware/src/Tracking/KinectMain.cs	Mon Mar 19 18:24:59 2012 +0100
@@ -56,6 +56,8 @@
     public delegate void PushHandler(object o, PushEventArgs e);
     //Il s'agit de la fonction permettant d'appeler les fonctions des événements Jump.
     public delegate void JumpHandler(object o, JumpEventArgs e);
+    //Il s'agit de la fonction permettant d'appeler les fonctions des événements de proximité.
+    public delegate void UserPositionHandler(object o, UserPositionEventArgs e);
 
     public class KinectMain
     {
@@ -74,10 +76,15 @@
         private PushDetector pushDetector;
         //Détecteur de jumps.
         private JumpDetector jumpDetector;
+        //Détecteur de proximité.
+        private UserPositionDetector userPositionDetector;
 
         //Distances min/max délimitant le champ de recherche.
         private float minDistHands;
         private float maxDistHands;
+        private float minDist;
+        private float maxDist;
+        private float zeroPoint;
 
         //Temps de rafraichissement pour le timer (Détection de gesture dans le serveur TUIO).
         private int timerElapsing;
@@ -96,6 +103,8 @@
         public static event PushHandler PushEvent;
         //L'événement jump.
         public static event JumpHandler JumpEvent;
+        //L'événement l'utilisateur se déplace dans la zone de détection.
+        public static event UserPositionHandler UserPositionEvent;
 
         private string connexionHost;
         private int connexionPort;
@@ -112,24 +121,29 @@
             //On crée la fenêtre de debug.
             debug = new Debug.DebugWindow(this);
             
-            //On crée les détecteurs de gestes.
-            swipeDetector = new SwipeDetector(debug);
-            pushDetector = new PushDetector(debug);
-            jumpDetector = new JumpDetector(debug);
-
             //On tente de charger les paramètres du fichier params.ini.
             //Si on n'y arrive pas, on affiche une erreur et on charge les paramètres par défaut.
             if (!loadParameters())
             {
                 debug.ExceptionLbl.Content = rm.GetString("loadParametersFail");
                 //Distances de détection des mains par défaut pour la recherche (ici de 1m à 2m de la Kinect).
-                minDistHands = (float)1.0;
-                maxDistHands = (float)1.5;
+                minDistHands = 1.0f;
+                maxDistHands = 1.5f;
+                minDist = 1.0f;
+                maxDist = 4.0f;
+                zeroPoint = 1.7f;
                 connexionHost = "127.0.0.1";
                 connexionPort = 80;
                 timerElapsing = 1000;
             }
 
+            //On crée les détecteurs de gestes.
+            swipeDetector = new SwipeDetector(debug);
+            pushDetector = new PushDetector(debug);
+            jumpDetector = new JumpDetector(debug);
+            //On crée le détecteur de proximité.
+            userPositionDetector = new UserPositionDetector(debug, minDist, maxDist, zeroPoint, minDistHands, maxDistHands);
+
             //On affiche la fenêtre de debug.
             try
             {
@@ -211,6 +225,10 @@
             JumpListener jumpListener = new JumpListener();
             JumpEvent += new JumpHandler(jumpListener.ShowOnScreen);
 
+            //Fonction appelée lorsque l'utilisateur se déplace dans la zone de détection.
+            UserPositionListener userPositionListener = new UserPositionListener();
+            UserPositionEvent += new UserPositionHandler(userPositionListener.ShowOnScreen);
+
             //On connecte le serveur à l'adresse locale sur le port 80.
             server = new Server(connexionHost, connexionPort, timerElapsing, debug);
         }
@@ -352,12 +370,6 @@
                 joints.Insert((int)JointType.AnkleRight, ankleRight);
                 joints.Insert((int)JointType.FootRight, footRight);
                 GestureDetector.UpdateSkeletonHistory(joints);
-                
-                //On obtient sa distance à la Kinect.
-                float distance = first.Position.Z;
-
-                //On affiche la distance dans le debug.
-                debug.showDistance(distance);
 
                 //Si la main gauche est dans le champ, on lance l'événement approprié.
                 if (handLeft.Position.Z < maxDistHands && handLeft.Position.Z > minDistHands)
@@ -420,6 +432,41 @@
                     OnJumpEvent(jumpEvent);
                 }*/
 
+                //Si l'utilisateur se déplace dans la zone de détection.
+                //On traite le problème en plusieurs limites, on discrétise la zone.
+                if(first.TrackingState == SkeletonTrackingState.Tracked)
+                {
+                    float proximity = userPositionDetector.CalcProximity(first.Position.Z);
+                    /*if (proximity > 0f && proximity < 25f)
+                    {
+                        Console.Out.WriteLine("1/4");
+
+                    }
+                    else if (proximity > 25f && proximity < 50f)
+                    {
+                        Console.Out.WriteLine("1/2");
+
+                    }
+                    else if (proximity > 50f && proximity < 75f)
+                    {
+                        Console.Out.WriteLine("3/4");
+
+                    }
+                    else if (proximity == 100f)
+                    {
+                        Console.Out.WriteLine("TRUE");
+
+                    }*/
+
+                    if (proximity > 0f)
+                    {
+                        UserPositionEventArgs userPositionEvent = new UserPositionEventArgs(debug, server, proximity);
+                        OnUserPositionEvent(userPositionEvent);
+                    }
+                    else
+                        Console.Out.WriteLine("FAIL");
+                }
+
                 //Dessine le squelette dans le debug.
                 debug.drawJoints(first.Joints, first);
                 debug.showSkeleton(hipCenter, spine, shoulderCenter, head, shoulderLeft, elbowLeft, wristLeft, handLeft, shoulderRight, elbowRight, wristRight, handRight, hipLeft, kneeLeft, ankleLeft, footLeft, hipRight, kneeRight, ankleRight, footRight);
@@ -498,6 +545,16 @@
         }
 
         /*
+        *  Initialise l'événement et fait appel aux fonctions du listener quand l'utilisateur se déplace
+         *  dans la zone de détection.
+        */
+        public static void OnUserPositionEvent(UserPositionEventArgs e)
+        {
+            if (UserPositionEvent != null)
+                UserPositionEvent(new object(), e);
+        }
+
+        /*
         *  Méthode de chargement des paramètres (position du champ de recherche...).
         */
         public bool loadParameters()
@@ -506,6 +563,9 @@
             {
                 minDistHands = (float)double.Parse(ConfigurationManager.AppSettings["searchMinDistance"]);
                 maxDistHands = (float)double.Parse(ConfigurationManager.AppSettings["searchMaxDistance"]);
+                minDist = (float)double.Parse(ConfigurationManager.AppSettings["minDistance"]);
+                maxDist = (float)double.Parse(ConfigurationManager.AppSettings["maxDistance"]);
+                zeroPoint = (float)double.Parse(ConfigurationManager.AppSettings["zeroPoint"]);
                 connexionHost = ConfigurationManager.AppSettings["connexionHost"];
                 connexionPort = int.Parse(ConfigurationManager.AppSettings["connexionPort"]);
                 timerElapsing = int.Parse(ConfigurationManager.AppSettings["timerElapsing"]);
@@ -514,8 +574,10 @@
             {
                 return false;
             }
-            
-            if (maxDistHands <= 0 || minDistHands <= 0 || maxDistHands > 4 || minDistHands > 4 || minDistHands >= maxDistHands)
+
+            if (maxDistHands <= 0f || minDistHands <= 0f || maxDistHands > maxDist || minDistHands > maxDist ||
+                minDistHands >= maxDistHands || zeroPoint < maxDistHands || minDistHands < minDist ||
+                zeroPoint >= maxDist || connexionPort < 0 || timerElapsing < 0)
             {
                 debug.ExceptionLbl.Content = rm.GetString("loadParametersIncorrect");
                 return false;
@@ -528,6 +590,8 @@
          */
         public void updateParameters()
         {
+            userPositionDetector.setParams(minDist, maxDist, minDistHands, maxDistHands, zeroPoint);
+
             //On récupère la config.
             Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
             //On met à jour.
@@ -535,6 +599,12 @@
             config.AppSettings.Settings.Add("searchMinDistance", minDistHands.ToString());
             config.AppSettings.Settings.Remove("searchMaxDistance");
             config.AppSettings.Settings.Add("searchMaxDistance", maxDistHands.ToString());
+            config.AppSettings.Settings.Remove("minDistance");
+            config.AppSettings.Settings.Add("minDistance", minDist.ToString());
+            config.AppSettings.Settings.Remove("maxDistance");
+            config.AppSettings.Settings.Add("maxDistance", maxDist.ToString());
+            config.AppSettings.Settings.Remove("zeroPoint");
+            config.AppSettings.Settings.Add("zeroPoint", zeroPoint.ToString());
             config.AppSettings.Settings.Remove("connexionHost");
             config.AppSettings.Settings.Add("connexionHost", connexionHost);
             config.AppSettings.Settings.Remove("connexionPort");
--- a/middleware/src/Trakers.csproj	Mon Mar 19 10:21:56 2012 +0100
+++ b/middleware/src/Trakers.csproj	Mon Mar 19 18:24:59 2012 +0100
@@ -6,7 +6,7 @@
     <ProductVersion>8.0.30703</ProductVersion>
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{09EF8613-2F1B-4F1D-B6B1-22938EBB529A}</ProjectGuid>
-    <OutputType>WinExe</OutputType>
+    <OutputType>Exe</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>Trakers</RootNamespace>
     <AssemblyName>Trakers</AssemblyName>
@@ -104,10 +104,13 @@
     <Compile Include="Tracking\Events\PushListener.cs" />
     <Compile Include="Tracking\Events\SwipeListener.cs" />
     <Compile Include="Tracking\Events\SwipeEventArgs.cs" />
+    <Compile Include="Tracking\Events\UserPositionEventArgs.cs" />
+    <Compile Include="Tracking\Events\UserPositionListener.cs" />
     <Compile Include="Tracking\Gestures\GestureDetector.cs" />
     <Compile Include="Tracking\Gestures\JumpDetector.cs" />
     <Compile Include="Tracking\Gestures\PushDetector.cs" />
     <Compile Include="Tracking\Gestures\SwipeDetector.cs" />
+    <Compile Include="Tracking\Gestures\UserPositionDetector.cs" />
     <Compile Include="Tracking\KinectMain.cs" />
     <Compile Include="Tracking\Events\LeftHandQuitEventArgs.cs" />
     <Compile Include="Tracking\Events\LeftHandQuitListener.cs" />