Class ArmConfigurationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
yams.core.exceptions.ArmConfigurationException
- All Implemented Interfaces:
Serializable
Thrown by
Arm when a required
ArmConfig field is missing or invalid.
Common triggers include:
- No motor controller provided (motor is absent from the config)
- Arm length not set (needed for simulation)
- Hard limits (
withHardLimits(Angle, Angle)) missing or inconsistent - Starting angle not configured when no zero-offset is present on the motor
- MOI (moment of inertia) not derivable from length/mass and not explicitly set
withSmartMotorController()called twice on the same config object
Resolution: Ensure ArmConfig.withSmartMotorController(SmartMotorController) is
called exactly once, that ArmConfig.withHardLimits(Angle, Angle) provides valid lower and
upper bounds, that ArmConfig.withLength(Distance) is set for simulation, and that a
starting angle is supplied via SmartMotorControllerConfig.withStartingPosition(Angle) or
an encoder zero-offset.
Example minimal configuration:
ArmConfig config = new ArmConfig()
.withSmartMotorController(SmartMotorController.create(SPARK_MAX, DCMotor.getNEO(1)))
.withHardLimits(Degrees.of(-90), Degrees.of(90))
.withLength(Inches.of(18));
Arm arm = new Arm(config);
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionArmConfigurationException(String message, String result, String remedyFunction) Arm configuration exception. -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ArmConfigurationException
-