Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
],
"java.configuration.updateBuildConfiguration": "automatic",
"java.debug.settings.onBuildFailureProceed": true,
"java.dependency.enableDependencyCheckup": false,
"java.import.gradle.annotationProcessing.enabled": false,
"java.inlayHints.parameterNames.enabled": "literals",
"java.inlayHints.parameterNames.exclusions": [
Expand Down
2 changes: 1 addition & 1 deletion .wpilib/wpilib_preferences.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"enableCppIntellisense": false,
"currentLanguage": "java",
"projectYear": "2025",
"projectYear": "2026",
"teamNumber": 340
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Team 340
Copyright (c) 2023-2026 Team 340

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ A template repository for Java-based robots in the FIRST Robotics Competition.

### Prerequisites

- [WPILib](https://github.com/wpilibsuite/allwpilib/releases) 2025.x
- [WPILib](https://github.com/wpilibsuite/allwpilib/releases) 2026.x
- [Node.js](https://nodejs.org/en/download) (v24 LTS Recommended)

Node.js is required to support linting via [Spotless](https://github.com/diffplug/spotless), using the [Prettier](https://prettier.io) style guide. You can apply these rules by building, or by running `./gradlew spotlessApply`. Alternatively, if you wish to disable code formatting, you can do so with the following modifications to [build.gradle](build.gradle):
Expand All @@ -44,7 +44,7 @@ diff --git a/build.gradle b/build.gradle
@@ -1,7 +1,6 @@
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2025.3.2"
id "edu.wpi.first.GradleRIO" version "2026.1.1"
- id "com.diffplug.spotless" version "8.1.0"
}

Expand All @@ -65,7 +65,7 @@ diff --git a/build.gradle b/build.gradle
- endWithNewline()
- removeUnusedImports()
- trimTrailingWhitespace()
- prettier(['prettier': '3.7.4', 'prettier-plugin-java': '2.7.7'])
- prettier(['prettier': '3.7.4', 'prettier-plugin-java': '2.8.1'])
- .config([
- parser: 'java',
- plugins: ['prettier-plugin-java'],
Expand Down
2 changes: 1 addition & 1 deletion WPILib-License.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2009-2024 FIRST and other WPILib contributors
Copyright (c) 2009-2026 FIRST and other WPILib contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2025.3.2"
id "edu.wpi.first.GradleRIO" version "2026.1.1"
id "com.diffplug.spotless" version "8.1.0"
}

Expand Down Expand Up @@ -60,7 +60,8 @@ deploy {

def deployArtifact = deploy.targets.roborio.artifacts.frcJava

// Set to true to use debug for JNI.
// Set to true to use debug for all targets including
// JNI, which will drastically impact performance.
wpi.java.debugJni = false

// Set this to true to enable desktop support.
Expand Down Expand Up @@ -103,7 +104,7 @@ spotless {
endWithNewline()
removeUnusedImports()
trimTrailingWhitespace()
prettier(['prettier': '3.7.4', 'prettier-plugin-java': '2.7.7'])
prettier(['prettier': '3.7.4', 'prettier-plugin-java': '2.8.1'])
.config([
parser: 'java',
plugins: ['prettier-plugin-java'],
Expand Down Expand Up @@ -131,7 +132,9 @@ wpi.sim.addDriverstation()
// knows where to look for our Robot Class.
jar {
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
from sourceSets.main.allSource
from('src') { into 'backup/src' }
from('vendordeps') { into 'backup/vendordeps' }
from('build.gradle') { into 'backup' }
manifest edu.wpi.first.gradlerio.GradleRIOPlugin.javaManifest(ROBOT_MAIN_CLASS)
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
String frcYear = '2025'
String frcYear = '2026'
File frcHome
if (OperatingSystem.current().isWindows()) {
String publicFolder = System.getenv('PUBLIC')
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/org/team340/lib/logging/LoggedRobot.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
import edu.wpi.first.epilogue.logging.EpilogueBackend;
import edu.wpi.first.hal.DriverStationJNI;
import edu.wpi.first.hal.NotifierJNI;
import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.wpilibj.DataLogManager;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.IterativeRobotBase;
import edu.wpi.first.wpilibj.RobotController;
import edu.wpi.first.wpilibj.Threads;
import java.util.function.Consumer;
import org.team340.lib.logging.shim.NTEpilogueBackend;
import org.team340.lib.tunable.Tunables;
import org.team340.lib.tunable.Tunables.Tunable;
import org.team340.lib.util.DisableWatchdog;
Expand Down Expand Up @@ -59,9 +57,6 @@ protected LoggedRobot(double period) {
DriverStation.startDataLog(DataLogManager.getLog());
DriverStation.silenceJoystickConnectionWarning(true);

// TODO Remove for 2026
EpilogueProxy.getConfig().backend = new NTEpilogueBackend(NetworkTableInstance.getDefault());

EpilogueProxy.getConfig().root = "/Telemetry";
logger = EpilogueProxy.getLogger(this);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.team340.lib.logging.revlib.structs;

import com.revrobotics.RelativeEncoder;
import com.revrobotics.spark.SparkBase;
import edu.wpi.first.util.struct.Struct;
import java.nio.ByteBuffer;
Expand All @@ -9,14 +8,15 @@ public abstract class SparkBaseStruct<T extends SparkBase> implements Struct<T>

@Override
public int getSize() {
return kSizeDouble * 6 + SparkFaultsStruct.struct.getSize() * 2 + SparkWarningsStruct.struct.getSize() * 2;
return kSizeDouble * 7 + SparkFaultsStruct.struct.getSize() * 2 + SparkWarningsStruct.struct.getSize() * 2;
}

@Override
public String getSchema() {
return (
"double appliedOutput; "
+ "double appliedVoltage; "
+ "double closedLoopSetpoint; "
+ "double motorTemperature; "
+ "double outputCurrent; "
+ "double position; "
Expand Down Expand Up @@ -44,10 +44,12 @@ public T unpack(ByteBuffer bb) {
@Override
public void pack(ByteBuffer bb, T value) {
double appliedOutput = value.getAppliedOutput();
RelativeEncoder encoder = value.getEncoder();
var closedLoopController = value.getClosedLoopController();
var encoder = value.getEncoder();

bb.putDouble(appliedOutput);
bb.putDouble(appliedOutput * value.getBusVoltage());
bb.putDouble(closedLoopController.getSetpoint());
bb.putDouble(value.getMotorTemperature());
bb.putDouble(value.getOutputCurrent());
bb.putDouble(encoder.getPosition());
Expand Down
Loading