Class FlyWheelConfigurationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
yams.core.exceptions.FlyWheelConfigurationException
- All Implemented Interfaces:
Serializable
Thrown by
FlyWheel or
FlyWheelConfig when a required field in
FlyWheelConfig is missing or invalid.
Common triggers include:
withSmartMotorController(SmartMotorController)called more than once on the same config- Speedometer max velocity not set when speedometer simulation is requested (
withSpeedometerSimulation(AngularVelocity)) - Flywheel diameter not set when surface speed
calculations are needed (
withDiameter(Distance)) - MOI (moment of inertia) not derivable neither diameter+mass nor an explicit MOI was provided
Resolution: Ensure
FlyWheelConfig.withSmartMotorController(SmartMotorController) is called exactly once,
FlyWheelConfig.withDiameter(Distance) and FlyWheelConfig.withMass(Mass) are set (or
provide an explicit MOI via FlyWheelConfig.withMOI()), and when using speedometer
simulation FlyWheelConfig.withSpeedometerSimulation(AngularVelocity) is called with a
nonzero max velocity.
Example minimal configuration:
FlyWheelConfig config = new FlyWheelConfig()
.withSmartMotorController(SmartMotorController.create(SPARK_MAX, DCMotor.getNEO(1)))
.withDiameter(Inches.of(4))
.withMass(Pounds.of(0.5));
FlyWheel flyWheel = new FlyWheel(config);
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFlyWheelConfigurationException(String message, String result, String remedyFunction) FlyWheel configuration exception. -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
FlyWheelConfigurationException
-