mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
Addressing issue #7 by reading CANCoder values until successful with 10ms delay between readings. Fall back to reading relative encoder.
This commit is contained in:
@@ -46,12 +46,19 @@ public class PhysicalPropertiesJson
|
||||
*/
|
||||
public SwerveModulePhysicalCharacteristics createPhysicalProperties(double optimalVoltage)
|
||||
{
|
||||
return new SwerveModulePhysicalCharacteristics(gearRatio.drive, gearRatio.angle, angleMotorFreeSpeedRPM,
|
||||
Units.inchesToMeters(wheelDiameter), wheelGripCoefficientOfFriction,
|
||||
optimalVoltage,
|
||||
currentLimit.drive, currentLimit.angle, rampRate.drive,
|
||||
rampRate.angle, encoderPulsePerRotation.drive,
|
||||
encoderPulsePerRotation.angle);
|
||||
return new SwerveModulePhysicalCharacteristics(
|
||||
gearRatio.drive,
|
||||
gearRatio.angle,
|
||||
angleMotorFreeSpeedRPM,
|
||||
Units.inchesToMeters(wheelDiameter),
|
||||
wheelGripCoefficientOfFriction,
|
||||
optimalVoltage,
|
||||
currentLimit.drive,
|
||||
currentLimit.angle,
|
||||
rampRate.drive,
|
||||
rampRate.angle,
|
||||
encoderPulsePerRotation.drive,
|
||||
encoderPulsePerRotation.angle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +95,6 @@ class MotorConfigDouble
|
||||
this.angle = angle;
|
||||
this.drive = drive;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,4 +130,4 @@ class MotorConfigInt
|
||||
this.angle = angle;
|
||||
this.drive = drive;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user