private int SearchRequest(int currentState, object o) { bool gestureFound = false; for (int i = 0; i < 18; ++i) { Thread.Sleep(500); if (gestureFound = brain.FindSpecificGesture("request", out requestId)) { cmdMan.MVN_PLN_fixhuman(requestId, 4000); TextBoxStreamWriter.DefaultLog.WriteLine("HAL9000.-> Gesture found."); brain.SayAsync("I found a request."); break; } } if (!gestureFound) { if (attemptCounter > 7) { attemptCounter = 0; finalState = FinalStates.RequestNotFound; return((int)States.FinalState); } cmdMan.MVN_PLN_move(0, -Math.PI / 4, 4000); if (attemptCounter % 2 == 1) { brain.SayAsync("I am looking for requests, please raise your hand above your head."); } attemptCounter++; return(currentState); } // Si encontro humano, pasa al siguiente estado attemptCounter = 0; return((int)States.GoToRequest); }