Class SmartMotorControllerConfigurationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
yams.core.exceptions.SmartMotorControllerConfigurationException
- All Implemented Interfaces:
Serializable
Thrown by
SmartMotorControllerConfig or a
SmartMotorController wrapper when the applied configuration contains
conflicting, incomplete, or incompatible settings.
Common triggers include:
withSubsystem(Subsystem)called more than once on the same config- Auto-synchronization threshold set while a distance-based (linear) mechanism circumference is configured the two options are mutually exclusive
- Mechanism circumference undefined when a conversion method (e.g.,
withZeroOffset(),withSoftLimits(), or linear unit conversions) requires it fix withwithMechanismCircumference(Distance) - External encoder discontinuity point outside the
allowed values (must be
Rotations.of(0.5)orRotations.of(1)) - Continuous wrapping requested while soft limits are also set, or while a distance-based (linear) mechanism circumference is configured
- Continuous wrapping or closed-loop tolerance requested without a
PID controller (
withClosedLoopController()) - Distance-based tolerance setter called on
an angular controller (missing
withLinearClosedLoopController(true)) - MOI parameters
(
withMOI(Distance, Mass)) called withnulllength or mass - NEO 550 motor used without a stator current limit, or with a limit exceeding 40 A
- Vendor-specific control request type incompatible with the underlying motor controller (e.g., a TalonFXS control request not supported by the configured motor type)
- Required basic or external-encoder options not
all provided before calling
get() - Live tuning requested while the control mode is
OPEN_LOOPrequireswithControlMode(ControlMode.CLOSED_LOOP)
Resolution: Read the exception message; it always names the specific
SmartMotorControllerConfig method to call (or to remove) to resolve the conflict.
Example triggering continuous-wrapping conflict:
// WRONG soft limits and continuous wrapping cannot coexist
SmartMotorControllerConfig config = new SmartMotorControllerConfig()
.withSoftLimits(Degrees.of(-90), Degrees.of(90))
.withContinuousWrapping(Rotations.of(0), Rotations.of(1)); // throws
// CORRECT remove withSoftLimits() when using continuous wrapping
SmartMotorControllerConfig config = new SmartMotorControllerConfig()
.withContinuousWrapping(Rotations.of(0), Rotations.of(1));
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSmartMotorControllerConfigurationException(String message, String result, String remedyFunction) SmartMotorControllerConfigurationException constructor. -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
SmartMotorControllerConfigurationException
-