mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Updated YAGSL SparkMAX handling
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user