This is The Metal Jackets robot code for the 2023 FIRST Robotics Competition, Charged Up.
- FIRST Robotics Competition Docs
- SPARK MAX and Status Lights/Codes
- REV Robotics Analog Pressure Sensor
- LimeLight
- REV Robotics Color Sensor
- PathPlanner
- PhotonVision
Until we define our own coding style, we'll use Google's and record any deviations here.
Follow the WPILib Installation Guide to set up your environment.
You'll need the following extensions:
- TBD
- TBD
You should've already set the location of your JDK installation in the above tutorial. If you need to set it again, here are the instructions.
- 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 at the end of the file:
"java.home": "/Path/To/JDK/Installation"
- If you don't know where your JDK installation is, it's probably in
C:\Users\<Your Username>\frc2020\jdk
.
- 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 left 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 Muhkeignzeigh
this year).
- Run these commands from Git Bash (or through the VS Code interface)
- To build, run
./gradlew build
- To deploy to the robot, run
./gradlew deploy
- Remember to build before you deploy
- To do both at once, run
./gradlew build 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 Team2068 robot programming team.
- Clone the repo to your computer using the current URL,
git clone https://github.com/Team2068/Muhkeighzeigh.git
We use a feature branch workflow. You can read more about that here.
- 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
. 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.
- If you're on a shared laptop set the author of the commit message by:
git commit --author="Author Name <email@address.com>"
- Try to make your commits small, like example. 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.
- Just give a short summary. or follow these for conventions.
- 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.
- Select the branch that you just pushed from the "Branch" dropdown menu.
- Click "New Pull Request".
- Review the changes that you made.
- Explain what and why you did the things you're trying to commit. Make the reviewer's life easier.
- 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.
- If there are any concerns about your pull request, fix them; just do it bro; 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 "merge" button.
- If there are conflicts, fix them locally on your branch, push them, wait for Travis CI to pass, and then merge.
Code reviews are one of the hardest things to get right. There's a lot of discussion about this online, and those before us said ddg i-
- Why: So code breakyless.
- How: Give short and precise comments about your findings. Make suggestions, link to documentation, generally be helpful.
- What are you looking for:
- Does it pass CI?
- Does it have Tests?
- Does it perform well?
- Is it readable?
You should probably check this before making a PRHas it actually been tested on the robot?