robopec Developer’s guide C++, Urbi, Flex, Java
Developer’s guide - C++, Urbi, Flex, Java - V2.0 2 robopec Summary 1 General ............................................................................................................................................ 3 2 Reeti’s architecture ......................................................................................................................... 4 2.1 Hardware ..............................................................................................................................
Developer’s guide - C++, Urbi, Flex, Java - V2.0 3 robopec 1 General About this guide: In order to reduce our paper consumption and according to our responsible and respectful measures for the environment, Robopec prefers to put online those documents for users instead of printing them. You can find more information on the website www.reeti.fr on which you will find more examples, tutorials, FAQ, and a Forum for Assistance.
Developer’s guide - C++, Urbi, Flex, Java - V2.0 4 robopec 2 Reeti’s architecture Reeti’s iphone App network URBI console FLEX interface Figure 1 Reeti’s architecture 2.1 Hardware Hardware is every device which equipped Reeti. It includes his motherboard, his power board , his speaker, his robotic head. 2.2 Ubuntu Reeti operates a Linux Ubuntu 14.04 Trusty. This document is the property of Robopec.
Developer’s guide - C++, Urbi, Flex, Java - V2.0 5 robopec 2.3 Urbi All the functionalities on Reeti have been developed on URBI, a middleware by GOSTAI. (http://www.gostai.com/products/urbi) allowing to easily develop robotics codes. When starting, Reeti runs an URBI server and loads Modules and URBI script functions containing the functionalities of Reeti. Reeti gets his order from interfaces that act on the server.
Developer’s guide - C++, Urbi, Flex, Java - V2.0 6 robopec 3 Reeti’s tree Reeti has a development’s tree that makes it easy to find the necessary elements for development. 3.1 reetiDocuments Documents or content files (poses, sequences, TextToSpeech, video, images ...) used by Reeti must all be placed in the directory /home/reeti/reetiDocuments and under the corresponding directory.
Developer’s guide - C++, Urbi, Flex, Java - V2.0 7 robopec 3.2 reetiPrograms Your own programs developments should be placed in /home/reeti/reetiPrograms.
Developer’s guide - C++, Urbi, Flex, Java - V2.0 8 robopec 4 Flex Interface creation You can create two types of Reeti applications: a desktop application or an application for Reeti’s Launcher integrated in the Reeti’s framework. 4.1 Flex Development environment We use Flash Builder 4 on a windows computer. We made a procedure to produce a fake reeti files tree on your windows computer in order to be able to run your flex development directly in Flash Builder.
Developer’s guide - C++, Urbi, Flex, Java - V2.0 9 robopec name Hello Translation files for all applications are merged into a single database on Reeti. This allows you to reuse the translations from other applications. Nonetheless, if the same xml tag is present in two files, only one translation will be taken into account, that of the first file loaded.
Developer’s guide - C++, Urbi, Flex, Java - V2.0 10 robopec xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:local="*" creationComplete="creation()" xmlns:components="components.*" m_appName="RTip" >
-
Developer’s guide - C++, Urbi, Flex, Java - V2.0 11 robopec 4.3 Flex Stand-alone Application A stand-alone application is an AIR application on which you add classic order’s dispatch features to Reeti using the class "communication" in the library PublicGUITools provided on Reeti. Be careful, class communication can only be used locally on AIR and Reeti. The use of class communication in a Flash or AIR project on another machine than Reeti is currently not supported and will not work.
-
Developer’s guide - C++, Urbi, Flex, Java - V2.0 12 robopec { //We instantiate the object Communication com = Communication.getInstance(0); //On change on connection com.addEventListener("connection", changeConnection); } //Callback on change on connection private function changeConnection(ev:EventDataReception):void { //If connection is ok, moves Reeti’s ear if (int(ev.message)==1) com.write("Global.servo.leftEar=10;"); } ]> 4.4 Useful functions of PublicGUITool 4.4.
robopec Developer’s guide - C++, Urbi, Flex, Java - V2.0 13 On data reception, the application calls « reception » function which checks the message and executes the code. 4.4.2 EventDataReception class Event contening a message in the field message. Example : dispatchEvent(new EventDataReception("event",true,true,"my_message")); my_component.addEventListener("event", my_function); First line is for dispatching an event named “event” with message “my_message”.
Developer’s guide - C++, Urbi, Flex, Java - V2.0 14 robopec 5 C++ Standalone Applications (C++ liburbi) 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. In order to communicate with URBI in C++, follow these steps: - - - Create your C++ software Include UClient header : o #include
Developer’s guide - C++, Urbi, Flex, Java - V2.0 15 robopec 6 Java Standalone Applications : JAVA liburbi 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).
Developer’s guide - C++, Urbi, Flex, Java - V2.0 16 robopec 7 C++ URBI modules An URBI module is a C++ library that will allow you to add instructions understood by the URBI server. Instructions can be of two types: - variables functions 7.1 Create a URBI module Declare a class as URBI module For a class to be loaded and interpreted by a module URBI, you must do as follow when creating it: - - Includes library urbi/uobject.hh (in /usr/share/gostai/includes) : o #include
Developer’s guide - C++, Urbi, Flex, Java - V2.0 17 robopec Declare a function In your class, you can create all functions as normal, but if you want a function to be accessible by URBI, you must declare it as: - Declare your function public.
Developer’s guide - C++, Urbi, Flex, Java - V2.0 18 robopec Ma_classe(const string &n); // ‘‘Real’’ constructor URBI taking an int and a string int init(string _IP, int _port); //A declared function to URBI int play(string _str); private: // client to send orders to URBI UClient * client; //Classical function void do(); // UVar declared to URBI UVar something; // Callback function on « something » changes int somethingChange(UVar& var) ; }; #endif Source file: Ma_classe.cpp #include"Ma_classe.
Developer’s guide - C++, Urbi, Flex, Java - V2.0 19 robopec } //function do void Ma_classe::do() { //launch do_something() to URBI Client->send(”do_something();”); } //Function calledas soon as something variable changes int Ma_classe::somethingChange(UVar& var) { //Get the UVar in a classical type int a=static_cast(var); cout<
robopec Developer’s guide - C++, Urbi, Flex, Java - V2.0 20 8 The URBIscript First you need to learn the URBIscript language: - refer to URBI Documentation /home/reeti/ReetiDocuments/Help/ try the special Reeti Urbiscript tutorial : /home/reeti/ReetiDocuments/Sample/Urbi/script/ Procedure to integrate your functions at Reeti launch : - Put your function in a .u file Copy it in /home/reeti/reetiPrograms/functions/ Edit /home/reeti/reetiPrograms/load/functions.
robopec 10Main Reeti Functions and variables Here we present a list of key features of Reeti API.. For complete documentation, please refer to html API in /home/reeti/reetiDocuments/DevelomentDoc/ReetiAPI/index.html Function server.systemLaunch(string) Use Executes system code Example Global.server.launch(‘’mkdir my_file‘’) ; Loads and play the file in argument servo.neutralPosition() Sending 0 : success 1 : failure 0 : success 1 : failure - Put Reeti in neutral position Global.server.
Developer’s guide - C++, Urbi, Flex, Java - V2.0 22 Variable clock.day clock.month clock.year clock.weekday clock.hour clock.minute clock.second clock.age servo.color servo.neckRotat servo.neckTilt servo.neckPan servo.leftLC servo.rightLC servo.bottomLip servo.topLip servo.leftEar servo.rightEar servo.leftEyePan servo.leftEyeTilt servo.leftEyeLid servo.rightEyePan servo.rightEyeTilt servo.
robopec 11Contacts and complementary Information The Reeti is designed by Robopec, SARL with a capital of € 22 000, registered in the Trade and Companies of Toulon under number 508 693 470 0002 5, whose head office is located at 183 chemin des Négadoux - 83140 - Six Fours Les Plages - France. You can contact Robopec or for more information about the Reeti on www.reeti.fr or by writing to contact@reeti.fr. The pictures in this manual are not contractual.