Class ElevatorConfigurationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
yams.core.exceptions.ElevatorConfigurationException
- All Implemented Interfaces:
Serializable
Thrown by
Elevator when a required
ElevatorConfig field is missing or invalid.
Common triggers include:
- Carriage mass not set (
withMass(Mass)) required for simulation - Hard limits (
withHardLimits(Distance, Distance)) missing minimum or maximum height - Starting height not configured (
withStartingHeight(Distance)) - No motor controller provided
Resolution: Ensure
ElevatorConfig.withSmartMotorController(SmartMotorController) is called,
ElevatorConfig.withHardLimits(Distance, Distance) defines both the minimum and maximum travel
distances, ElevatorConfig.withMass(Mass) provides the carriage mass, and
ElevatorConfig.withStartingHeight(Distance) sets the initial position.
Example minimal configuration:
ElevatorConfig config = new ElevatorConfig()
.withSmartMotorController(SmartMotorController.create(SPARK_MAX, DCMotor.getNEO(1)))
.withHardLimits(Inches.of(0), Inches.of(48))
.withMass(Pounds.of(10))
.withStartingHeight(Inches.of(0));
Elevator elevator = new Elevator(config);
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionElevatorConfigurationException(String message, String result, String remedyFunction) Elevator configuration exception. -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ElevatorConfigurationException
-