Class SwerveDriveConfig

java.lang.Object
com.marswars.swerve_lib.SwerveDriveConfig

public class SwerveDriveConfig extends Object
Immutable configuration container for a full swerve drivetrain.
  • Field Details

    • FL_MODULE_CONSTANTS

      public final SwerveModuleConfig FL_MODULE_CONSTANTS
    • FR_MODULE_CONSTANTS

      public final SwerveModuleConfig FR_MODULE_CONSTANTS
    • BL_MODULE_CONSTANTS

      public final SwerveModuleConfig BL_MODULE_CONSTANTS
    • BR_MODULE_CONSTANTS

      public final SwerveModuleConfig BR_MODULE_CONSTANTS
    • PIGEON2_ID

      public final int PIGEON2_ID
    • PIGEON2_CANBUS_NAME

      public final String PIGEON2_CANBUS_NAME
    • DEFAULT_SKID_DETECTION_RANGE

      public static final double DEFAULT_SKID_DETECTION_RANGE
      Default skid-detection threshold (max allowed spread of per-module velocities) used when a configuration does not specify one.
      See Also:
    • SKID_DETECTION_RANGE

      public final double SKID_DETECTION_RANGE
      Skid-detection threshold (max allowed spread of per-module velocities).
  • Constructor Details

    • SwerveDriveConfig

      public SwerveDriveConfig(SwerveModuleConfig fl_module_constants, SwerveModuleConfig fr_module_constants, SwerveModuleConfig bl_module_constants, SwerveModuleConfig br_module_constants, int pigeon2_id, String pigeon2_canbus_name)
      Creates a new swerve drive configuration with the default skid-detection threshold.
      Parameters:
      fl_module_constants - Front-left module configuration
      fr_module_constants - Front-right module configuration
      bl_module_constants - Back-left module configuration
      br_module_constants - Back-right module configuration
      pigeon2_id - Pigeon2 CAN device ID
      pigeon2_canbus_name - Pigeon2 CAN bus name
    • SwerveDriveConfig

      public SwerveDriveConfig(SwerveModuleConfig fl_module_constants, SwerveModuleConfig fr_module_constants, SwerveModuleConfig bl_module_constants, SwerveModuleConfig br_module_constants, int pigeon2_id, String pigeon2_canbus_name, double skid_detection_range)
      Creates a new swerve drive configuration.
      Parameters:
      fl_module_constants - Front-left module configuration
      fr_module_constants - Front-right module configuration
      bl_module_constants - Back-left module configuration
      br_module_constants - Back-right module configuration
      pigeon2_id - Pigeon2 CAN device ID
      pigeon2_canbus_name - Pigeon2 CAN bus name
      skid_detection_range - Skid-detection threshold (max allowed spread of per-module velocities)