Пример #1
0
        // Handle new pose update event
        private void ProcessAllData(Object source, System.Timers.ElapsedEventArgs e, string messageString)
        {
            // Fetch data from NatNet
            NatNetClient.NatNetPoseData nnPoseData = natNetClient_.FetchFrameData();

            // Log latest NatNet data to optitrack log file
            LogData(nnPoseData);

            index = handledata(nnPoseData, index, messageString);

            int length = messageString.Length;

            //if the phrase has been completed or gestured wrong and we want to redo it
            if (index > length + 2 | retry2_)
            {
                retry2_ = false;
                // Update done key
                holoDataClient_.UpdateDoneKeyState(2);
                //if in training mode, then reset QZMP
                if (train_)
                {
                    holoDataClient_.UpdateTrainKeyState('Q', 0);

                    holoDataClient_.UpdateTrainKeyState('Z', 0);

                    holoDataClient_.UpdateTrainKeyState('M', 0);

                    holoDataClient_.UpdateTrainKeyState('P', 0);
                }

                Console.WriteLine("Completed: " + messageString);
                Console.WriteLine("Char Count: " + length);
                Console.WriteLine("===============================\n\n");

                // Write out logs
                WriteToFile(otLogFile_, otDataLog_);
                otDataLog_ = "";
                WriteToFile(traceLogFile_, traceDataLog_);
                traceDataLog_ = "";

                // Increment index to update the KB pose based on latest data
                GetLatestHLdata();

                //clearHoloLensData();
                SendhHoloLensData(rawStimulus_);
                timer_.Enabled = false;
                timer_.Dispose();
                //checkend = false;

                index = 1;
                // Send message to server
                string messageRequest = "Enter new word";

                string newWord = getInput(messageRequest);
                NewPhrase(newWord);
            }
        }
Пример #2
0
        // Handle new pose update event
        private void ProcessAllData(Object source, System.Timers.ElapsedEventArgs e)
        {
            NatNetClient.NatNetPoseData nnPoseData = natNetClient_.FetchFrameData();

            index = handledata(nnPoseData, index);


            if (index > 7)
            {
                Console.Write("playful");
                holoDataClient_.SendhHoloLensData();
                timer_.Enabled = false;
            }

            LogData(nnPoseData);
        }
Пример #3
0
        // Handle new pose update event
        private void ProcessAllData(Object source, System.Timers.ElapsedEventArgs e, string messageString)
        {
            NatNetClient.NatNetPoseData nnPoseData = natNetClient_.FetchFrameData();

            index = handledata(nnPoseData, index, messageString);

            var words     = messageString.Split(null);
            int wordcount = words.Length;

            int length = messageString.Length - wordcount + 1;

            // Special case if require spaces, don't subtract wordcount (i.e. n spaces)
            if (requireSpaces_)
            {
                length = messageString.Length;
            }

            if (index > length + 2)
            {
                // Update done key
                holoDataClient_.UpdateDoneKeyState(2);

                Console.WriteLine("Completed: " + messageString);
                Console.WriteLine("Char Count: " + length);
                Console.WriteLine("===============================\n\n");

                // Increment index to update the KB pose based on latest data
                GetLatestHLdata();

                //clearHoloLensData();
                SendhHoloLensData(messageString);
                timer_.Enabled = false;
                timer_.Dispose();
                //checkend = false;

                index = 1;
                //Console.WriteLine("Enter new word");
                // Send message to server
                string messageRequest = "Enter new word";


                string newWord = getInput(messageRequest);
                NewPhrase(newWord);
            }

            LogData(nnPoseData);
        }