Class ArmConfigurationException

All Implemented Interfaces:
Serializable

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

    • ArmConfigurationException

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