Once you have a working robot you can install the bioloid engine.
The installation procedure may vary depending on your system, but it
should not be unfamiliar to you. Once it is completed, you will be
provided with a bin directory in which you will
find the urbi-server-bioloid binary and a script file urbi.sh or urbi.bat
depending of your Operating System: this is the script you need tu run to launch the engine.
Other important files are located in the Bioloid.data directory.
URBI.INI contains all the scripts that need to be launched at the end of engine startup. This is the entry point.
CLIENT.INI contains all the scripts that need to be launched at each client connection.
*.u which are provided or custom scripts.
Before launching the engine, you may need to change the connection port value in Bioloid.data/URBI.INI file with a simple text editor as notepad,
gedit,vi, etc...
At the same time you can check that URBI.INI contains a line like load("");.
Files between the brackets of load() command can be bioloid_scan.u file (default file) if you are just starting with urbi.
This file scan your bioloid network and create all necessary objects.
You can obviously create your own .u files with custom behaviours. To be successfully loaded at engine startup, these files will need to be :
in the Bioloid.data/ folder
loaded by URBI.INI ( load("<YOUR-CUSTOM-U-FILE>.u") )
Check this file to see how to do this yourself if result is not appropriated to your bioloid network. (in particular, order of AX-12 motors, depending of your assemby).
Bioloid.connect(port, speed);
Connect to bioloid on port port at speed speed.
COM1 or /dev/ttyS0" and 57600 are good usual values.
This function return 0 for a successful port open. Warning: This does not mean a bioloid is really well connected.
Under Windows example:
Bioloid.connect("COM1", 57600);
For Windows users, basic launch of the engine can be achieved by the quicklaunch program menu, under the Gostai category.
Go to your bioloid install directory, change to the bin/
directory and launch urbi-server-bioloid --help.
The following help message should appear :
usage: ./urbi-server-bioloid [OPTIONS] [PATHS...]
PATHS absolute or relative path elements searched
in order for files when 'load' is called.
Options:
-p PORT specify the tcp port URBI will listen to.
-b ADDR bind to a specific ip address.
-w FILE write port number to specified file.
-n disable networking.
-r report the time taken by URBI loop to execute
-i treat stdin as an urbi connection
-P PERIOD base URBI interval in milliseconds
-s PERIOD shell-mode (no network) with given period
-t use high priority scheduling
-f fast mode: the server will run as fast
as possible and emulate the period specified
-v, --version print version information and exit
You can use script file can have a different extension, depending of your system:
.bat for windows users.
.sh for linux users.
to quickly launch the bioloid engine, run the urbi.bat file (resp. .sh)
in the bin/ directory of the installation.
Just edit this file if you want to customize the way you start your engine. Here is some examples :
./urbi-server-bioloid -P 40
in urbi.sh for unix systems, or
cmd.exe /C urbi-server-bioloid -P 40 ../gostai/Bioloid.data
in a urbi.bat file for Windows users.
The engine will display a Gostai header. Next, there can be messages from the different scripts which are launched in the URBI.INI. If everything's all right, nothing more should happen.
At this time, your engine should be running. To test the connection, use either a tool specialy provided by Gostai (like URBI_console, see http://www.urbiforge.com/), or a simple telnet client (please note that all URBI engine ports default to 54000).
telnet localhost 54000
If no error occurs, your telnet client should receive the same kind of header you saw in the engine window. The last line should give your connection Id and be of the following form :
[65000000:ident] *** ID: U135766920
If this is not the case, please make sure you correctly installed the engine and followed the previous steps. Please refer to Troubleshooting and FAQ if you still have problems launching the server afterwards.
You are now ready to send commands to your robot through the bioloid URBI engine. For exemple try :
vars; ... [00004004] *** Bioloid = OBJ ...
The first line asks for all variables known by the server and the following, which you don't have to take care of, list symbols and their respective values.
There is some special files like URBI.INI which is read at start of the engine,
if this file exist. There is a URBI.INI file in the Bioloid standard package, you can run your engine
with this file by entering this:
./urbi-server-bioloid -P 40 ../gostai/Bioloid.data
The folder ../gostai/Bioloid.data/ contain a URBI.INI file and some files.u.
Note: before entering previous command, make sure you have edited bioloid_scan.u
and uncommented the line Bioloid.connect adapted to your system.