Package com.marswars.swerve_lib.module
Class ModuleType
java.lang.Object
com.marswars.swerve_lib.module.ModuleType
Known swerve module gear ratio presets with metadata used for configuration.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Hashtable<String,ModuleType> final doublefinal Stringfinal booleanfinal double -
Method Summary
Modifier and TypeMethodDescriptionstatic ModuleTypegetModuleType(String type) Gets a module type by name, falling back to MK4I-L3 if missing.static ModuleTypegetModuleTypeFromJSON(String position) Loads module type information from JSON constants for a given module position.
-
Field Details
-
name
-
steerRatio
public final double steerRatio -
driveRatio
public final double driveRatio -
steerInverted
public final boolean steerInverted -
ALL_MODULE_TYPES
-
-
Method Details
-
getModuleTypeFromJSON
Loads module type information from JSON constants for a given module position.- Parameters:
position- String representing the module location [fl, fr, bl, br, etc.]- Returns:
- ModuleType to load the gear ratio constants from
-
getModuleType
Gets a module type by name, falling back to MK4I-L3 if missing.- Parameters:
type- Module type name (e.g. MK4I-L2)- Returns:
- Resolved ModuleType
-