Integrating new Project with the Nengoros

Optional: Copying Jython Files into Nengo Simulator Folders

In order to use ROSjava nodes more efficiently and/or integrate into the Nengo GUI, the helper jython scripts (and other GUI data) can be placed under the projectTemplate/python and projectTemplate/images folders. In order to use these files in the Nengo simulator, the script demonodes/linkdata can copy these files in correct places under nengo/simulator-ui. Usage is as follows:

./linkdata -h
./linkdata -c ../projectTemplate
which will copy (or symlink) all helper files in correct places. Now, (after adding jar file to the classpath) it will be possible to:
  • Use your custom-defined GUI templates
  • Run your ROS nodes by Jython scripts under the Nengo commandline as follows:
./run nr-demo/projectTemplate/temp_logic_fuzzy_membership.py

For more information about the purpose of these folders,the file projectTemplate/python/README.md.

Now, the last step is to add Jar file into the nengo classspath. Your new project can be included in two ways:

  • Leave the project separated, link just jar file
  • Add project into the Nengoros multiproject tree

These two are described below.

Add a Jar File to the Nengo Classpath

To auto-generate jar file under: projectTemplate/libs/, run from the project folder:

./gradlew install

This Jar file needs to be added to the nengo launch scripts: nengo and nengo-cl located under nengo/simulator-uiExample of linking new project in the nengo/simulator-ui/nengo script:

NODES=$NODES:$N_HOME/../../projectTemplate/build/libs/projectTemplate-0.0.1-SNAPSHOT.jar

From now, the user can launch new ROSjava nodes from the Nengo simulator.

Adding Project into the Nengoros Hierarchy

This adds your new project into the Nengoros multi-project hiearchy, which ensures that it is updated each use of the ./tool script and can be easily used by other sub-projects.

  • Edit the `settings.gradle` file and add the name of your new project there. So the result could be:
// howto: '[folderName]:[subFolderName]:[projectName==folderName]'
include 'logic:gates', 'projectTemplate'
  • Add the dependency to the `nengo/simulator-ui` project by editing the `nengo/simulator-ui/build.gradle`, so the result could be:
dependencies {
 compile project(':nengo:simulator')
 compile fileTree(dir: 'lib', include: '**/*.jar')
 compile 'ros.rosjava_core:rosjava:0.0.0-SNAPSHOT'
 compile 'org.hanns.logic:gates:0.0.1-SNAPSHOT'
 // howto: '[projectFolder]:[projectName]'
 compile project('projectTemplate')
}
  • Recompile and reinstall the Nengoros project by running:
./tool -nf
Advertisements