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:
thenetworkgrinch
2023-02-20 20:59:31 -06:00
parent 8f9ffdf031
commit dd28a657b2
43 changed files with 570 additions and 363 deletions

View File

@@ -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;
}
}
}