All Tutorials / Jlucben / Synbot Plugin Tutorial - interface to Syn Bot Software

Synbot Plugin Tutorial - interface to Syn Bot Software

Step 11 : EZ Robots Commands SIML Framework

In "EZ Robot Request.SIML" file( one of the file of the example SIML project ) is included a kind of Framework in order to make easier interpretation of input text to command EZ Robots actions.

French and English Syntax are now supported.
But Framework structure enable easily to add other languages syntax interpretation.
Framework configuration is done with siml Map objects.

Bot Response messages to User Input text are formatted in XXXXXXXPROCESSCOMMAND Pattern at the end of file.

The following Input Text syntax can be analysed and interpreted to generate a Bot Response with EZ Robots Commands :

Global Robot Movement Control

M1. [Movement Direction]
Example : "Forward" , "Left" , ...

M2.[Movement Direction] [Secondary Movement Direction]
Example : "Backward to the left" " Left to the rear", ...

M1 and M2 can be preceded by a verb

[Verb] [M1] or [Verb] [M2]
Example : "Move Forward" " turn Left to the rear", ...

You can include for global Robot Movement [Speed Adjective] and [Movement Duration]

Example : "Go Forward at full speed" , "Move back during 670 milliseconds" , turn right forward slowly" , 'turn fast left backward" , ....

Some [Verb] can be configured with a direct synonym to a [Movement Direction]
For example the verb "GO BACK" is directly linked to the Movement Direction "BACK"

[Action on speed] or [Verb] [Action on speed] in order to command the Robot movement speed
For Example : "Slow down" , "Go quicker" , ...

Robot Parts Movements and Actions Control

[Verb] [Complement] where complement can be a robot Part HEAD , ARMS , LEFT ARM , ...or a Robot Feature or Behaviour PHOTO , VIDEO , RECOGNITION , COLOR RECOGNITION ,....
For exemple : "center your head" , "open left hand" , "pause the Camera", "Take a photo" , "Start Color recognition"

[Verb] [Complement] [Movement Direction]
For exemple : "lower your arms" , "point your camera to the right" , ...

[b[Verb] [Complement] [Movement Direction] [SecondaryMovement Direction][/b]
For exemple : "move the head downward to the right" , ....

[Verb] [Part Complement] [Attribute]
For example : "Balance the head from right to left" , "swing your left arm from bottom to top"

Some [Verb] can be configured with a direct synonym .
For example the verb "LOWER" is directly linked to the Movement Direction "DOWN".
Synonyms can be a Combination of [Movement Direction][Complement] [Position] and [Position] or anything you want if model for the pattern is defined in SIML files.

Robot Position Action

[Position]
where Position is a position or a sequence of positions of the Robot for example the Calibrate position , the sitting position , the push-ups sequence

[Verb] [Position]
For example : "Put yourself in the sitting position" , "do some push-ups" , .....

[Verb] [Complement][Position]
For example : "Switch the cam Off" , ...
Some [Verb] can be configured with a direct synonym to a [Position]
For example the verb "SIT" is directly linked to the position "SITTING"

[Verb] [attribute][Position]


Other actions

[Verb] without any complement
For example : "Smile"

[Verb] [Direct object complement]
For example : "Sing Happy birthday" , "Dance on Happy Birthday"

(Verb] structure

Below is the SIML Patterns used in English for all [Verb] structure ,and the associated Sets.
Only one verb form configured in the map MOVEMENT_VERB_1_EN is necessary.
The Bot will recognize in the same manner for the verb "Move" : "Move" , "Can you move", "Could you move" , "I would like you move" , "I would like you to move" , "We just want you move" , ........
Set content can be extended with new entries.

Structure is more complex in french , as we need for one verb 3 forms :
Example for the "move" in french "aller"
"Move" : " Va"
"Can you move" : "Peux tu aller"
"I would like you to move" : "J'aimerai que tu ailles"

Code:

[Model]
[Pattern]
[Item][PEUX_TU_EN] [MAP:MOVEMENT_VERB_1_EN] $[/Item]
[Item][AIMERAI_VOUDRAI_JE_EN] YOU [MAP:MOVEMENT_VERB_1_EN] $[/Item]
[Item][AIMERAI_VOUDRAI_JE_EN] YOU [MAP:MOVEMENT_VERB_1_EN] $[/Item]
[Item][AIMERAI_VOUDRAI_JE_EN] YOU [MAP:MOVEMENT_VERB_1_EN] $[/Item]
[Item][AIMERAI_VOUDRAI_JE_EN] YOU TO [MAP:MOVEMENT_VERB_1_EN] $[/Item]
[Item][AIMERAI_VOUDRAI_NOUS_EN] YOU [MAP:MOVEMENT_VERB_1_EN] $[/Item]
[Item][AIMERAI_VOUDRAI_NOUS_EN] YOU TO [MAP:MOVEMENT_VERB_1_EN] $[/Item]
[Item][AIMERAI_VOUDRAI_NOUS_EN] YOU [MAP:MOVEMENT_VERB_1_EN] $[/Item]
[Item][AIMERAI_VOUDRAI_NOUS_EN] YOU TO [MAP:MOVEMENT_VERB_1_EN] $[/Item]
[!--Example can you turn left--]
[/Pattern]
[Response xml:space="preserve"]
[User Think:Set="usedverb"][Match Index="2" /][/User]
[If User="Userlanguage" Value="en"][Goto xml:space="preserve"]XXXXXXINTERPRETATIONOFMOVEMENTFLAGS [Match Index="3" /][/Goto][/If]
[/Response]
[/Model]
[Model]
[Pattern]
[Item][MAP:MOVEMENT_VERB_1_EN] $[/Item]
[!--[Item]XXXXXCOMP [MAP:MOVEMENT_VERB_1_EN] $[/Item]--]
[!--Example turn left--]
[/Pattern]
[Response xml:space="preserve"]
[User Think:Set="usedverb"][Match Index="1" /][/User]
[Goto xml:space="preserve"]XXXXXXINTERPRETATIONOFMOVEMENTFLAGS [Match Index="2" /][/Goto]
[/Response]
[/Model] [code]
[code] [Set Name="Aimerai_voudrai_je_en"]
[Item]I would like[/Item]
[Item]I wish[/Item]
[Item]I just wish[/Item]
[Item]I want[/Item]
[Item]I just want[/Item]
[/Set]
[Set Name="Aimerai_voudrai_nous_en"]
[Item]we would like[/Item]
[Item]we wish[/Item]
[Item]we just wish[/Item]
[Item]we want[/Item]
[Item]we just want[/Item]
[/Set]
[Set Name="Peux_Tu_en"]
[Item]can you[/Item]
[Item]could you[/Item]
[/Set]