Manual

15
Developer’s guide - C++, Urbi, Flex, Java - V2.0
robopec
This document is the property of Robopec. The information contained herein may not be used, reproduced or
communicated without its prior written consent.
Gostai gives access to libraries that allow communication with URBI server through C++ or JAVA
software. These functionalities are wrapped in C++ in liburbi and in JAVA in liburbijava.
You can contact Reeti via a program developed in JAVA. For that, it is necessary to have the Java
Development Kit (JDK v1.6 minimum) and Java Runtime Environment (JRE v1 .6 minimum).
To create a Java program for Reeti, create a standard Java project, then:
- Add the urbi Java library
import urbi.UClient;
- Declare a Urbi client:
public Uclient cli ;
- Instantiate-it precising the Ipv4 address, the port and buffer size :
cli = new UClient(‘‘127.0.0.1‘‘, 54001, Uclient.URBI_BUFLEN) ;
- Send orders to Reeti :
Syntaxe : cli.send(‘_MA COMMANDE ; ‘‘) ;
Exemple : cli.send(‘‘wall(‘‘\ Mon Premier message Java \‘‘);‘‘);
Program is ready to communicate with Reeti. Three different compiling methods exist.
- By command line:
Use command line « javac ». Don’t forget the option -Djava.library.path="<urbi-root>/lib".
- Under NetBeans (v 6.5 minimum)
Once you project created and opened, follow these steps:
- Right click on project name => Properties
- In libraries tab, click « Add JAR/Folder ». Choose Urbi Library named « liburbijava.jar » (on
SDK 2.6, library is in <urbi-root>/share/urbi-sdk/java/lib/)
- In tab Run, in « VM Options », enter: -Djava.library.path="<urbi-root>/lib"
- Compile
- « umake-java » method
There is a third method. This is the command urbi "umake-java". For more details on this method,
thank you for looking in the Urbi manual documentation (for version 2.6, this is page 52 of the SDK
pdf).
6 Java Standalone Applications : JAVA liburbi