void IKinect.Init() { // initialize the KinectData object if (_kinect != null && _kinect.GetSensor() == null) { Log.Error("Init cannot be completed. Kinect not active"); return; } _gestureProcessor = new GestureProcessor(this, _kinect); Log.Info("Gesture processor created"); _trackingEngine = new TrackingEngine(_kinect, this); _trackingEngine.Strategy = TrackingEngine.RECOGNIZED_FIRST; //_featureProcessor.StartProcess(); if (_vocCom != null) { _vocCom.Start(_kinect.GetSensor()); } else { Log.Error("Could not load voice commands."); } Log.Info("Voice Commands loaded."); }
void MainScreenView_Loaded(object sender, RoutedEventArgs e) { KinectWrapper.KinectAllFramesReady += new EventHandler <AllFramesReadyEventArgs>(KinectWrapper_KinectAllFramesReady); InitializeLetters(); swipeGestureDetector.OnGestureDetected += new Action <string>(detector_OnGestureDetected); kinectColorViewer.Kinect = KinectWrapper.KinectSensor; kinectSkeletonViewer.Kinect = KinectWrapper.KinectSensor; kinectDepthViewer.Kinect = KinectWrapper.KinectSensor; voiceCommander = new VoiceCommander("stop"); voiceCommander.OrderDetected += new Action <string>(voiceCommander_OrderDetected); voiceCommander.Start(KinectWrapper.KinectSensor); }
//Requette //Constructeur /* public SerialPort getPort() { return port; }*/ static void Main(string[] args) { MainClass mClass = new MainClass (); mClass.sensor = KinectSensor.KinectSensors [0]; mClass.sensor.Start (); VoiceCommander voiceCommander = new VoiceCommander ("start", "close", "move"); voiceCommander.OrderDetected += mClass.voiceCommander_OrderDetected; voiceCommander.Start (mClass.sensor); // mClass.getPort().Open(); while (true) { } }
//Main , point d'entrée du Programme static void main(string[] Args) { //Instanciation d'un objet Init et Voice => voir Class Init init = new Init(); Voice voice = new Voice(init); //on initialise les composants a partir de la méthode initializ //de l'objet init init.initializ(); //on instancie un objet VoiceCommander avec les 3 ordres //a reconnaitre VoiceCommander voiceCommander = new VoiceCommander("open", "close", "move"); //On implémente voiceCommander_OrderDetected par l'Action //OrderDetected : si un ordre est reconnu on lance la méthode voiceCommander.OrderDetected += voice.voiceCommander_OrderDetected; //On démare la reconnaissance vocale. voiceCommander.Start(init.getKinectSensor()); //Boucle d'attente. while (true){ } }