The full documentation about Urbi script is in part II of
Urbi sdk.
All script commands shall be preceed by "Global.moduleName."
To call a function from the API : Global.moduleName.functionName
example :
var a="bonjour";
Global.tts.say(a);
To use a var from the API : Global.moduleName.varName
example :
Global.servo.leftEyePan = 50;
Tutorial
You can find a tutorial file in your Reeti : /home/reeti/Devel/Samples/Urbi/script/
This tutorial gives some simple samples for each Urbi functionality.
To "execute" the tutorial :
- open an Urbi console (shortcut on Reeti Desktop)
- copy and paste line by line from the tuto file to the console
How to run my Urbi script
You can run urbi script in several ways :
- Manual local execution :
- Enter urbi commands in an Urbi console (shortcut on Reeti Desktop)
- Load a script file in Urbi console : load("/mypath/myScriptFile.u");
- Automatic execution at Reeti launch
- At Reeti power on, 3 script files are loaded in Urbi :
- /home/reeti/reetiPrograms/load/functions.u
- /home/reeti/reetiPrograms/load/initVar.u
- /home/reeti/reetiPrograms/load/neuralBlocks.u
- You can add any urbi script in those files. You can load your own script files from those files.
- The 3 differents files are intended to separate script in categories : basic functions, variables initializations and AI functions. However the 3 files are loaded in the same way and you can add whatever you want in each one.
- Send script to Urbi server through IP connection
From any language or any TCP/IP client application, you can send Urbi script to the Urbi server on port 54001
Using netcat :
open a terminal
netcat 127.0.0.1 54001 (or external Reeti IP address for a remote connection)
enter your command : Global.tts.say("hello");
Using netcat in command line : echo "Global.tts.say(\"hello\");" | nc -q1 127.0.0.1 54001
Using Urbi C++ client : refer to
Using Urbi Java client : refer to
Using any other language TCP/IP client : refer to your language manual to create a client on 54001 port and send string containing your Urbi script.