Class SwerveUtils

java.lang.Object
frc.lib.swerve.SwerveUtils

public class SwerveUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    convertChoreoNewtonsToAmps(edu.wpi.first.math.kinematics.SwerveModuleState currentState, com.pathplanner.lib.util.DriveFeedforwards ff, int i)
     
    static edu.wpi.first.math.kinematics.SwerveModuleState
    copyState(edu.wpi.first.math.kinematics.SwerveModuleState state)
     
    static edu.wpi.first.math.kinematics.ChassisSpeeds
    discretize(edu.wpi.first.math.kinematics.ChassisSpeeds speeds, double driftRate)
     
    static double
     
    static boolean
    isSpeedOptimized(edu.wpi.first.math.kinematics.SwerveModuleState state, edu.wpi.first.math.kinematics.SwerveModuleState optimizedState, int i)
     
    static void
    logDriveFeedforward(com.pathplanner.lib.util.DriveFeedforwards ff, int i)
     
    static void
    logPossibleDriveStates(boolean doLogging, edu.wpi.first.math.kinematics.ChassisSpeeds desiredSpeeds, edu.wpi.first.math.kinematics.SwerveModuleState[] currentStates, SwerveSetpoint previousSetpoint, edu.wpi.first.math.geometry.Rotation2d robotRotation)
     
    static double
    optimizeTorque(edu.wpi.first.math.kinematics.SwerveModuleState unOptimized, edu.wpi.first.math.kinematics.SwerveModuleState optimized, double motorAmperage, int i)
     
    static double
    projectTorque(edu.wpi.first.math.kinematics.SwerveModuleState currentState, edu.wpi.first.math.Vector<edu.wpi.first.math.numbers.N2> wheelForce)
     
    static edu.wpi.first.math.geometry.Rotation2d
    removeAzimuthJitter(edu.wpi.first.math.kinematics.SwerveModuleState setpoint, edu.wpi.first.math.kinematics.SwerveModuleState current)
     
    static edu.wpi.first.math.kinematics.SwerveModuleState[]
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SwerveUtils

      public SwerveUtils()
  • Method Details

    • discretize

      public static edu.wpi.first.math.kinematics.ChassisSpeeds discretize(edu.wpi.first.math.kinematics.ChassisSpeeds speeds, double driftRate)
    • copyState

      public static edu.wpi.first.math.kinematics.SwerveModuleState copyState(edu.wpi.first.math.kinematics.SwerveModuleState state)
    • removeAzimuthJitter

      public static edu.wpi.first.math.geometry.Rotation2d removeAzimuthJitter(edu.wpi.first.math.kinematics.SwerveModuleState setpoint, edu.wpi.first.math.kinematics.SwerveModuleState current)
    • projectTorque

      public static double projectTorque(edu.wpi.first.math.kinematics.SwerveModuleState currentState, edu.wpi.first.math.Vector<edu.wpi.first.math.numbers.N2> wheelForce)
    • optimizeTorque

      public static double optimizeTorque(edu.wpi.first.math.kinematics.SwerveModuleState unOptimized, edu.wpi.first.math.kinematics.SwerveModuleState optimized, double motorAmperage, int i)
    • isSpeedOptimized

      public static boolean isSpeedOptimized(edu.wpi.first.math.kinematics.SwerveModuleState state, edu.wpi.first.math.kinematics.SwerveModuleState optimizedState, int i)
    • convertChoreoNewtonsToAmps

      public static double convertChoreoNewtonsToAmps(edu.wpi.first.math.kinematics.SwerveModuleState currentState, com.pathplanner.lib.util.DriveFeedforwards ff, int i)
    • logDriveFeedforward

      public static void logDriveFeedforward(com.pathplanner.lib.util.DriveFeedforwards ff, int i)
    • logPossibleDriveStates

      public static void logPossibleDriveStates(boolean doLogging, edu.wpi.first.math.kinematics.ChassisSpeeds desiredSpeeds, edu.wpi.first.math.kinematics.SwerveModuleState[] currentStates, SwerveSetpoint previousSetpoint, edu.wpi.first.math.geometry.Rotation2d robotRotation)
    • zeroStates

      public static edu.wpi.first.math.kinematics.SwerveModuleState[] zeroStates()
    • getTorqueOfKrakenDriveMotor

      public static double getTorqueOfKrakenDriveMotor(double amps)