Example #1
0
        /// <summary>
        /// The robot start to follow a human (guide phase).
        /// </summary>
        private int FollowHuman(int currentState, object o)
        {
            TextBoxStreamWriter.DefaultLog.WriteLine("HAL9000.-> FollowHuman state reached.");

            //start saving the robot's path (hansel & gretel)
            cmdMan.MVN_PLN_startsavingpath();

            cmdMan.HEAD_lookat(SMConfiguration.HeadHomePan, SMConfiguration.HeadHomeTilt, 10000);
            //Thread.Sleep(500);
            //cmdMan.HEAD_lookat(SMConfiguration.HeadFollowPan, SMConfiguration.HeadFollowTilt, 10000);

            //send the arms to a position above the laser
            cmdMan.ARMS_goto(SMConfiguration.ArmsFollowPosition);

            brain.SayAsync(SMConfiguration.StartFollowMessage);
            //start to follow a human
            cmdMan.MVN_PLN_startfollowhuman();

            brain.recognizedSentences.Clear();
            TextBoxStreamWriter.DefaultLog.WriteLine("HAL9000.-> Waiting for location command");
            return((int)States.WaitForLocationCommand);
        }