Updated YAGSL SparkMAX handling

This commit is contained in:
thenetworkgrinch
2023-03-21 22:18:24 -05:00
parent 670154f061
commit e8e2edaf5a
110 changed files with 235 additions and 221 deletions

View File

@@ -295,11 +295,19 @@ public class SparkMaxSwerve extends SwerveMotor
{
int pidSlot =
isDriveMotor ? SparkMAX_slotIdx.Velocity.ordinal() : SparkMAX_slotIdx.Position.ordinal();
pid.setReference(
setpoint,
isDriveMotor ? ControlType.kVelocity : ControlType.kPosition,
pidSlot,
feedforward);
if (isDriveMotor)
{
pid.setReference(
setpoint,
ControlType.kVelocity,
pidSlot,
feedforward);
} else
{
pid.setReference(
setpoint,
ControlType.kPosition);
}
}
/**