void NaoHeadControl::AutoMode() { aLOG << "BallTime_SinceLastSeen : " << BallTime_SinceLastSeen() << endl; aLOG << "BallTime_KeepSeeing: " <<BallTime_KeepSeeing() << endl; switch (headControlState) { case ball_lost: if (WM.SeeBall()) { headControlState = ball_found_again; } else { ScanAllDirection(); } break; case ball_found_again: if (!WM.SeeBall()) { headControlState = ball_lost; } else if (BallTime_KeepSeeing() > 200) { headControlState = ball_see; } else { LookAtBall(); } break; case ball_see: if (BallTime_SinceLastSeen() > 20) headControlState = ball_lost; else if (!WM.CanLocalize() && WM.getSelf().roleinteam != Self::forward1) ScanAwayFromBall(); else LookAtBall(); break; default: break; } //ScanAwayFromBall(); //lastHeadControlMode = headControlMode.headControlMode; // LookAtBall(); //LookLeft(); //LookRight(); //LookBetweenFeetForKick() //searchForBallLeft(); //searchForBallRight(); //RealSlowScan(); }
void NaoHeadControl::execute() { switch(headMotionRequest.headMotionType) { case HeadMotionRequest::intelligencemode: IntelligenceMode(); break; case HeadMotionRequest::automode: AutoMode(); break; case HeadMotionRequest::handmode: HandMode(); break; case HeadMotionRequest::lookforward: LookForward(); break; case HeadMotionRequest::lookleft: LookLeft(); break; case HeadMotionRequest::lookright: LookRight(); break; case HeadMotionRequest::lookatball: LookAtBall(); break; case HeadMotionRequest::lookatourgoal: LookAtOurGoal(); break; case HeadMotionRequest::lookatoppgoal: LookAtOppGoal(); break; default: cerr << "There is No Such headMotionType!" << endl; } }
void C_SDKPlayer::UpdateClientSideAnimation() { m_PlayerAnimState->Update( EyeAngles()[YAW], EyeAngles()[PITCH] ); LookAtBall(); BaseClass::UpdateClientSideAnimation(); }