EvaML: An XML-Based Language for the Specification of Interactive Sessions with the Social Robot EVA

Originally, robot EVA has a Visual Programming Language (VPL), which aims to facilitate the development of interactions by people without experience in computer programming. During the process of creating a script using VPL, the user is responsible for inserting robot commands, which are nodes in the execution flow. However, the elements are automatically positioned in the graphical area of the interface by the GoJS application. Script graph nodes are automatically repositioned after removing or inserting an graph node or edge. When a script becomes large, this automatic repositioning often makes it difficult to build the script. As the number of graphic elements in the interaction script increases, the graph visualization becomes very limited. With the objective of facilitating the development of interactive sessions by people with technical knowledge in programming, but also aiming to maintain the readability of the script codes, EvaML was created.

1. An XML-Based Language for an Open-Source SAR

Although the use of graphical tools makes an average user be productive, a user with advanced skills in the application domain can be reduced in efficiency. The XML-based DSL development goals are:

We chose XML because it has many advantages for developing DSLs, including:

Therefore, we used the XML language and the tools related to it to propose and implement EvaML, the markup language to specify interactive sessions for robot EVA.

All commands that control the robot's multimodal interaction elements are present in EvaML, including the <Light> component (which controls a smart light bulb), the voice recognition commands and the <userEmotion> command that enables the recognition of the user's facial expression through a webcam. The language also has elements for creating and manipulating variables, generating random numbers, conditional controls using <switch> and <case> elements, among others. The EvaML parser automatically generates a corresponding script in the original JSON format that can be added to the robot's script database and then executed by the robot.

1.2 EvaML - Document Sections

The tree structure of an EvaML document can be seen in Figure 1. We can se the root element of the EvaML document (<evaml>) and elements <settings>, <script> and <macros> that represent its main section.

Figure 1.1: Tree structure of an EvaML document.

Element <settings> - Defines some global characteristics of the script. It is possible to define the voice timbre and the language in which the robot will communicate. It is also possible to define whether the generated code, when executed, will reproduce commands for light effects, sound effects or even play music. By configuring these parameters, it is possible to globally modify the functioning of the script without having to directly change the definitions of its individual elements. Listing \ref{lst:settings_code} presents a code snippet that exemplifies elements <evaml> and <settings>.

<?xml version="1.0" encoding="UTF-8"?>
<evaml name="script01">
  <settings>
    <voice tone="en-US_AllisonV3Voice" />
    <lightEffects mode="ON" />
    <audioEffects mode="ON"/>
  </settings>
...
</evaml>

Element <script> - Contains the sequence of commands that the robot must execute. You can see some of them in the code snippet presented in Listing 1.2 In line 2, there is the \<light> command, which turns on the smart bulb setting its color to blue. On the next line, the <talk> command makes the robot say something, for example introduce itself. The <wait> command, on line 4, causes the script to be paused for 2000ms (2s). On line 5, the <audio> command plays an audio file called song01. The block attribute set to "TRUE" makes the script continue running only after the audio file has finished playing. Then, the robot says goodbye saying "Bye!" and turns off the smart bulb.

<script>
  <light state="ON" color="BLUE"/>
  <talk>Hi, how are you?</talk>
  <wait duration="2000" />
  <audio source="song01" block="TRUE" />
  <talk>Bye!</talk>
  <light state="OFF" />
</script>

Element <macros> - It is one of the abstractions created in the EvaML language, as can be seen in Listing 1.3. It is possible to create subscripts as macros that can be referenced inside the <script> section to reuse them. A macro has the id attribute that serves to identify it. These macros can be used within the <script> section using the <useMacro> command. The macro attribute of the <useMacro> command references the <macro> element defined inside <macros>. During the EvaML document parsing process, all macros are expanded with their content in the <script> section. There is no limit to the number of macros created, nor to the number of references to those macros in the script. As can be seen in Table\ref{tab:evaml-sec}, the \textcolor{frenchplum}{<macros>} element is not required.

<macros>
  <macro id="GREETINGS">
    <talk>Hello, I'm robot Eva</talk>
    <talk>What is your name?</talk>
    <listen />
  </macro>
</macros>

Table 1.1: shows the root element of the EvaML document <evaml> and the elements <settings>, \<script> and <macros> that represent the sections of the document. You can also observe the attributes of each element and its contents. In the attribute column, an underlined attribute indicates that it should be used. In the column of contents, occurrence indicators are used to indicate the order and number of times an element can occur. The "," (comma) symbol indicates that all child elements listed must be used in the sequence shown. The "|" (pipe bar) indicates that either element can occur within the parent element. The "+" (plus sign) symbol, on the other hand, indicates that the child element must appear one or more times. The "*" (asterisk) symbol indicates that the element may be used zero or more times within the parent element. The "?" (question mark) indicates that the element is optional, the element may not exist or there is only one occurrence of it.

Table 1.1: EvaML - Document Elements (Content Model)

Table 1.2 shows EvaML elements that represent the language commands. Its attributes and what each element can contain will also be listed. For such representation, the same notation used in Table 1.1 will be used.

Table 1.2: EvaML - List of Commands (Content Model)