# Technology Enhanced Learning Using Humanoid Robots
## 4 The Proposed Architectural Design
### Robot Behaviour Flowchart of the Proposed Modules  
In this section, we will explain how the different modules we have described in the sections above are called and which reasoning the robot follows to decide to trigger each of them. Basically, there are particular statements that activate each of the module (e.g., 'play sentiment analysis','recognize', etc.). When the robot enables a specific module, there might be further options for the user: If the user specifies a command statement for that module, some option is activated, otherwise the module acts as programmed taking care of the user's expression. The scheme is illustrated in Algorithm 1. The input is the text from the user, already processed with speech-to-text technologies. First, the robot checks if a previous text activated the Semantic Sentiment Analysis module. If yes, the text is forwarded to the Semantic Sentiment Analysis SSSC to be processed. If not, the robot checks if the current text activates the Semantic Sentiment Analysis. The same thing happens with the Object Recognition Module. If none of the above occurs, the text is further checked if it toggles the SEQUENTIAL or HOLD mode of the Action Command Ontology Module. If it does not, the text is forwarded to the Action Command Ontology Module to identify potential robot actions. If at least one action command is recognized, then the Action Command Ontology Module is activated. Otherwise, the text is forwarded to the Conversational Agent Module which replies back to the user with an appropriate message related to the input text. Note that only one module at a time can be activated. To exit from the module currently activated, the user must say to the robot the word _exit_. The Action Command Ontology module has its peculiarities. In fact, when the user says an incomplete action command (e.g., _Zora_, _please lift your leg_), and there are no other modules activated, the Action Command Ontology module is activated. In such a case, the robot will ask the user to specify which leg it should lift. During the next interaction, the user will probably specify either _left_ or _right_. Following the algorithm, the new text is forwarded again to the Action Command Ontology Module and the robot can therefore perform the required action. The module is therefore deactivated without the need for the word _exit_. The Conversational Agent Module does not need to be exited and it is activated when none of the other modules are. The described flowchart is hard-coded (it can be modified with different priority needs) into a Choregraphe script of a configuration module and if a new  
Figure 4: Example of objects detection. Several boxes are identified corresponding to different objects. Only those with confidence values higher than 60% are labeled and shown.  
module is added, this script should be updated depending on the programmer and their desires to include the new module and with which priority.  
```
Data: Text from the user to be processed Result: Robot Action
1 ifthe Semantic Sentiment Analysis module is activatedthen
2 send the input to the Semantic Sentiment Analysis module;
3 return
4
5 end if
6 ifinput is \"Play Sentiment Analysis\"then
7 activate the Sentiment Analysis module;
8 return
9
10 end if
11 ifthe Object Recognition Module is activatedthen
12 send the input to the Object Recognition module;
13 return
14
15 end if
16 ifthe input is \"Recognize\" and there are not modules activatedthen
17 activate the object recognition module;
18 return
19
20 end if
21 ifthe input is \"Mode Sequential\" or \"Mode Hold\"then
22 set the mode of the Action Command Ontology module accordingly;
23 return
24
25 end if
26 Send the input to the Action Command Ontology module;
27 ifno actions are identifiedthen
28 send the text to the Conversational Agent module;
29 return
30 else
31 activate the Action Command Ontology module;
32 return
33
34 end if
```  
**Algorithm 1** Robot Behavior Algorithm of the four modules described in the paper.