Update YAGSL to handle controls better

This commit is contained in:
thenetworkgrinch
2023-04-08 12:31:07 -05:00
parent d37a38bb7b
commit 5b38929c48
123 changed files with 871 additions and 805 deletions

View File

@@ -2,6 +2,7 @@ package swervelib.parser.json;
import edu.wpi.first.math.util.Units;
import swervelib.parser.SwerveModulePhysicalCharacteristics;
import swervelib.telemetry.SwerveDriveTelemetry;
/**
* {@link swervelib.parser.SwerveModulePhysicalCharacteristics} parsed data. Used to configure the SwerveModule.
@@ -33,16 +34,16 @@ public class PhysicalPropertiesJson
* The grip tape coefficient of friction on carpet. Used to calculate the practical maximum acceleration.
*/
public double wheelGripCoefficientOfFriction = 1.19;
/**
* Angle motor free speed rotations per minute.
*/
public double angleMotorFreeSpeedRPM;
/**
* Angle motor kV used for second order kinematics to tune the feedforward, this variable should be adjusted so that
* your drive train does not drift towards the direction you are rotating while you translate. When set to 0 the
* calculated kV will be used.
* your drive train does not drift towards the direction you are rotating while you translate. Default value is 0. If
* robot arcs while translating and rotating negate this.
*/
public double angleMotorsKV = 0;
public double moduleFeedForwardClosedLoop = SwerveDriveTelemetry.isSimulation ? -0.33 : 0;
/**
* DEPRECATED: No longer needed, tune {@link PhysicalPropertiesJson#moduleFeedForwardClosedLoop} instead.
*/
public double angleMotorFreeSpeedRPM = 0;
/**
* Create the physical characteristics based off the parsed data.
@@ -55,7 +56,6 @@ public class PhysicalPropertiesJson
return new SwerveModulePhysicalCharacteristics(
gearRatio.drive,
gearRatio.angle,
angleMotorFreeSpeedRPM,
Units.inchesToMeters(wheelDiameter),
wheelGripCoefficientOfFriction,
optimalVoltage,
@@ -65,7 +65,7 @@ public class PhysicalPropertiesJson
rampRate.angle,
encoderPulsePerRotation.drive,
encoderPulsePerRotation.angle,
angleMotorsKV);
moduleFeedForwardClosedLoop);
}
}