AiboHack


Master Studio Examples



NOTE: You must own the AIBO Master Studio program (version 1.1) to examine and modify these examples.
This section discusses creating custom personalities for the ERS-210 AIBO using Master Studio. These personalities can be converted to work with the ERS-220 or ERS-31x.


Pre-requisites

Before going any further you must:


Conventions

There are several conventions used for these examples. All the Rcode is created with the Behavior Arranger ("BA"). All performance data is editable with the Action Composer ("AC"). Performance data is also editable with the AiboPet Editor (AEditor23).

A simple naming convention is used for the actions. For any action, the same base name is used. For the "SKITFOO" action: The performance data files (.MTN, .WAV, .MID and .LED) are all stored in a "DATA" subdirectory right below the main project folder. This is different than the standard AC directory layout, but is more self contained and works better with the the AiboPet ERS-210 Editor.

For the behavior layout with the "BA", the flowcharts are designed to be simple and modular. Group Boxes (ie. subroutines) are used frequently to group functionality.
For laying out the flowchart, two sizes of boxes are used. Small boxes are used for very simple actions (usually just a single "PLAY:ACTION" or "PLAY:ACTION+").

If you install Master Studio Plus, you will get the small bitmaps.


Example 1: Bender AIBO (Bender 2.0)

Bender AIBO (ERS-210) is a entertainment personality. It is a port of the ERS-11x personality with a few small changes. Many of the new ERS-210 features are not exploited.

How does it work?

Bender is a simple personality that reacts to inputs (head pat, hit, obstacle etc). Bender 2.0 does not respond to sounds or voice commands. Bender will perform skits (both short and long) at random after several seconds of inactivity. Lastly, it has a special mode (by pressing his back) to specifically select one of six of the longer skits.

Interesting Actions

Most of the actions are simple, consisting of a single MTN, WAV and LED performance.

Interesting Branch Logic

The main loop starts with "Clear_Inputs" which zeros out all interesting input variables (eg: "Head_Pat"). The main loop goes through several input checks (eg: Head_Hit?, Head_ON? etc) and then does a timeout check. The Idle_Timeout? check will check for a period of inactivity.

Interesting Groups (subroutines)

There are some general purpose groups.
  • "Pick_1of?" is used to pick at random one of several performances.
  • "AskAiboPaws is used to enter the mode where AIBO lays down, and lets you pick one of 6 things by rotating his paws.

    All the other groups (Skit_?, Random_?) are for organizing the Bender performance.


    Example 2: Obey Cat [RCode Plus]

    Obey Cat (ERS-210) is a demo personality. It requires the RCode Plus. To edit using Master Studio, you should install the Master Studio Plus extensions.

    How does it work?

    Obey Cat has a simple structure. Most of the logic is just in handling input sensors. Obey Cat does react to voice commands and sound controller commands (through RCode Plus extensions).
    Most of the logic is handled in the "Main_Not_Walking" routine. When AIBO is walking (either forward or backwards), it has a more specialized routine "Main_Walking".

    Interesting Actions

    Most of the actions are simple, consisting of a single motion or WAV. Many of the motions use the built-in motions, including some of the extra ones.

    Interesting Branch Logic

    The main loop goes through a top check of "IsWalking?" to decide if the dog is walking or not walking. The variable "isWalking" is set by actions that start the dog walking without a fixed distance. This lets the logic know if the dog is currently walking, and do things differently. When walking, a normal "WAIT" command should not be used, since it will wait for AIBO to finish the rather long (10000 units) walk.

    There are several places where similar code is duplicated in the behavior arranger. Future versions of Obey Cat will have a more modular structure.

    Interesting Groups (subroutines)

    For "RCode Plus" there are several general purpose groups:
  • CheckVoice - check for voice
  • CheckSoundControllerTone - check for ERS-11x sound controller tones
  • CheckAiboSound - check for ERS-11x AIBO
  • CheckRhythm - check for rhythmic music
  • TurnInDirectionOfVoice - is the heart of the "Come Here" command

  • CommentOnly - used for adding comment boxes to the flowchart

    Specific to "Obey Cat" are several "Handle_?" groups to handle certain inputs in a more modular way.