Tutorial Guide

65
Lesson 7 Advanced Course
Changing the direction of the body
According to the location of the ball
The commands below are specified in the
SIDE? action box which the program jumps to
when AIBO sees the pink ball.
IF Head_Pan > 35
AND Wait = 1 TURN
IF Head_Pan < -35
AND Wait = 1 TURN
ELSE NEAR?
The Head_Pan system parameter indicates the
horizontal angle of AIBOs neck. If the angle
is more than or less than 35° and the Wait
value is 1, the program jumps to the TURN
box which changes the direction of AIBOs
body.
The Wait value indicates the number of on-
going commands. When AIBO searches for
the ball, the following command is executed,
and so the value becomes 1.
PLAY ACTION TRACK_HEAD PINK_BALL
Otherwise, the ball is in front of AIBO, and so
the program jumps to the Near? box, which
calculates the distance to the ball.
Finding the distance to the ball
IF Head_Tilt > -60
AND Wait = 1 WALK
ELSE KICK
The above command determines whether the ball is nearby or far away by the
angle of AIBOs neck.
If the angle is more than -60°, i.e., if the head faces upward, it could be
concluded that the ball is far away.
When the Wait value is 1, it means AIBO is still searching for the ball, and so
the program jumps to the WALK box.
If the angle is less than -60°, i.e., if the head is facing downward, it can be
concluded that the ball is near AIBOs legs. The program then jumps to the
KICK group box.