mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Upgrading to 2025.7.0
This commit is contained in:
@@ -75,6 +75,14 @@ public class ModuleJson
|
||||
SwerveMotor angleMotor = angle.createMotor(false);
|
||||
SwerveAbsoluteEncoder absEncoder = encoder.createEncoder(angleMotor);
|
||||
|
||||
//Throw an error if module locations are improperly set
|
||||
if (location.front == 0 && location.left == 0)
|
||||
{
|
||||
throw new RuntimeException("Improper Module Location Settings!\n" +
|
||||
"Your module location is set to 0 for both 'front' and 'left' values.\n" +
|
||||
"Set the distance from the center of the robot to the center of the wheel in your module JSON file!");
|
||||
}
|
||||
|
||||
// Set the conversion factors to null if they are both 0.
|
||||
if (!conversionFactors.works() && physicalCharacteristics.conversionFactor == null)
|
||||
{
|
||||
@@ -119,8 +127,8 @@ public class ModuleJson
|
||||
conversionFactors,
|
||||
absEncoder,
|
||||
absoluteEncoderOffset,
|
||||
Units.inchesToMeters(Math.round(location.x) == 0 ? location.front : location.x),
|
||||
Units.inchesToMeters(Math.round(location.y) == 0 ? location.left : location.y),
|
||||
Units.inchesToMeters(Math.round(location.front)),
|
||||
Units.inchesToMeters(Math.round(location.left)),
|
||||
anglePIDF,
|
||||
velocityPIDF,
|
||||
physicalCharacteristics,
|
||||
|
||||
Reference in New Issue
Block a user