Package com.marswars.swerve_lib
Class SwerveDriveConfig
java.lang.Object
com.marswars.swerve_lib.SwerveDriveConfig
Immutable configuration container for a full swerve drivetrain.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal SwerveModuleConfigfinal SwerveModuleConfigstatic final doubleDefault skid-detection threshold (max allowed spread of per-module velocities) used when a configuration does not specify one.final SwerveModuleConfigfinal SwerveModuleConfigfinal Stringfinal intfinal doubleSkid-detection threshold (max allowed spread of per-module velocities). -
Constructor Summary
ConstructorsConstructorDescriptionSwerveDriveConfig(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.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. -
Method Summary
-
Field Details
-
FL_MODULE_CONSTANTS
-
FR_MODULE_CONSTANTS
-
BL_MODULE_CONSTANTS
-
BR_MODULE_CONSTANTS
-
PIGEON2_ID
public final int PIGEON2_ID -
PIGEON2_CANBUS_NAME
-
DEFAULT_SKID_DETECTION_RANGE
public static final double DEFAULT_SKID_DETECTION_RANGEDefault 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_RANGESkid-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 configurationfr_module_constants- Front-right module configurationbl_module_constants- Back-left module configurationbr_module_constants- Back-right module configurationpigeon2_id- Pigeon2 CAN device IDpigeon2_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 configurationfr_module_constants- Front-right module configurationbl_module_constants- Back-left module configurationbr_module_constants- Back-right module configurationpigeon2_id- Pigeon2 CAN device IDpigeon2_canbus_name- Pigeon2 CAN bus nameskid_detection_range- Skid-detection threshold (max allowed spread of per-module velocities)
-