Tutorial Guide

66
Lesson 7 Advanced Course
Turn and walk in the direction that AIBO is
facing
The following command is entered into the TURN box:
PLAY ACTION TURN Head_Pan
The following command is entered into the WALK box.
PLAY ACTION WALK Head_Pan 30
The Head_Pan represents the horizontal angle of AIBOs
neck, i.e., the direction from which AIBO is viewing the ball.
Note that there is no WAIT command
after this command.
PLAY-ACTION-TRACK_HEAD-PINK_BALL
and either PLAY ACTION TURN or PLAY ACTION WALK
are executed at the same time. In other words, two
commands are executed simultaneously. If the values in the
properties box are hard to read, adjust the width of the cell.
In making this program, you can
tell how many commands are in
progress by the Wait system
parameter.
Wait 0.01 second
WAIT 10
The program waits for 10 ms (0.01
second).
IF Wait <> 1 Wait_10ms
ELSE LOST?
The Wait system parameter represents the number of
on-going commands.
When the TURN box or the WALK box completes, the
PLAY ACTION TRACK_HEAD PINK_BALL command
in the START_TRACKING box and either the PLAY
ACTION TURN Head_Pan command in the TURN box
or the PLAY ACTION WALK Head_Pan command in
the WALK box are simultaneously executed. The Wait
system parameter is therefore 2.
In other words, until either TURN or WALK finishes,
the Wait value is not equal to 1, so the program
loops every 10 ms to check if either program has
finished or not.
When PLAY ACTION TRACK_HEAD PINK_BALL
becomes the only on-going command, the Wait system
value becomes 1 and the program returns to the
LOST? branch box.
Changing the action depending on
the number of on-going
commands.
Changing the action depending on the
number of the running command