Setting Up - sdp2012-group8/robot GitHub Wiki
This page details how to set-up the development environment for use with this project.
Install Eclipse
Download and install Eclipse. Either get it from their official website or use your distro's package manager.
It is not necessary, strictly speaking, but this project makes use of the Eclipse's building capabilities. If you want to use another/no IDE, you will have to sort out a build system on your own.
Install LeJOS
Download and install leJOS:
- Download leJOS libraries for the OS of your choice from here.
- Install .exe file/unzip the downloaded archive somewhere.
- Refer to the README.html file for the proper package installation. On Windows the .exe installer should handle everything for you. On Linux you should go to "lejos_nxj/build" directory and run
antto build it.
Install LeJOS Eclipse plugin
Download and install LeJOS Eclipse plugin (these instructions are correct for Eclipse version 3.7.1). Skip this step if you are not using Eclipse:
- Open Eclipse and go to Help -> Install New Software.
- Enter URL
http://lejos.sourceforge.net/tools/eclipse/plugin/nxj/into the "Work with" field, add it. - Select "leJOS NXJ plugin" in the widget below.
- Hit next, follow instructions until the plugin is installed.
- Open Eclipse again and go to "Windows -> Preferencees -> leJOS NXJ".
- Set NXJ_HOME field to point to the leJOS libraries you have downloaded in step 2 above.
Install WindowBuilder Pro
Install WindowBuilder Pro to work on GUI code.
- Open Eclipse and go to Help -> Install New Software.
- Enter a URL that applies to your version of Eclipse from here into the "Work with" field, add it.
- Select "Swing Designer -> Swing Designer" in the widget below.
- Hit next, follow instructions until the plugin is installed.
Get the Source Code
- Open a terminal and navigate to a folder from where you will be working.
- Clone the git repo: issue the command
git clone https://[email protected]/sdp2012-group8/robot.git. Be sure to replace YOUR_GITHUB_USER_NAME with your actual github username. - Open Eclipse and set the folder that was created in the above step as your workspace.
- Go to File -> Import -> General -> Existing Projects into Workspace. Select the root directory to be the same folder, make sure that all projects are selected and click Finish.
Set LD_LIBRARY_PATH
Be sure to set LD_LIBRARY_PATH environment variable to project_root/lib directory before running the system or launching Eclipse! If you have v4l4j and javacv installed locally, then this step is unnecessary, but on a DICE machine this is a requirement.
To set the variable, run
cd /path/to/projects/source/code
cd lib
export LD_LIBRARY_PATH="$PWD"
you can then start Eclipse or the system from the same terminal window.
You will have to do this every time you login to DICE. To make this permanent, add
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/path/to/projects/source/code/lib"
to the end of ~/.bashrc or equivalent.
Finally
At this point you should be able to start Eclipse and use it compile, run and modify the project. If not, double check that the above steps have been carried out correctly, especially setting NXJ_HOME and LD_LIBRARY_PATH variables.
Further reading: Running the System.