PARSL (Phase Automata Robot Scripting Language) is a scripting language based on XML syntax. PARSL is particularly designed for chain-type modular robots. PARPE (Phase Automata Robot Programming Environment) provided with PARSL allow users to get started quickly, without much overhead, to develop complex and scalable gaits and behaviors for modular robotic systems. PARPE is implemented in Java JDK1.4 with JEP (Java Mathematical Expression Parser). Due to license issues, one has to download JEP separately from Singular Systems. A Java programming environment and an XML editor are useful, but not necessary, for developing PARSL scripts.
In a command window, go to PARPE classes directory, type
java GUI
a GUI window comes out as in Fig. 0.1.

Most of the functionalities in this GUI will be explained in the rest of this tutorial.
In order to develop programs without hardware, PBSim, a chain-type modular robot simulator, is distributed with the software. PBSim is written in Java with Java3D. One should download Java3D (OpenGL version) from Sun's Java Software. PBSim simulates PolyBot, which has two type of modules: segments and nodes. A segment has one degree of freedom with two connection interfaces and a node is a rigid cube with six connection interfaces. All connection faces are identical and can be connected in one of the four orientations.
In a command window, go to PARPE classes directory, type
java -Djava.security.policy=./PBSim/policy PBSim.server.SimImpl
a GUI window comes out as in Fig. 0.2.

One has to start PBSim before starting PARPE GUI in order to connect PARPE to PBSim. If PBSim is connected, the status shown in PARPE GUI "To PBSim" would be "yes". Details of PBSim will be discussed in Appendix C. PBSim's "Config" has a set of standard scalable configurations, including various snakes and centipedes. Arbitrary configurations can be created via a file formatted in XML.
A PARSL program consists of a robot definition <robot>, where the
structure of the robot may consist of one or many groups, each of which
consists of a set of modules or groups. Each module is considered to have
one degree of freedom. In general, the program part of the code (i.e., the
actual movement instructions) consists of sections of <main>,
<behaviors>, <automata> and <states>; the order of the
sections is arbitrary. The section <main> consists of a sequential
series of behaviors defined in the section <behaviors>. Each behavior
defined in <behaviors> consists of a set of phase automata, each of
which is defined in the section <automata>. The execution of a set of
automata in a single behavior is "parallel", i.e. each is running on a
specific non-overlapping group of modules defined in the structure of
<robot>. Behaviors are composed sequentially and automata are composed
in parallel. Each automaton is defined by a sequence of states; the actions
of a state is defined in the section <states>.


The program in Fig. 0.3 describes a robot with eight modules, in two groups named "group1" and "group2", the code is composed of one behavior "simpleWave", which applies the automaton "wave" to "group1" of modules, each with a phase delay of 0.25 with respect to the previous module. The total cycle period of the automaton is 1 second. The automaton "wave" consists of two states, "up" and "down", where the "up" state causes the module to change its angle in a linear fashion from its current angle to 30 degrees. Likewise, the "down" state causes a move -30 degrees. Fig. 0.4 shows the traces of this program for the four modules in "group1".

Use the Program menu to load a program, e.g., "helloworld.xml". After a program is loaded, the Run button is enabled and the status of modules in shown in a tabular form as in Fig. 0.5.

After hitting Run button, the Pause and Stop buttons will be enabled, and "target angle" and "phase" values are displayed in the table, as shown in Fig. 0.6.
