Skip to content

Commit 120916e

Browse files
committed
Move the set() methods next to each other
1 parent 3c0021a commit 120916e

1 file changed

Lines changed: 15 additions & 16 deletions

File tree

lib/src/main/java/com/team2813/lib2813/subsystems/MotorSubsystem.java

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,24 @@ public final boolean atPosition() {
8080
/**
8181
* {@inheritDoc}
8282
*
83-
* <p>Additionally, this method disables PID control of the subsystem
83+
* <p>Additionally, this method disables PID control of the subsystem. It <em>does not</em> clamp
84+
* the provided value.
85+
*/
86+
@Override
87+
public final void set(ControlMode mode, double demand) {
88+
isEnabled = false;
89+
motor.set(mode, demand);
90+
}
91+
92+
/**
93+
* {@inheritDoc}
94+
*
95+
* <p>Additionally, this method disables PID control of the subsystem. It <em>does not</em> clamp
96+
* the provided value.
8497
*/
8598
@Override
8699
public final void set(ControlMode mode, double demand, double feedForward) {
87-
if (isEnabled()) {
88-
disable();
89-
}
100+
isEnabled = false;
90101
motor.set(mode, demand, feedForward);
91102
}
92103

@@ -125,18 +136,6 @@ public final boolean isEnabled() {
125136
return isEnabled;
126137
}
127138

128-
/**
129-
* {@inheritDoc}
130-
*
131-
* <p>Additionally, this method disables PID control of the subsystem. It <em>does not</em> clamp
132-
* the provided value.
133-
*/
134-
@Override
135-
public final void set(ControlMode mode, double demand) {
136-
isEnabled = false;
137-
motor.set(mode, demand);
138-
}
139-
140139
/**
141140
* Clamps the given output value and provides it to the motor.
142141
*

0 commit comments

Comments
 (0)