Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
dejabot committed Feb 23, 2024
1 parent 24df9f7 commit 7f3126a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/team766/hal/LocalMotorController.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ public double getSensorVelocity() {
}

@Override
public void set(final ControlMode mode, final double value, int slot, double arbitraryFeedForward) {
public void set(
final ControlMode mode, final double value, int slot, double arbitraryFeedForward) {
if (slot != 0) {
throw new UnsupportedOperationException(
"Selecting PID slots not supported on LocalMotorController");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public double getSensorVelocity() {
}

@Override
public void set(final ControlMode mode, final double value, int slot, double arbitraryFeedForward) {
public void set(
final ControlMode mode, final double value, int slot, double arbitraryFeedForward) {
switch (mode) {
case PercentOutput:
delegate.set(mode, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public double getSensorVelocity() {
}

@Override
public void set(final ControlMode mode, final double value, int slot, double arbitraryFeedForward) {
public void set(
final ControlMode mode, final double value, int slot, double arbitraryFeedForward) {
// get the latest PID values for this slot
pidSlotHelper.refreshPIDForSlot(this, slot);
switch (mode) {
Expand All @@ -75,19 +76,35 @@ public void set(final ControlMode mode, final double value, int slot, double arb
break;
case PercentOutput:
getPIDController()
.setReference(value, CANSparkMax.ControlType.kDutyCycle, slot, arbitraryFeedForward);
.setReference(
value,
CANSparkMax.ControlType.kDutyCycle,
slot,
arbitraryFeedForward);
break;
case Position:
getPIDController()
.setReference(value, CANSparkMax.ControlType.kPosition, slot, arbitraryFeedForward);
.setReference(
value,
CANSparkMax.ControlType.kPosition,
slot,
arbitraryFeedForward);
break;
case Velocity:
getPIDController()
.setReference(value, CANSparkMax.ControlType.kVelocity, slot, arbitraryFeedForward);
.setReference(
value,
CANSparkMax.ControlType.kVelocity,
slot,
arbitraryFeedForward);
break;
case Voltage:
getPIDController()
.setReference(value, CANSparkMax.ControlType.kVoltage, slot, arbitraryFeedForward);
.setReference(
value,
CANSparkMax.ControlType.kVoltage,
slot,
arbitraryFeedForward);
default:
throw new IllegalArgumentException("Unsupported control mode " + mode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ private void refreshConfig() {
}

@Override
public void set(final ControlMode mode, double value, int pidSlot, double arbitraryFeedForward) {
public void set(
final ControlMode mode, double value, int pidSlot, double arbitraryFeedForward) {
switch (mode) {
case Disabled:
super.disable();
Expand Down

0 comments on commit 7f3126a

Please sign in to comment.