// Constructor CalibrationClient(HoloDataClient holoDataClient, NatNetClient natNetClient) { logStartTime_ = System.DateTime.Now; outputFile_ = outputFile_ + logStartTime_.ToString("_yyMMdd_hhmmss") + ".csv"; WriteToLog("# hl_pos_x,hl_pos_y,hl_pos_z,hl_rot_w,hl_rot_x,hl_rot_y,hl_rot_z,rb_pos_x,rb_pos_y,rb_pos_z,rb_rot_w,rb_rot_x,rb_rot_y,rb_rot_z,timestamp"); outputFile1_ = outputFile1_ + logStartTime_.ToString("_yyMMdd_hhmmss") + ".csv"; outputFile2_ = outputFile2_ + logStartTime_.ToString("_yyMMdd_hhmmss") + ".csv"; // Create the MATLAB instance matlab_ = new MLApp.MLApp(); // Change to the directory where the function is located string startupPath = Environment.CurrentDirectory; string pathCmd = string.Format("cd {0}\\..\\..", startupPath); matlab_.Execute(pathCmd); holoDataClient_ = holoDataClient; natNetClient_ = natNetClient; holoDataClient_.StartFetchLoop(2000); holoDataClient_.OnPoseUpdate = PoseDataReceived; nnStartFetchLoop(20); }
// Main function static void Main(string[] args) { Console.WriteLine("Calibration client starting...\n"); // Initialize HoloDataClient HoloDataClient holoClient = new HoloDataClient(); holoClient.ConnectToServer("192.168.1.101", 11001); //holoClient.ConnectToServer("127.0.0.1", 11001); // Initialize NatNetClient NatNetClient nnClient = new NatNetClient(); nnClient.Connect(); CalibrationClient calClient = new CalibrationClient(holoClient, nnClient); Console.WriteLine("======================== STREAMING DATA (PRESS ESC TO EXIT) =====================\n"); // Infinite loop while (!(Console.ReadKey().Key == ConsoleKey.Escape)) { // Continuously listening for Frame data // Enter ESC to exit } // Disconnect clients holoClient.Disconnect(); nnClient.Disconnect(); }
// Main function static void Main(string[] args) { Console.WriteLine("arIME ExperimentConsole"); string messageRequest = "\nEnter a phrase id."; // Initialize HoloDataClient HoloDataClient holoClient = new HoloDataClient(); holoClient.ConnectToServer("192.168.1.101", 11001); // Initialize NatNetClient NatNetClient nnClient = new NatNetClient(); nnClient.Connect(); // Require spaces CalibrationClient calClient = new CalibrationClient(holoClient, nnClient, true); Console.WriteLine("======================== STREAMING DATA (PRESS ESC TO EXIT) =====================\n"); // Read console input, returns the phrase string phrase = getInput(messageRequest); calClient.NewPhrase(phrase); // Loop flag bool active = true; // Infinite loop while (active) { // Continuously listening for Frame data // Enter ESC to exit ConsoleKeyInfo key = Console.ReadKey(true); switch (key.Key) { case ConsoleKey.Escape: Console.WriteLine("You pressed ESCAPE!"); active = false; break; // Special case for stopping phrase during execution case ConsoleKey.X: Console.WriteLine("You pressed X!"); calClient.ForceRetry(); break; default: break; } } // Disconnect clients holoClient.Disconnect(); nnClient.Disconnect(); }
//public string messageString = ""; // Constructor CalibrationClient(HoloDataClient holoDataClient, NatNetClient natNetClient) { // Create the MATLAB instance matlab_ = new MLApp.MLApp(); // Change to the directory where the function is located string startupPath = Environment.CurrentDirectory; string pathCmd = string.Format("cd {0}\\..\\..", startupPath); matlab_.Execute(pathCmd); holoDataClient_ = holoDataClient; natNetClient_ = natNetClient; }
// Main function static void Main(string[] args) { string messageRequest = "\nEnter message then press Enter. Type 'exit' to quit."; //string messageString = ""; // Initialize HoloDataClient HoloDataClient holoClient = new HoloDataClient(); holoClient.ConnectToServer("192.168.1.101", 11001); //holoClient.ConnectToServer("127.0.0.1", 11001); // Initialize NatNetClient NatNetClient nnClient = new NatNetClient(); nnClient.Connect(); // Don't require spaces //CalibrationClient calClient = new CalibrationClient(holoClient, nnClient); // Require spaces CalibrationClient calClient = new CalibrationClient(holoClient, nnClient, true); Console.WriteLine("======================== STREAMING DATA (PRESS ESC TO EXIT) =====================\n"); //if (!getInput(messageRequest, out messageString)) //{ // break; //} // Send message to server string word = getInput(messageRequest); calClient.NewPhrase(word); // Infinite loop while (true) { // Continuously listening for Frame data // Enter ESC to exit } // Disconnect clients holoClient.Disconnect(); nnClient.Disconnect(); }
// Constructor CalibrationClient(HoloDataClient holoDataClient, NatNetClient natNetClient, bool requireSpaces) { requireSpaces_ = requireSpaces; phraseList_ = ImportPhraseList("phrase-list.txt"); // Create the MATLAB instance matlab_ = new MLApp.MLApp(); // Change to the directory where the function is located string startupPath = Environment.CurrentDirectory; string pathCmd = string.Format("cd {0}\\..\\..", startupPath); matlab_.Execute(pathCmd); holoDataClient_ = holoDataClient; natNetClient_ = natNetClient; // Start fetch loop for HL pose data (every 2s) holoDataClient_.StartFetchLoop(2000); holoDataClient_.OnPoseUpdate = PoseDataReceived; }