Class ModuleType

java.lang.Object
com.marswars.swerve_lib.module.ModuleType

public class ModuleType extends Object
Known swerve module gear ratio presets with metadata used for configuration.
  • Field Details

    • name

      public final String name
    • steerRatio

      public final double steerRatio
    • driveRatio

      public final double driveRatio
    • steerInverted

      public final boolean steerInverted
    • ALL_MODULE_TYPES

      public static Hashtable<String,ModuleType> ALL_MODULE_TYPES
  • Method Details

    • getModuleTypeFromJSON

      public static ModuleType getModuleTypeFromJSON(String position)
      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

      public static ModuleType getModuleType(String type)
      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