Note
Full code documentation is available in docs.
This is the code for 1317's 2026 robot for this years Rebuilt FRC game!
The co-driver uses a Keyhive Maypad flashed with our custom firmware from df1317/maypad-frc. It enumerates as a USB HID joystick on DS port 2 — no drivers needed.
Note
Grab the latest firmware .hex from the
maypad-frc Actions tab.
Bindings use OperatorPanel, which exposes keys by physical position.
See docs/README.md for the full binding reference.
// RobotContainer.java
public class RobotContainer {
private final OperatorPanel panel = new OperatorPanel(2);
public RobotContainer {
// bind row 0, col 0 (top-left key) to a command
panel.key(0, 0).onTrue(Commands.run(() -> doSomething()));
}
}Warning
Make sure to do these instructions before you start working on the code. (Looking at you Holden and Rebekah 👀)
The Eclipse formatter profile is auto-imported and format-on-save is enabled. Just open the project and start coding - formatting happens automatically.
If for some reason it doesn't work:
- Settings → Editor → Code Style → Java → ⚙️ → Import Scheme → Eclipse XML Profile
- Select
eclipse-formatter.xml - Settings → Tools → Actions on Save → Enable "Reformat code" and "Optimize imports"
This project uses Prettier for formatting config files, documentation, and other non-Java files.
Install dependencies:
bun installFormat all non-Java files:
bun formatPlease follow the Conventional Commits standard for commit messages. This will help us keep track of changes and make it easier to generate changelogs. You are welcome to be funny in your commit message but please make sure the commit type is correct.
Here are some examples of commit messages that are and aren't acceptable:
✅ feat: add new feature
✅ bug: fixed the photonvision latency bug 🐞
⛔ added new feature
⛔ fixed smthing
✅ docs: update readme with commit warnings
⛔ updated readme :doc
😵 fixed elevator limits and weired negitive velocity :bug (ha take the mr k i did the fnacy commits)
✅ chore: ran prettier on the code for the 11 millionth time
Make branches early and often! If you are working on a new feature that isn't directly reliant on a side branch then make a new branch and open a PR as quick as possible. Be wary of working on too many branches at once though; it can get confusing. Aim to merge the branch once you have verified that the code works on the robot.
Make issues for any current/near term tasks and identified bugs. Issues should not be created for tasks planned for too far in the future.
We use DogLog for telemetry and logging. It automatically writes to DataLog files (.wpilog) for
AdvantageScope analysis and publishes to NetworkTables during development.
-
DogLog.log(key, value)- Development telemetry- Publishes to NetworkTables during practice/development
- Auto-disables NT when FMS connected (competition mode)
- Always writes to DataLog for post-match analysis
-
DogLog.forceNt.log(key, value)- Competition essentials- Always publishes to NetworkTables (even at competition)
- Use sparingly for driver dashboard critical values
- Also writes to DataLog
-
DevMode.isEnabled()- Gate expensive operations- Returns
truein practice/development (not at FMS) - Use for Field2d updates, extra computations, debug visualizations
- DogLog handles NT publishing automatically; use DevMode for non-logging overhead
- Returns
-
DogLog.tunable(key, defaultValue)- Runtime-adjustable values- Creates a NetworkTables subscriber for live tweaking (published under
Tunable/table) - Auto-reverts to default value when FMS connected (competition mode)
- Perfect for PID tuning, thresholds, and debug toggles
- Values are logged to DataLog under
Robot/Tunable/
- Creates a NetworkTables subscriber for live tweaking (published under
Development:
- Connect laptop to robot network
- Open AdvantageScope
- File → Connect to Robot → NetworkTables 4 → Enter robot IP
- All
DogLog.log()values stream live for debugging
Post-Match Analysis:
- Download
.wpilogfiles from roboRIO (/home/lvuser/logs/) - AdvantageScope → File → Open Files → Select
.wpilog - Analyze all logged data with full history and Field2d visualization
Competition:
- Only
forceNtvalues appear on Elastic dashboard - Everything still logs to DataLog for post-match review
public class Elevator extends SubsystemBase {
private final CANSparkMax motor;
@Override
public void periodic() {
// Auto-disables at competition
DogLog.log("Elevator/Position", motor.getEncoder().getPosition());
DogLog.log("Elevator/Velocity", motor.getEncoder().getVelocity());
DogLog.log("Elevator/Current", motor.getOutputCurrent());
// Essential for driver dashboard (always published)
DogLog.forceNt.log("Dash/ElevatorAtSetpoint", atSetpoint());
}
}public class SwerveSubsystem extends SubsystemBase {
// Toggle for enabling/disabling vision (editable in AdvantageScope/Glass)
private final BooleanSubscriber visionEnabled = DogLog.tunable("Swerve/VisionEnabled", true);
// PID tuning without redeploying code
private final DoubleSubscriber driveKp = DogLog.tunable("Drive/kP", 0.1);
@Override
public void periodic() {
if (visionEnabled.get()) {
updateVision();
}
}
}To change tunables at runtime:
- Open AdvantageScope or Glass
- Navigate to
Tunable/table in NetworkTables - Edit values live - changes apply immediately
- At FMS, tunables revert to defaults for safety
As much as possible try to use the WPILIB built-ins for commands and subsystems. WPILib has some awesome docs on Commands and Command Compositions as well as Subsystems.
Here is a quick example of a subsystem with a command and then a command binding to a button:
public class ExampleSubsystem extends SubsystemBase {
private final CANSparkMax motor;
public ExampleSubsystem() {
motor = new CANSparkMax(0, MotorType.kBrushless);
}
public Command runMotorCommand(DoubleSupplier speed) {
return new RunCommand(() -> motor.set(speed.getAsDouble()), this);
}
}public class RobotContainer {
private final ExampleSubsystem exampleSubsystem = new ExampleSubsystem();
private final CommandXboxController controller = new CommandXboxController(0);
public RobotContainer() {
controller.a().whileTrue(exampleSubsystem.runMotorCommand(() -> 0.5));
}
}
© 2026-present Digital Fusion FRC team 1317
