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 40b2d10
Show file tree
Hide file tree
Showing 3 changed files with 5 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
File renamed without changes.

0 comments on commit 40b2d10

Please sign in to comment.