Skip to content

Commit

Permalink
Upgrade lib to use 2024 version of wpilibNewCommands
Browse files Browse the repository at this point in the history
The code in Robot2024 already uses this version.

- Copy WPILibNewCommands.json from vendordeps/ to lib/vendordeps
- Remove wpilibNewCommands from lib/build.gradle
  • Loading branch information
kcooney committed Jan 28, 2024
1 parent cfc8683 commit 1e21ded
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 15 deletions.
2 changes: 0 additions & 2 deletions Robot2024/lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ dependencies {
nativeRelease wpi.java.vendor.jniRelease(wpi.platforms.desktop)
simulationRelease wpi.sim.enableRelease()

implementation 'edu.wpi.first.wpilibNewCommands:wpilibNewCommands-java:2023.4.3'

testImplementation 'junit:junit:4.13'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,25 +129,17 @@ public interface Position {
}

/**
* Sets the desired setpoint to the current setpoint, and enables the pid
* controll
* Sets the desired setpoint to the current setpoint, and enables the PID.
* control.
*
* <p>Prefer calling this over calling {@link #setSetpoint(double)}.
*
* @param setpoint the position to go to
*/
public void setSetpoint(double setpoint) {
public void setSetpoint(T setpoint) {
if (!isEnabled()) {
enable();
}
super.setSetpoint(setpoint);
}

/**
* Sets the desired setpoint to the current setpoint, and enables the pid
* controll
*
* @param setpoint the position to go to
*/
public void setSetpoint(T setpoint) {
setSetpoint(setpoint.getPos());
}

Expand Down
38 changes: 38 additions & 0 deletions Robot2024/lib/vendordeps/WPILibNewCommands.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"fileName": "WPILibNewCommands.json",
"name": "WPILib-New-Commands",
"version": "1.0.0",
"uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266",
"frcYear": "2024",
"mavenUrls": [],
"jsonUrl": "",
"javaDependencies": [
{
"groupId": "edu.wpi.first.wpilibNewCommands",
"artifactId": "wpilibNewCommands-java",
"version": "wpilib"
}
],
"jniDependencies": [],
"cppDependencies": [
{
"groupId": "edu.wpi.first.wpilibNewCommands",
"artifactId": "wpilibNewCommands-cpp",
"version": "wpilib",
"libName": "wpilibNewCommands",
"headerClassifier": "headers",
"sourcesClassifier": "sources",
"sharedLibrary": true,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"linuxathena",
"linuxarm32",
"linuxarm64",
"windowsx86-64",
"windowsx86",
"linuxx86-64",
"osxuniversal"
]
}
]
}

0 comments on commit 1e21ded

Please sign in to comment.