Extending REMOTE

One of the more powerful features of REMOTE is its ability to use third party parsers to provide functionality, such as support for a new simulator language, or a different 3D file format.  The REMOTE architecture allows developers to easily develop modules which can be dynamically loaded at run-time, providing the user with new functionality. 

The following sections introduce the knowledge required  to create new modules for REMOTE; it is assumed that the reader has a basic background in object-oriented programming, and in particular, is familiar with the syntax of the Java language.
 

Unpacking the Source Code

To see the source code for the default modules included with REMOTE, as well as the rest of the application source, use the JDK's jar tool to unpack the source code that accompanies the release.  From the REMOTE root directory, type: 
jar xfv remote_src.jar
This will create src directory containing the source code for the REMOTE application.  The default modules are the files called Default*Parser.java.
 

Robot Definition Parsers

The robot definition parser is responsible for reading a file which points to each 3D file required to represent each link of the robot, and the parameters associated with each link.  The class which defines the API (Application Programming Interface) for the robot definition parsers in REMOTE is called RobotParser.java.  The default robot definition parser which accompanies REMOTE is called DefaultRobotParser.java, and it implements the abstract methods that RobotParser defines.  In order to implement a new robot definition parser, a developer need only create a subclass of the RobotParser class, and provide a body for the abstract methods.
 

Simulation Language Parsers

The simulation language parser is responsible for parsing simulation commands from the simulation file, and producing a set of Commands that the simulator can understands.  The class which defines the API for the simulation language parsers in REMOTE is called CommandParser.java.  The default command parser which accompanies REMOTE is called DefaultCommandParser.java, and it implements the abstract methods that CommandParser defines, allowing REMOTE to understand a language loosely based on the Scorbot Scorbase language.
 

3D Model Parsers

The 3D model parser is responsible for parsing a 3D file and producing an internal representation of the 3D data.  The class which defines the API for the 3D model parsers in REMOTE is called ModelParser.java.  The default model parser which accompanies REMOTE is called DefaultModelParser.java, and it implements the abstract methods that ModelParser defines, allowing it to interpret Alias Wavefront .obj format files.
 

Internationalization Support

All elements of the REMOTE user interface use a property file with the base name Remote_Config*.properties to define the labels associated with menus and buttons, and the error messages returned by the application.  In order to add support for an unsupported language, simply make a copy of the Remote_Config.properties file, rename it using the ISO two-letter country code in the form:
Remote_Config_<Language>_<Variant>.properties
and edit the file's contents to provide the language's equivalent to the English properties.  So, for example, to create support for French-Canadian, you would copy the Remote_Config.properties file to Remote_Config_fr_ca.properties.  Editing the file, you would replace menus.file=File with menus.file=Fichier, and do the same for each entry in the file.  You can even force REMOTE to load a particular language set by typing at the command prompt:
java Remote <Language> <Variant>
In our French-Canadian example, you would type:
java Remote fr ca
to cause Remote to load the French-Canadian language resources.  If no resources for the particular language-variant combination or language exist, REMOTE will load the default English resources from Remote_Config.properties, or failing that, use the internal hard-coded resources.
 

[Previous][Contents][Next]
 
 

Copyright (c) 1996-2001 Brendon Wilson.
All Rights Reserved.