Code for our 2026 robot, Marvin 19
- An additional project will be created to generate a TunerConstants file for the actual robot
This guide is intended to help us recalculate swerve zeroes and deploy them onto the robot as fast as possible.
-
Set the module’s encoder offset in
TunerConstantsto0.0→ Deploy code -
Align the module to the zero position → Bevel gear aligned → Wheel straight forward
-
Read the absolute encoder value from NetworkTables / Elastic → ex.
DogLogSwerve/FLabsEncoderPos -
Compute the offset based on this value, from the negative of the current encoder value:
offset = -(absolute encoder reading) -
Update the offset in
TunerConstants -
Deploy code again
-
Verify drive when necessary
Time:
- 2 code deployments (20-60 seconds)
- Bevel alignment, Setting offset to 0 in code, reading offset from dashboard: (10-20 seconds)
drivePilot.back().onTrue(
Commands.sequence(
Commands.runOnce(() -> {
LimelightHelpers.SetIMUMode(VisionConstants.camera0Name, 1);
LimelightHelpers.SetIMUMode(VisionConstants.camera1Name, 1);
}),
Commands.waitSeconds(0.1), // give NT time to propagate + LL to process
Commands.runOnce(() -> {
manualDriveCommand.seedFieldCentric();
}),
Commands.waitSeconds(0.1), // give LL time to ingest the seeded heading
Commands.runOnce(() -> {
LimelightHelpers.SetIMUMode(VisionConstants.camera0Name, 4);
LimelightHelpers.SetIMUMode(VisionConstants.camera1Name, 4);
})
)
);