Class SwerveDriveConfigurationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
yams.core.exceptions.SwerveDriveConfigurationException
- All Implemented Interfaces:
Serializable
Thrown by
SwerveDrive or
SwerveDriveConfig when a required field is missing or a config
invariant is violated.
Common triggers include:
- Module configurations (drive and steer motors) not provided for one or more swerve modules
- Gyro sensor not configured required for field-relative driving and odometry
- Kinematic parameters missing (e.g., track width or wheelbase not set)
- A
SwerveDriveConfigmethod called in an incompatible sequence or called twice
Resolution: Ensure SwerveDriveConfig is fully populated with all swerve module
configs, a gyro source, and the required kinematic geometry before constructing
SwerveDrive. Consult the SwerveDriveConfig builder methods
for the specific setter that the error message recommends.
Example minimal configuration:
SwerveDriveConfig config = new SwerveDriveConfig()
.withModules(frontLeft, frontRight, backLeft, backRight)
.withGyro(gyro)
.withTrackWidth(Inches.of(22))
.withWheelBase(Inches.of(22));
SwerveDrive drive = new SwerveDrive(config);
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSwerveDriveConfigurationException(String message, String result, String remedyFunction) SwerveDrive configuration exception. -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
SwerveDriveConfigurationException
-