Class ElevatorConfigurationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
yams.core.exceptions.ElevatorConfigurationException
All Implemented Interfaces:
Serializable

public class ElevatorConfigurationException extends RuntimeException
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 Details

    • ElevatorConfigurationException

      public ElevatorConfigurationException(String message, String result, String remedyFunction)
      Elevator configuration exception.
      Parameters:
      message - Message to display.
      result - Result of the configuration.
      remedyFunction - Remedy function to use.