Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected MotorSubsystem(MotorSubsystemConfiguration builder) {
*
* @param position the position to go to.
*/
public void setSetpoint(T position) {
public final void setSetpoint(T position) {
if (!isEnabled()) {
enable();
}
Expand All @@ -126,7 +126,7 @@ public final Command setSetpointCommand(T setpoint) {
}

/** Returns the current setpoint as an angle. */
public Angle getSetpoint() {
public final Angle getSetpoint() {
return rotationUnit.of(controller.getSetpoint());
}

Expand All @@ -141,13 +141,13 @@ public final boolean atPosition() {
* <p>Additionally, this method disables PID control of the subsystem
*/
@Override
public void set(ControlMode mode, double demand, double feedForward) {
public final void set(ControlMode mode, double demand, double feedForward) {
isEnabled = false;
motor.set(mode, demand, feedForward);
}

@Override
public Current getAppliedCurrent() {
public final Current getAppliedCurrent() {
return motor.getAppliedCurrent();
}

Expand All @@ -160,7 +160,7 @@ public Current getAppliedCurrent() {
* <p>If this method is called after the motor drive toward setpoint was interrupted by user
* interruption, the motor will resume its movement towards the last set setpoint.
*/
public void enable() {
public final void enable() {
isEnabled = true;
}

Expand All @@ -171,7 +171,7 @@ public void enable() {
* current setpoint.
*/
@Override
public void stopMotor() {
public final void stopMotor() {
isEnabled = false;
motor.stopMotor();
}
Expand All @@ -185,7 +185,7 @@ public void stopMotor() {
*
* @return Whether the PID controller is engaged.
*/
public boolean isEnabled() {
public final boolean isEnabled() {
return isEnabled;
}

Expand All @@ -196,7 +196,7 @@ public boolean isEnabled() {
* the provided value.
*/
@Override
public void set(ControlMode mode, double demand) {
public final void set(ControlMode mode, double demand) {
isEnabled = false;
motor.set(mode, demand);
}
Expand Down Expand Up @@ -248,17 +248,17 @@ protected final double getMeasurement() {
}

@Override
public Angle getPositionMeasure() {
public final Angle getPositionMeasure() {
return encoder.getPositionMeasure();
}

@Override
public void setPosition(Angle position) {
public final void setPosition(Angle position) {
encoder.setPosition(position);
}

@Override
public AngularVelocity getVelocityMeasure() {
public final AngularVelocity getVelocityMeasure() {
return encoder.getVelocityMeasure();
}

Expand Down
Loading