Contains helpful information for developing and debugging software for FRC.
- FRC Docs
- WPILib Docs
- Team 3256 2022 Code (For Reference)
###Pushing Code
Standard Method
git add .
git commit -m"<Your commit message>"
git pull
git push
Merge Conflicts
Either (more common) merge your code with git merge
. If you don't want to merge then temporarily shelve your changes before pulling with git stash
###Creating a branch
Give branches descriptive names (all lower case), replace spaces with “-”, prefix with “feature” or “fix". Good examples include fix/5-ball-auto
, feature/transfer-subsystem
, feature/acceleration-limiting
.
Creating a pull request
Go to the pull request tab on GitHub and select New pull request. Link the pull request to the proper GitHub issue if there is any. Add at least one lead as a reviewer.
Following Motors
- Create a leading motor and a following motor.
- Set the following motor to follow the leading motor
Example:
TalonFX followingMotor = new TalonFX(id);
followingMotor.follow(masterMotor);
###Pneumatics
Double Solenoids
Example
DoubleSolenoid example = new DoubleSolenoid(PNEUMATICS_HUB_ID, PneumaticsModuleType.REVPH, FORWARD_ID, BACKWARD_ID);
###Flashing the Radio
- Create a new file for each command
- Put the subsystems used in a command as dependencies
- Each command should have
initialize
,execute
, andend
methods. Reference commands from 2022 FRC code
Example Command:
public class CommandName extends CommandBase {
private IntakeSubsystem intake;
public CommandName(IntakeSubsystem intake){
this.intake = intake;
}
public void initialize() {...}
public void execute() {...}
public void end(boolean interrupted) {...}
}
Command Groups
Lambdas in Java
###PID Controllers with feed forward
###Logging and debugging
###Vision and Odometry
Run ./gradlew test
in Terminal