There are 2 contexts which you may wish to start using MyRobotLab. They are :
- User - someone who uses MyRobotLab on some project. They are interested in only utilizing the current capabilities of MyRobotLab and are not interested in developing new Services. You may develop new functionality in Python within a "User" context and do not need Eclipse or any other dependencies.
- Developer - someone who is interested in creating new Services in Java. They are interested in extending the functionality of MyRobotLab.
- Install Java 1.8 for your operating system, please chose 64bit version if your system is 64.
- Download MyRobotLab in it's latest build
- Currently you can use the GUI to change message routing and some parameters of configuration, or you may use the Jython Service to create (Python-)scripts. The Jython environment has access to nearly all functionality of MyRobotLab.
- Check out the Tutorials for something you like, or make a request for a new tutorial.
- Install JDK 1.8 ( not JRE ) for your operating system
- Install Eclipse unless you have a preference "Eclipse Standard" is a great IDE
- Missing JDK TOOLS mod :
Edit eclipse.ini and replace jre by jdk :
C:/Program Files/Java/jre[VERSION]/bin/
by :
C:/Program Files/Java/jdk[VERSION]/bin/
-
Start Eclipse - put in a simple directory name (no spaces or unicode characters)
-
Next Select Menu Windows->Open Perspective->Other->Git
Clone a Git repository
We have 1 GitHub repo we want cloned :
https://github.com/MyRobotLab/myrobotlab
Use your own GitHub credentials if you have them - they aren't necessary if you just want to clone.
You can select needed branch, develop branch is current WIP, master the last stable.
I do not usually like the "default" location it chooses - but prefer a subdirectory to my workspace. Also click the Import all existing projects after the clone finishes
Switch now to Java view
Click File / import maven
- Select folder where GIT downloaded the repository, to select the pom.xml file
- It will take a long time. I would recommend finding something else to do instead of watching the green bar. Perhaps learn how to play the guitar ...
- From package explorer, on the left, double-click on main.java.org.myrobotlab.service.Runtime This will bring the Runtime service into the editor. The Runtime is the first service which starts when MyRobotLab begins. It controls starting and stopping other Services. This is the service we want to start to run MyRobotLab interactively through the Eclipse debugger.
-
PRESS F11
This will start the debugger, which if you don't have any errors should start the Runtime service. You can switch to the debug perspective, and it should look like this. -
It doesn't do anything and ends quite quickly. That is because there are no command line parameters and the Runtime does not know what to do.
Add the following parameters
Right-Click on the Runtime file and select "Debug As -> Debug Configurations"
The --service tells which services to start and what to name them. In this case we are going to start a SwingGui service who's name is "gui". You can add on to this command as many services as you want. For example --service gui SwingGui python Python will start a GUIService named gui and a Python service named python.
- Parameters Explained:
-
--service gui SwingGui Starts a SwingGui service named "gui", you may start multiple services at once with this command parameter. It will need to follow this convention --service <serviceName> <serviceType> <serviceName> <serviceType> ....
For example, --service gui01 SwingGui editor Jython
Starts a swingGui named gui01 and a Jython service named editor - -logLevel sets the current log4j level, other levels include (FATAL, ERROR, WARN, INFO, DEBUG)
- -logToConsole redirects logging to the eclipse console, otherwise default behavior will be to a myrobotlab.log file
-
VM Arguments
-Djava.library.path="libraries/native/x86.32.windows;libraries/native/x86.64.windows" on Windows or
-Djava.library.path="./libraries/native/x86.32.linux:./libraries/native/x86.64.linux:./libraries/native/x86.32.mac" on Linux or Mac allows MyRobotLab to use native libraries required by some of the services (e.g. OpenCV, Arduino, Joystick, etc).
These directories are populated by the repo manager depending on what services are loaded & installed. - Hit F11 on the Runtime file and you should be up and running MyRobotLab in the Eclipse debugging perspective... have fun :)
Optional
- If you would like Mylyn connectivity install the Google Mylyn connector - http://knittig.de/googlecode-mylyn-connector/update/
- I like preserving syntax highlighting and formatting when copying / pasting code to blogs or posts. So I use http://www.java2html.de/ . CodeSnippet is another similar function plugin http://sourceforge.net/projects/cs4eclipse/
- If ant tasks with scp are needed you must download the scp modules here http://www.jcraft.com/jsch/
-
In order to run the ant script svnversion is required - on Ubuntu:
$sudo apt-get install subversion-tools
will load the required application
Personnal contributions : https://github.com/MyRobotLab/pyrobotlab/tree/develop/home
Services scripts : https://github.com/MyRobotLab/pyrobotlab/tree/develop/service