User's Guide

55
Chapter 4 Behavior Arranger
Programming precautions
Command Completion
Since action commands (PLAY) such as
“walk” and “shake head left and right” take
time from execution to completion of the
action, AIBO returns a completion notice
when the action is completed. If you create a
program that executes action commands after
a completion notice is received, Individual
actions can be steadily executed in sequence.
Overwriting command execution
AIBO can execute several commands at the
same time, such as “while walking, flash LED
and play sound.” However, simultaneous
execution of several commands is possible
only if resources that the commands use
(such as body parts, LEDs, and sounds) don’t
overlap. For example, if you designate a
command to turn off a LED after a command
to turn on the same LED, only the last
command will be executed and the LED will
be turned off. If you designate a command to
raise the right leg and a command to lower
the same leg before the first action completes,
AIBO will lower the right leg in the middle of
raising it. Such overlaps are called
overwriting command execution.
Overwriting command execution doesn’t
apply to all action commands, so see
explanation of each individual command to
see if overwriting execution is possible.
Commands that use variables
The commands in this section execute
arithmetic operations using variables.
Restrictions on variables
Observe the following restrictions when using
variables.
Variable names cannot be longer than 32
characters.
Use only alphanumeric characters and
underscores in variable names.
A variable name consisting only of capital
letters cannot be used.
A value must be a 16-bit integer, between
–32,768 and +32,767.
SET
Assigns a value to the variable.
CLR
Clears a sensor variable.
ADD
Addition
[Variable*] = [Variable*] + [Var/Value*]
SUB
Subtraction
[Variable*] = [Variable*] – [Var/Value*]
MUL
Multiplication
[Variable*] = [Variable*] × [Var/Value*]
DIV
Division
[Variable*] = [Variable*] ÷ [Var/Value*]
MOD
Remainder
[Variable*] = [Variable*] % [Var/Value*]