Class SwerveModulePhysicalCharacteristics

java.lang.Object
swervelib.parser.SwerveModulePhysicalCharacteristics

public class SwerveModulePhysicalCharacteristics extends Object
Configuration class which stores physical characteristics shared between every swerve module.
  • Field Details

    • driveMotorCurrentLimit

      public final int driveMotorCurrentLimit
      Current limits for the Swerve Module.
    • angleMotorCurrentLimit

      public final int angleMotorCurrentLimit
      Current limits for the Swerve Module.
    • driveMotorRampRate

      public final double driveMotorRampRate
      The time it takes for the motor to go from 0 to full throttle in seconds.
    • angleMotorRampRate

      public final double angleMotorRampRate
      The time it takes for the motor to go from 0 to full throttle in seconds.
    • wheelGripCoefficientOfFriction

      public final double wheelGripCoefficientOfFriction
      Wheel grip tape coefficient of friction on carpet, as described by the vendor.
    • optimalVoltage

      public double optimalVoltage
      The voltage to use for the smart motor voltage compensation.
    • conversionFactor

      public MotorConfigDouble conversionFactor
  • Constructor Details

    • SwerveModulePhysicalCharacteristics

      public SwerveModulePhysicalCharacteristics(MotorConfigDouble conversionFactors, double wheelGripCoefficientOfFriction, double optimalVoltage, int driveMotorCurrentLimit, int angleMotorCurrentLimit, double driveMotorRampRate, double angleMotorRampRate)
      Construct the swerve module physical characteristics.
      Parameters:
      conversionFactors - The conversion factors for the drive and angle motors, created by SwerveMath.calculateMetersPerRotation(double, double, double) and SwerveMath.calculateDegreesPerSteeringRotation(double, double).
      wheelGripCoefficientOfFriction - Wheel grip coefficient of friction on carpet given by manufacturer.
      optimalVoltage - Optimal robot voltage.
      driveMotorCurrentLimit - Current limit for the drive motor.
      angleMotorCurrentLimit - Current limit for the angle motor.
      driveMotorRampRate - The time in seconds to go from 0 to full throttle on the motor. (Prevents over drawing power from battery)
      angleMotorRampRate - The time in seconds to go from 0 to full throttle on the motor. (Prevents overdrawing power and power loss).
    • SwerveModulePhysicalCharacteristics

      public SwerveModulePhysicalCharacteristics(MotorConfigDouble conversionFactors, double driveMotorRampRate, double angleMotorRampRate)
      Construct the swerve module physical characteristics. Assume coefficient of friction is 1.19 (taken from blue nitrile on carpet from Studica) and optimal voltage is 12v. Assumes the drive motor current limit is 40A, and the angle motor current limit is 20A.
      Parameters:
      conversionFactors - The conversion factors for the drive and angle motors, created by SwerveMath.calculateMetersPerRotation(double, double, double) and SwerveMath.calculateDegreesPerSteeringRotation(double, double).
      driveMotorRampRate - The time in seconds to go from 0 to full throttle on the motor. (Prevents over drawing power from battery)
      angleMotorRampRate - The time in seconds to go from 0 to full throttle on the motor. (Prevents overdrawing power and power loss).