static async Task RunWithRunLoop() { var httpClient = await RobotClientProvider.GetHttpClientAsync(hostname); var yumi = new RemoteYumi(hostname, httpClient); await yumi.Init(); await yumi.RunProcedureForBothArms("NoClue"); }
static async Task RunWithProgramPointer() { // Using this method to get the HttpClient ensures that we are already logged in to the // robot when we try to send commands later. var httpClient = await RobotClientProvider.GetHttpClientAsync(hostname); // The RemoteYumi class represents the whole robot. var yumi = new RemoteYumi(hostname, httpClient); // We must set the program pointer to the routine we want to run for each arm. await yumi.LeftArm.SetPPToRoutine("Gestures", "NoClue"); await yumi.RightArm.SetPPToRoutine("Gestures", "NoClue"); // To actually get the robot to move the execution must be started. await yumi.StartExecution(); }
static void Init() { var httpClient = RobotClientProvider.GetHttpClientAsync(hostname).Result; Program.yumi = new RemoteYumi(hostname, httpClient); Program.yumi.Init().Wait(); Program.yumi.RunProcedureForBothArms("Home").Wait(); Program.yumi.LeftArm.RunProcedure("HandUp"); Console.WriteLine(" ==== INIT COMPLETE === "); try { //RunWithProgramPointer().Wait(); //RunWithRunLoop().Wait(); Test().Wait(); } catch (Exception ex) { Console.WriteLine(ex); } }