MotionTool
Bart Presnell
Bryan Feinstein
Georgia Tech Borg Lab



Introduction

The motion tool is a simple tool to be used in the process of creating scripted motions for use with the AIBO Sony entertainment robots. The scripted motions are a sequence of key frames that the motion manager will interpolate through. The key frames are defined by absolute angles for each joint on the AIBO. The position of the joint when the angle is 0 is determined by Sony. Please consult the Sony AIBO documentation to see the full specification of angle operation.

The tool creates motion files to be used with the motion manager used at Georgia Tech. This motion manager is a modified version of the motion open-r object distributed by CMU. Specification of the file format is specified in appendix A.

Downloads

The source files for the motionTool and AIBO Open-R objects are available here.

The executable for the motionTool and the bin files for the AIBO Open-R objects are available here.

The rest of this page covers the how to create motions with motionTool.


There are 5 main parts to the tool frame angle specification, frame sequencing, motion options, AIBO interaction, and file operations. The use of each part of the tool will be covered in separate sections.

Angle Specification


The majority of the GUI is devoted to the task specifying the angles for each key frame. There are separate frames for setting the angles to be used by each leg, the head, the tail, the mouth, and each ear. There are separate sections for each leg, the tail, and for the head related angles. All angles are entered in degrees. All angles are limited to values specified by Sony. The limits are set by the files leg.lmt and head.lmt. The specification for these files is shown in appendix B.
Each leg section contains 3 fields for setting the shoulder angle, the knee angle, and the away from the body angle. The shoulder angle controls the shoulder joint, which swings the leg forward and backward. The 0 angle position has the top of the leg pointed straight down, negative angles point the leg towards the back of the dog, and positive values point the leg to the front of the dog. The knee joint is the lower joint on the leg. The 0 angle position has the lower leg in line with the upper portion of the leg. In other words, the leg is straight. Once again positive values move the bottom of the leg towards the front of the dog, and negative values to the back of the dog. The away from body joint is at the shoulder and swings the leg away from the robot body. The 0 angle position is straight down, positive values moves the leg away from the body, and the negative values swing the leg into the body. All values are adjusted in the standard adjustment field way, either by directly entering value in the field or by using the arrow to raise or lower the current value.
The tail specification section has two angles, tail tilt and tail pan. The pan controls the angle of the tail side to side. The 0 angle places the tail along the center line of the robot body. Positive angles are to the right and negative angles are to the left. The tilt angle swings the tail up and down. The 0 position leaves the tail in line with the back of the robot; positive swings the tail up, and negative values swing the tail down.
The head specification section consists of the head pan, tilt, roll, mouth angle, and the ear angles. The head tilt angle swings the head up and down. The 0 angle position for the head leaves the head straight out, positive value tilt the head back, negative values tilt the head down. The head pan value swing the head from side to side. The 0 angle position leaves the head point straight ahead, positive values swing the head right, and negative values swing the head left. The roll value cocks the head side to side. This differs from the pan because the ears move to the right or left, where as with pan, the nose moves right or left. The 0 position has the ears pointing straight up and positive values move the ears to the right, negative values move the ears to the left. The mouth angle opens and closes the dogÕs mouth. The angle of -3 has the mouth closed, and -30 is the maximum open position. The limit on the mouth varies depending on the position of the head. For example, as the head is tilted down the amount the mouth can not be open becomes smaller. The head pan angle also affects the mouth limit. The limits are handled automatically. The ears can not be set to specific values; they can only be in an up position or the down position. The ears are set by using check boxes. When the box is unchecked the ears are up, when the box is checked the ears are down. Also note setting the ear angles is a slow operation, and can affect the speed of the robots motion.

Frame Sequencing


Once a key frame position has been specified, the frame must be added to a sequence to have the robot actually perform any action. The controls for sequencing are found in the lower left part of the GUI. The sequencing controls consist of buttons to add frames, update frames, remove frames, and move frames earlier or later in the animation. Additionally there is a delay field to control how long the robot takes to interpolate to a frame, a checkbox to tell whether the animation can be stopped safely at the current frame, and a list window that shows the frames in the current animation.
The add button is used to add a new frame to the sequence. The frame specified by the current angles is added to the end of the sequence list. To alter a frame that is in the sequence, the frame must be selected as the current frame. This is done by clicking on the frame in the sequence list. This will highlight the frame in the sequence list and copy the angle values for that frame into the frame specification fields. The values can then be changed as desired. The values in the angle specification field will be copied into the current frame when the update button is clicked. The remove button removes the currently selected frame from the animation. The currently selected frame can be moved up or down in the sequence with the ordering buttons. The up arrow will move the frame on frame closer to the beginning on the animation. The down arrow will move the current frame towards the end of the animation. The delay field specifies the time it takes to interpolate from whatever position the dog is currently in to the position specified by the key frame. The time is in milliseconds. The millisecond field is handled similarly to the angle specifications. The value in the field when the frame is added is copied in. The delay of a frame is updated by selecting the frame, then changing the delay field, and then clicking on the update button. The breakable checkbox tells whether the animation can be safely stopped while trying to get to the current frame. If the position of the dog is unstable or the user does not want other motions interrupting the current motion, the breakable button should not be checked. If the breakable field is updated after the frame is added to the animation, the update button must be pressed to have the change take effect.


Motion Options

The motion options are on the lower right hand side of the GUI. The Options are divided into 3 tabs: base, play options, and next motions. All options affect the animation as a whole.
The Base Option tag allows the user to set the priority the animation has for each limb of the robot and the type of animation. Priority values can range from 0 to 255. A priority of 0 means the animation does not supply any values for that limb, a value of 255 means the animation will not run if it can not control the limb, intermediate values specify the desire of the animation to control the limb. If two animations play concurrently, the animation with the higher priority will control the limb. The head priority controls the head angles, the mouth angle and the ears. There are 3 animation types. Scripted is the primary animation type, which is a sequence of key frames, a pose is a single frame animation, usually a stand frame or some neutral pose that most animation begin from. The third option, IK, is currently not implemented.
As a note, if a priority of 0 is specified, regardless of whether the animation specifies angles for that limb, the limb will not be moved.
The play options allow the animation to be flipped. This means there is no need to make a right handed animation and a left handed animation. The right leg angles will be played on the left legs and vice versa. The pan of the head and tail will be inverted. There is also the option of setting a file to be a stub file. The stub file is another motion file. By setting a stub file. The two motions will use the same set of angles on the dog, saving on memory. It is expected that the two files will be flipped, also it is expected the two files can not be played together.
The final option tag is the next field. This controls the behavior of the motion when it reaches the end of the motion. There are 5 options: freeze, loop, go to neutral, go to motion id, go to motion name. Freeze holds the robot in the last frame specified by the animation. Loop causes the animation to start over. Go to neutral causes the animation to go to the current neutral pose set at run time. Go to motion id, will cause the motion to start the motion with the specified id. The ids are specified when the motions are loaded onto the dog. Go to motion name, will play the motion with the given motion name. If there is no motion with that name loaded on the dog, the behavior defaults to go to neutral.

AIBO Interaction

AIBO Interaction is controlled by 3 buttons on the GUI. The buttons are the Play Button, the Grab Values Button, and the Update Dog Values. The Grab Values gets the angles of the current position the dog is in. The value is copied into the angle specification fields. The once the values have been received from the dog, a message box will pop up announcing the successful receipt of the angles. The Update dog button will move the dog into the position specified by the current angle specifications. A pop-up box is displayed once the values have been successfully transferred to the dog. The Play Button is used to play a full animation sequence. Pushing the Play Button will cause the Play Box to be displayed. The Play Box allows the user to specify the animations that will be loaded on the dog, what animations will be played, the ID the motion will be given, and the type of motion it is. The Play Box is arrayed in four columns. The first column is a toggle button that is checked if this line holds information about a animation that is to be played. The next column is a text field that allows the user to specify a saved animation file that will be loaded onto the dog and played. The top line is reserved for the animation currently being worked on. The next column allows the user to specify the motion ID to be used for the animation. The exact values of the ID are relatively unimportant, but each animation must have a unique ID. If two animations are given the same ID, the second animation will overwrite the first. If no file is specified in the text field, no new animation will be loaded with the specified ID, but the animation with that ID on the dog will be played. The final field specifies the type of animation. The choices are POSE, SCRIPTED, IKÕED. POSE is for neutral poses or single frame animations. SCRIPTED are the key frame animations produced by the tool. IKÕED animations are more sophisticated inverse kinematics animations that are not currently supported by the tool. Once the user has specified the animations to play, the user clicks the play button at the bottom of the Play Box to actually play the animations. There will be a confirmation box when the animations have been loaded onto the dog. The cancel button closes the Play Box without interacting with the AIBO.

File Operations


To Load and save files, select File from the menu bar at the top of the MotionTool Window. Then select either load or save. Both options bring up a standard file dialog box. .

IP Address


The IP address can be set as a command line argument when the Motion Tool is started, or can be set in the program. To set the IP address from in Motion Tool, select the file menu in the menu bar. Then select the Set IP Address option. This will bring up the IP dialog box. Simply enter the IP address of the dog to connect to, and hit return. The Motion Tool will use this address when connecting to the dog. The connection is established only when the Tool Needs to interact with the AIBO. Once the interaction is concluded the connection will be closed.

AIBO Open-R Objects


There are three OPEN-R objects necessary to have installed on the dog. There first is the comm object. This object takes care of the communication with the tool. It sits in a loop waiting for the tool to connect to it, and then process the commands and data passed to it. Once the object receives a command, it passes this command as an OPEN-R message to the MotionTrainerObject. This object takes user commands and creates a motion command to instruct the motion object to play a motion, load a new motion, or report the current angles. The MotionTrainer is connected to the MotionObject. It is also set up to accept motion commands. This allows the MotionTrainer to pass motions commands generated by a behavior object through to the Motion Object. The Motion Trainer has a trainer mode and a pass through mode. When in pass through mode, it will pass received commands through to the MotionObj. If it is in trainer mode, it will only send the motions generated by the motion tool to the MotionObj. In future work, we will add the ability to switch the MotionTrainer back to passive mode. This will allow the user to adjust motions and see them in action without even turning off the dog, much less recompiling. Also the MotionTrainer and Comm Object can be removed by removing them from the connect.cfg. The final OPEN-R object is the MotionObj object. This object takes care of actually playing the animations. It is set up to take MotionCommands that specify a set of animations to play, and parameters for the animation. It also takes a MotionTrainer Command. The MotionTrainerCommand can request the MotionObj read a new motion file from the memory stick and install it with a new id, or report the current angles of the joints.


Appendix A

The file specification
<Version Number>:1 Byte
<Header Type> : 1Byte
<Header Binary Data>:Variable - Header Data specified in MotionHeaders.h
<Header Type>:1 Byte
....
....
<NullHeaderType>:1 Byte
<Num Frames>:1 Byte
<Frame Binary Data>:88 Bytes
....More Frame Binary Data, number of frames specified above - Format of Frame Data is struct BodyStateMotion, defined in BodyStateMotion.h

Appendix B

Head category file

<tilt min> <tilt max> <pan min> <pan max> <category number>

This file defines a pan and tilt range that define a head category. The head category is used to decide what roll and mouth limits apply. The current value are those specified by Sony

head limit file

<roll min angle> <roll_max angle> <mouth_min> <mouth max>

Each line defines the limits of the roll angle and the mouth angle at for the corresponding head category. The head category is defined in the head.cat file. The first line is for category 1, the second line for category 2. Ō//Õ comments a line out.

leg limit file

<shoulder joint angle> <front leg away_min> <back leg min>

This file defines the minimum allowable away from body angles. It uses the shoulder angle to decide which value applies. If the current value is between two shoulder values, it linearly interpolates between the given away from body angle.