Generating Java Code for a project
After you start getting a significant part of your robot designed in RobotBuilder you can generate a Java project for use with Eclipse. The code that is generated includes project files that will let you just open the project and start adding your robot specific code. In addition, if you later make changes in RobotBuilder, you can regenerate the project again and it will not overwrite your changes. This process is described in detail below.
A number of settings get configured when you create a project using the Eclipse plugins. If you have not yet created a project from within Eclipse, you should do so before proceeding (you can delete the project after). Instructions for doing this can be found in the Creating your Benchtop Test Program article.
Setting up the project properties for export
Here is the procedure for setting up the project for Java code generation (export).
- Select the project name in the top of the robot description to see the project properties.
- Set the project name to something meaningful for your teams robot.
- Set the directory where the project should be saved. This might be inside your Eclipse Workspace directory or some other folder.
Generate the project files
Once the location of the exported project files is defined (previous step) either click on Java from the Export menu or use the "Java" item in the toolbar to generate code to the correct location. This will generate a full project the first time the button is pressed, or it will update the project with changes on subsequent exports.
Import the project into Eclipse
Right-click in the Project Explorer and import your project from the location set in RobotBuilder. Ideally the project has been saved in your workspace.