Class PhysicalPropertiesJson

java.lang.Object
swervelib.parser.json.PhysicalPropertiesJson

public class PhysicalPropertiesJson extends Object
SwerveModulePhysicalCharacteristics parsed data. Used to configure the SwerveModule.
  • Field Details

    • wheelDiameter

      public double wheelDiameter
      Wheel diameter in inches.
    • gearRatio

      public MotorConfigDouble gearRatio
      Gear ratio for the motors, number of times the motor has to spin before the wheel rotates a single time.
    • encoderPulsePerRotation

      public MotorConfigInt encoderPulsePerRotation
      Encoder pulse per rotation for non-integrated encoders. 1 for integrated encoders.
    • currentLimit

      public MotorConfigInt currentLimit
      The current limit in AMPs to apply to the motors.
    • rampRate

      public MotorConfigDouble rampRate
      The minimum number of seconds to take for the motor to go from 0 to full throttle.
    • wheelGripCoefficientOfFriction

      public double wheelGripCoefficientOfFriction
      The grip tape coefficient of friction on carpet. Used to calculate the practical maximum acceleration.
    • moduleFeedForwardClosedLoop

      public double moduleFeedForwardClosedLoop
      Angle motor kV used for second order kinematics to tune the feedforward, this variable should be adjusted so that your drive train does not drift towards the direction you are rotating while you translate. Default value is 0. If robot arcs while translating and rotating negate this.
    • angleMotorFreeSpeedRPM

      public double angleMotorFreeSpeedRPM
      DEPRECATED: No longer needed, tune moduleFeedForwardClosedLoop instead.
  • Constructor Details

    • PhysicalPropertiesJson

      public PhysicalPropertiesJson()
  • Method Details

    • createPhysicalProperties

      public SwerveModulePhysicalCharacteristics createPhysicalProperties(double optimalVoltage)
      Create the physical characteristics based off the parsed data.
      Parameters:
      optimalVoltage - Optimal voltage to compensate for and use to calculate drive motor feedforward.
      Returns:
      SwerveModulePhysicalCharacteristics based on parsed data.