Package yams.core.exceptions
This package contains the checked and unchecked exceptions thrown by YAMS when mechanisms or motor controllers are misconfigured. All exceptions include a human-readable message that identifies the missing or invalid field and, where possible, suggests the corrective action. They are typically thrown during mechanism construction before any control loop begins so configuration errors surface immediately at robot startup rather than silently producing unexpected behavior at match time.
Per-Mechanism Configuration Exceptions
Each mechanism type has a dedicated exception thrown when its required configuration fields are absent or logically inconsistent:
ArmConfigurationExceptionsingle-jointed arm config errorsElevatorConfigurationExceptionelevator config errorsFlyWheelConfigurationExceptionflywheel config errorsPivotConfigurationExceptionpivot config errorsSwerveDriveConfigurationExceptionswerve drive config errorsDifferentialMechanismConfigurationExceptiondifferential drive config errorsDoubleJointedArmConfigurationExceptiondouble-jointed arm config errors
Motor Controller Exceptions
Thrown when a motor controller is missing or its configuration is invalid:
SmartMotorControllerConfigurationExceptionthe motor controller wrapper itself has an invalid or incomplete configuration-
MotorNotPresentExceptiona required motor controller could not be found on the CAN bus or is otherwise unavailable
Gear Stage Exceptions
Thrown by GearBox when its list of stages is malformed:
NoStagesGivenExceptionaGearBoxwas constructed with an empty stage listInvalidStageGivenExceptionone or more stages in aGearBoxhave an illegal value (e.g., zero or negative tooth counts)
-
Exception ClassesClassDescriptionThrown by
DifferentialMechanismorDifferentialMechanismConfigwhen a required field is missing or an attempt is made to violate a config invariant.Thrown byDoubleJointedArmwhen a required field in the lower-joint or upper-jointArmConfigis missing or invalid.Thrown byElevatorwhen a requiredElevatorConfigfield is missing or invalid.Thrown by aSmartMechanismsubclass when the primarySmartMotorControllerhas not been set before the mechanism attempts to use it.Thrown bySmartMotorControllerConfigor aSmartMotorControllerwrapper when the applied configuration contains conflicting, incomplete, or incompatible settings.Thrown bySwerveDriveorSwerveDriveConfigwhen a required field is missing or a config invariant is violated.