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