Class DifferentialMechanismConfigurationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
yams.core.exceptions.DifferentialMechanismConfigurationException
- All Implemented Interfaces:
Serializable
Thrown by
DifferentialMechanism or
DifferentialMechanismConfig when a required field is missing or an
attempt is made to violate a config invariant.
Common triggers include:
withSmartMotorControllers(SmartMotorController, SmartMotorController)called more than once the left or right motor controller has already been set- The left and right motor controllers do not share the same WPILib
Subsysteminstance - Starting tilt or twist angle not configured (
withTiltStartingPosition(Angle)/withTwistStartingPosition(Angle)) - Mechanism length not set (
withLength(Distance)) required to compute the current end-effector position - Twist MOI not set (
withMOI()) required for simulation
Resolution: Call
DifferentialMechanismConfig.withSmartMotorControllers(left, right) exactly once, ensure both motors reference the same subsystem via
SmartMotorControllerConfig.withSubsystem(Subsystem), and provide all required geometry and
simulation parameters.
Example minimal configuration:
DifferentialMechanismConfig config = new DifferentialMechanismConfig()
.withSmartMotorControllers(leftMotor, rightMotor)
.withLength(Inches.of(20))
.withTiltStartingPosition(Degrees.of(0))
.withTwistStartingPosition(Degrees.of(0));
DifferentialMechanism mech = new DifferentialMechanism(config);
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDifferentialMechanismConfigurationException(String message, String result, String remedyFunction) Differential Mechanism configuration exception. -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
DifferentialMechanismConfigurationException
-