Class PivotConfigurationException

All Implemented Interfaces:
Serializable

public class PivotConfigurationException extends RuntimeException
Thrown by Pivot or PivotConfig when a required field in PivotConfig is missing or invalid.

Common triggers include:

  • withSmartMotorController(SmartMotorController) called more than once on the same config
  • MOI (moment of inertia) not derivable neither length+mass nor an explicit MOI was configured on the underlying SmartMotorControllerConfig

Resolution: Ensure PivotConfig.withSmartMotorController(SmartMotorController) is called exactly once, and that the motor's SmartMotorControllerConfig includes withMomentOfInertia(Distance, Mass) or withMomentOfInertia(MomentOfInertia) when simulation is used.

Example minimal configuration:

SmartMotorControllerConfig motorCfg = new SmartMotorControllerConfig()
    .withMomentOfInertia(Inches.of(10), Pounds.of(2));
PivotConfig config = new PivotConfig()
    .withSmartMotorController(SmartMotorController.create(SPARK_MAX, DCMotor.getNEO(1),
motorCfg)); Pivot pivot = new Pivot(config);
See Also:
  • Constructor Details

    • PivotConfigurationException

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