Class DoubleJointedArmConfigurationException

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

public class DoubleJointedArmConfigurationException extends RuntimeException
Thrown by DoubleJointedArm when a required field in the lower-joint or upper-joint ArmConfig is missing or invalid.

Common triggers include:

  • The lower and upper joint motor controllers do not share the same WPILib Subsystem instance both must reference the same subsystem so that a single command can require it
  • Starting angle missing on either joint config both the lower and upper ArmConfig must have a starting position set via SmartMotorControllerConfig.withStartingPosition(Angle)

Resolution: Ensure both joint configs supply motors via ArmConfig.withSmartMotorController(SmartMotorController), that both motors are bound to the same subsystem via SmartMotorControllerConfig.withSubsystem(Subsystem), and that both configs include SmartMotorControllerConfig.withStartingPosition(Angle).

Example minimal configuration:

ArmConfig lowerConfig = new ArmConfig()
    .withSmartMotorController(SmartMotorController.create(SPARK_MAX, DCMotor.getNEO(1),
lowerMotorCfg)); ArmConfig upperConfig = new ArmConfig()
    .withSmartMotorController(SmartMotorController.create(SPARK_MAX, DCMotor.getNEO(1),
upperMotorCfg)); DoubleJointedArm arm = new DoubleJointedArm(lowerConfig, upperConfig);
See Also:
  • Constructor Details

    • DoubleJointedArmConfigurationException

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