@@ -108,7 +108,7 @@ protected MotorSubsystem(MotorSubsystemConfiguration builder) {
108108 *
109109 * @param position the position to go to.
110110 */
111- public void setSetpoint (T position ) {
111+ public final void setSetpoint (T position ) {
112112 if (!isEnabled ()) {
113113 enable ();
114114 }
@@ -126,7 +126,7 @@ public final Command setSetpointCommand(T setpoint) {
126126 }
127127
128128 /** Returns the current setpoint as an angle. */
129- public Angle getSetpoint () {
129+ public final Angle getSetpoint () {
130130 return rotationUnit .of (controller .getSetpoint ());
131131 }
132132
@@ -141,13 +141,13 @@ public final boolean atPosition() {
141141 * <p>Additionally, this method disables PID control of the subsystem
142142 */
143143 @ Override
144- public void set (ControlMode mode , double demand , double feedForward ) {
144+ public final void set (ControlMode mode , double demand , double feedForward ) {
145145 isEnabled = false ;
146146 motor .set (mode , demand , feedForward );
147147 }
148148
149149 @ Override
150- public Current getAppliedCurrent () {
150+ public final Current getAppliedCurrent () {
151151 return motor .getAppliedCurrent ();
152152 }
153153
@@ -160,7 +160,7 @@ public Current getAppliedCurrent() {
160160 * <p>If this method is called after the motor drive toward setpoint was interrupted by user
161161 * interruption, the motor will resume its movement towards the last set setpoint.
162162 */
163- public void enable () {
163+ public final void enable () {
164164 isEnabled = true ;
165165 }
166166
@@ -171,7 +171,7 @@ public void enable() {
171171 * current setpoint.
172172 */
173173 @ Override
174- public void stopMotor () {
174+ public final void stopMotor () {
175175 isEnabled = false ;
176176 motor .stopMotor ();
177177 }
@@ -185,7 +185,7 @@ public void stopMotor() {
185185 *
186186 * @return Whether the PID controller is engaged.
187187 */
188- public boolean isEnabled () {
188+ public final boolean isEnabled () {
189189 return isEnabled ;
190190 }
191191
@@ -196,7 +196,7 @@ public boolean isEnabled() {
196196 * the provided value.
197197 */
198198 @ Override
199- public void set (ControlMode mode , double demand ) {
199+ public final void set (ControlMode mode , double demand ) {
200200 isEnabled = false ;
201201 motor .set (mode , demand );
202202 }
@@ -248,17 +248,17 @@ protected final double getMeasurement() {
248248 }
249249
250250 @ Override
251- public Angle getPositionMeasure () {
251+ public final Angle getPositionMeasure () {
252252 return encoder .getPositionMeasure ();
253253 }
254254
255255 @ Override
256- public void setPosition (Angle position ) {
256+ public final void setPosition (Angle position ) {
257257 encoder .setPosition (position );
258258 }
259259
260260 @ Override
261- public AngularVelocity getVelocityMeasure () {
261+ public final AngularVelocity getVelocityMeasure () {
262262 return encoder .getVelocityMeasure ();
263263 }
264264
0 commit comments