A few things you will need before diving in:
- An installation of the JDK, Netbeans, and the FRC Plugins (see below).
- An installation of git and a working knowledge of git, as well as a GitHub account.
- You'll need to know how the CommandBased Robot template works (see WPILib Robot Programming Cookbook).
- Be sure to document your code clearly by explaining exactly what your code does using comments. This is so others can improve and debug your code more efficiently.
NOTES:
On step 1: Go to http://www.oracle.com/technetwork/java/javase/downloads/index.html instead.
On step 2: For JDK 6 choose "JDK 6u37 with NetBeans 7.2.1" instead.
On step 2: For JDK 7 choose "JDK 7u9 + NetBeans" or "JDK 7u9 with NetBeans 7.2.1" instead.
Quoted from the Getting Started with Java for FRC document (download available in the Resources section).
To install the latest versions of NetBeans and Java from the Internet:
- Open your browser and go to: http://java.sun.com/javase/downloads.
- Select the "JDK 6 Update 17 with NetBeans 6.7.1" (or later version) by clicking the "Download" button. (The specific version may change since both NetBeans and Java are often updated, but the steps should be similar even with later builds.) If a JDK is already installed, you can download NetBeans only from http://netbeans.org/downloads/, choosing the "Java SE" bundle will be fine for this.
- Select the "Continue" button on the left, under the "Platform" drop down.
- On the "Log In for Download" pop-up, click on "Skip this step" or close the pop-up.
- If Internet Explorer beeps and presents a "To help protect your security, Internet Explorer blocked this site from downloading files to your computer. Click here for options..." then click and select "Download File"
- You will be presented with a "File Download - Security Warning" dialog, with "Run", "Save" and "Cancel" for options.
- Choose "Save" if you wish to take this file and bring it to another machine, and then proceed to the rest of these instructions to install the downloaded bundle.
- Choose "Run", or launch the downloaded executable.
- Accept all the default settings and let the installer install the JDK and NetBeans on your system.
- When presented with the "Setup Complete" panel from the "Java SE Development Kit and NetBeans IDE Installer", press "Finish" You can choose to accept the two check boxes presented, or not.
You should find a new shortcut on your desktop labeled "NetBeans IDE 6.7.1".
NetBeans and Java work equally well on Linux although we have focused our testing on Windows and Mac OS X. You may try developing on Linux platforms by following these steps:
- Install the Java JDK if it is not already present on the computer.
- Download and install the latest version of the NetBeans IDE.
- Installing the plugins from the update site as shown in the instructions provided in "Installing the FRC Plugins", later on in this document.
This should provide a working development system.
Java is already part of Mac OS X so it doesn't need to be installed. Follow these steps:
- Download and install the latest version of the NetBeans IDE.
- Installing the plugins from the update site as shown in the instructions provided in "Installing the FRC Plugins" later on in this document.
Quoted from the Getting Started with Java for FRC document (download available in the Resources section).
If Using GitHub for Windows: http://windows.github.com/help.htmlTo install the plugins from the Internet follow the following procedure:
Run NetBeans using the Start menu or the desktop shortcut.
Select "Tools" then "Plugins" from the main menu in NetBeans.
Select the "Settings" tab, and then press the "Add" button to add a new Update Center.
For the name, enter "FRC Java" and for the URL enter:
http://first.wpi.edu/FRC/java/netbeans/update/updates.xml
and press the OK button. Be sure to check for the current update site at http://first.wpi.edu since the update site may change as FPGA updates are released.
Select the "Available Plugins" tab and select all the plugins in the "FRC Java" category and click the "Install" button.
Advance by clicking the "Next" button and accept the agreements and install the plugins. Ignore the "Validation Warning" dialog where it informs you that "The following plugins are not signed:" and press the "Continue" button.
On the "Restart NetBeans IDE to complete the installation" window, use the "Restart IDE Now" option and press the "Finish" button.
After restarting NetBeans you should notice the FIRST logo button in the toolbar. This confirms that the module has been installed properly. The plugins are installed; a little configuration is required.
Select "Tools" menu, and choose the "Options" menu options, from the NetBeans menu bar.
Select the "Miscellaneous" tab. Then select the "FRC Configuration" tab and enter your team number into the text field. Then press OK. NetBeans will periodically check for new updates and offer to install them when they become available. Be sure to keep your installation current to get the latest bug fixes and improvements.
If Using GitHub for Mac: http://mac.github.com/help.html
(Remember Git is installed with the GitHub client and it is also integrated with the GitHub client)
If Using Git (Shell) Commands:
Setting Up Git With Your GitHub Account: https://help.github.com/articles/set-up-git
-
You'll want to clone this git respository by moving to the directory where you want the project file and executing
git clone https://github.com/Team3482/FRC-3482-2012.git
-
Now you should have a folder named "FRC-3482-2012". This is the Netbeans project which you'll want to open up using -- you guessed it -- Netbeans. Change whatever code you'd like, and save.
-
Next, you want to execute the following command to create a new "branch" for yourself.
git branch <branch name>
Be sure to replace
<branch name>
with a name specific to you -- perhaps something like<your name>s-branch
. You only have to do this once.You can use the
git branch
command to view all of the other branches available in the project, and an asterisk will be displayed next to the branch that you're currently in. To change branches, rungit checkout <branch name>
Make sure you are in the branch that you have just created before moving on to step 4.
-
Once you're done making changes, execute the following to save your changes within the git project:
git commit -a -m "<your message>"
Be sure to replace
<your message>
with a message that details the changes you made/features you added.Once you're finished, run the following to update your changes on GitHub:
git push origin <branch name>
-
Use the
git fetch
command to update your local project to the most recent version. -
Please also learn more about the
git branch
,git merge
,git log
,git status
,git commit
, andgit pull
commands (see Git Basics (and more) under Resources)
[GitHub for Windows (url) ] (http://windows.github.com/)
[GitHub for Mac (url) ] (http://mac.github.com/)
FIRST Robotics Competition Website (url)
FIRST Robotics Resource Center - Java (url)
Getting Started with Java for FRC (pdf)
WPILib User's Guide (pdf)
WPILib Javadoc (zip)
FIRST Java Forums (url)
Helpful Documents for the 2012 Game (url)
C++/Java Documentation (url)
WPILib Robot Programming Cookbook (pdf)
GitCasts (url)
Git Magic (courtesy of Standford CS) (url)
Learn.GitHub (url)
github:help
Pro Git
More Git Resources!