mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-07-01 07:21:39 +00:00
Updated swerve module optimizations and moved math to SwerveMath.
This commit is contained in:
@@ -199,6 +199,7 @@ public class SparkMaxSwerve extends SwerveMotor
|
||||
{
|
||||
int pidSlot =
|
||||
isDriveMotor ? SparkMAX_slotIdx.Velocity.ordinal() : SparkMAX_slotIdx.Position.ordinal();
|
||||
pidSlot = 0;
|
||||
pid.setP(config.p, pidSlot);
|
||||
pid.setI(config.i, pidSlot);
|
||||
pid.setD(config.d, pidSlot);
|
||||
@@ -293,8 +294,11 @@ public class SparkMaxSwerve extends SwerveMotor
|
||||
@Override
|
||||
public void setReference(double setpoint, double feedforward)
|
||||
{
|
||||
boolean possibleBurnOutIssue = true;
|
||||
int pidSlot =
|
||||
isDriveMotor ? SparkMAX_slotIdx.Velocity.ordinal() : SparkMAX_slotIdx.Position.ordinal();
|
||||
pidSlot = 0;
|
||||
|
||||
if (isDriveMotor)
|
||||
{
|
||||
pid.setReference(
|
||||
@@ -306,7 +310,8 @@ public class SparkMaxSwerve extends SwerveMotor
|
||||
{
|
||||
pid.setReference(
|
||||
setpoint,
|
||||
ControlType.kPosition);
|
||||
ControlType.kPosition,
|
||||
pidSlot);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user