This is the incubating software framework for ILITE's 2019 season.
The project consists of three subprojects: robot
, display
, and common
.
By separating code into subprojects, we can ensure that robot
doesn't accidentally
call JavaFX libraries from the display
project, and vice-versa. Instead, we can allow
the robot
and display
packages to both use code in the common
package
The robot
subproject contains code running on the actual robot.
us.ilite.us.ilite.common.lib - Contains hardware drivers and utilities that are dependent on WPILib components.
us.ilite.robot - Parent package for all robot code
commands - Contains autonomous commands
hardware - Contains hardware classes that allow modules to interface with hardware
loops - Contains high-frequency loops running on the robot
modules - Contains the modules that control subsystems on the robot
The common
subproject contains code shared by the robot
and display
subprojects, such
as common data structures + more.
config - contains constants, etc.
us.ilite.common.lib - contains generic classes used from year-to-year
geometry - Contains geometry classes used to represent robot movement
util - Utility classes that are not dependent of WPILib
types - Contains enumerations defining common data structure used throughout other subprojects
The display
subproject contains the code for running the driver's display, autonomous selection,
and logging software.
logging - Contains logging code
display - Contains display code
Install VSCode from here
You'll need the following extensions:
- Java Extension Pack - Provides Java support for VSCode.
- VS Live Share - Edit code together in real-time, or review code with a bunch of people.
- Gradle Language Support - Provides language support for Gradle. Lets us better edit gradle files.
- Git Project Manager - Once configured, lets you open projects by selecting from a list of Git projects on your computer.
- Gnuplot - GNUPlot language support. Useful for viewing logs.
- Keybindings from your favorite Java editor (Eclipse, IntelliJ, etc.)
- Path Intellisense - Autocomplete file paths
- A nice-looking theme
You'll have to provide VSCode with the location of your JDK installation. If you don't have the JDK installed, click here
- Navigate to
File -> Preferences -> Settings
- Search for "jdk" in the search bar
- Click
Java Configuration
on the left-hand sidebar. The only setting visible should beJava: Home
- Click on
Edit in settings.json
- The right-hand side stores any settings made by the user. Add a line like this:
"java.home": "/Path/To/JDK/Installation",
- If you don't know where your JDK installation is, it's probably in
C:/Program Files/Java/jdk1.x.x_xxx
, where thex
's are version numbers specific to your installation.
- If you don't know where your JDK installation is, it's probably in
- You're done! Wait a bit for the Java Language Server to start up and recognize your project (you should see a little spinning icon at the bottom of your screen),
then test it out by clicking on a variable type (like
Module
orDrive
orDouble
) and pressing F12. If all goes well, you should be taken to the definition of that class.
It's pretty easy. File -> Open Folder...
, then navigate to the repository you have cloned (The folder named FRC-Robot-YYYY
).
- To build, run
gradlew build
- To deploy to the robot, run
gradlew deploy
- Remember to build before you deploy
Here's how to get your code into the main robot repository:
- Make an account on GitHub.
- Ask one of the robot programming leads to add your account to the iliterobotics robot programming team.
- Clone the repo to your computer -
git clone https://github.com/iliterobotics/FRC-Robot-2019
- Create and checkout a new branch.
git checkout -b <your_branch_name>
, where <your_branch_name> is a descriptive name for your branch. For examplefix-shooter-wheel
,two-ball-auto
, orclimbing
. Use dashes in the branch name, not underscores.
- Make whatever code changes you want/need/ to make. Be sure to write tests for your changes!
- Commit your work locally.
- Try to make your commits as atomic (small) as possible. For example, moving functions around should be different from adding features, and changes to one subsystem should be in a different commit than changes to another subsystem.
- Follow these conventions for commit messages. Or else.
- If your change is anything more than a few lines or small fixes, don't skip the extended description. If you are always using
git commit
with the-m
option, stop doing that.
- Push to your branch.
git push origin <your_branch_name>
.
- Submit a pull request.
- Log into Github.
- Go to the page for your forked repo.
- Select the branch that you just pushed from the "Branch" dropdown menu.
- Click "New Pull Request".
- Review the changes that you made.
- If you are happy with your changes, click "Create Pull Request".
- Wait
- People must review (and approve of) your changes before they are merged - master is locked to any pull requests that don't have at least 2 reviews.
- Specifically, the rules are that one of the following two conditions must be true for it to get merged:
- 1 mentor and 1 other person have approved
- 2 experienced students and one other person have approved
- Specifically, the rules are that one of the following two conditions must be true for it to get merged:
- If there are any concerns about your pull request, fix them. Depending on how severe the concerns are, the pull request may be merged without it, but everyone will be happier if you fix your code. To update your PR, just push to the branch you made before.
- Don't dismiss someone's review when you make changes - instead, ask them to re-review it.
- Merge your changes into master
- If there are no conflicts, push the "Squash and merge" button, write a good commit message, and merge the changes.
- If there are conflicts, fix them locally on your branch, push them, wait for Jenkins to pass, and then squash and merge.
- ???
- Profit
If you're having trouble with IntelliJ, run gradlew clean build
. This
deletes any compiled Java files and rebuilds the project.
You can run any of these with ./gradlew <insert-tool-name-here>
- Lets you view values posted to NetworkTables and put them into widgets
- Make sure the server address is set the correct address (File -> Preferences -> NetworkTables)
- View console output from the RoboRIO in your terminal
- You can also see this from the driver station
- Like ShuffleBoard, but you can only view raw values and can't set values. Useful for fast debugging.
You can add "remotes" to github that refer to other people's robot code repos. This allows you to, for example, take a look at someone else's code to look over it, you would be able to git checkout wesley/branch-that-breaks-everything
to see it. To add a remote, just do git remote add <name_of_person> https://github.com/<username>/robot-code
. Once you've done this, you can use git fetch <name_of_person>
to get updated code from other people's repos!