14.16 FaceBall
This function forces the agent to turn and face a particular destination in this case the ball
. Firstly we use the getTargetDistanceAndAngle
method to determine the angle between myself and some target, in this case ball
. Once we have the angle we can see if it is within some threshold in this case 10
. If our angle is greater we use goToTargetRelative(mypos, angle);
to turn to the ball. If we are within the threshold we simply SKILL_STAND
.
SkillType NaoBehavior::FaceBall(VecPosition mypos){
double distance, angle;
getTargetDistanceAndAngle(ball, distance, angle);
if (abs(angle) > 10) {
return goToTargetRelative(mypos, angle);
} else {
return SKILL_STAND;
}
}