Class SwerveDriveConfigurationException

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

public class SwerveDriveConfigurationException extends RuntimeException
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 SwerveDriveConfig method 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 Details

    • SwerveDriveConfigurationException

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