Class SwerveOptimization
java.lang.Object
frc.team_8840_lib.utils.controllers.swerve.SwerveOptimization
A class that contains methods to optimize the swerve module states.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic edu.wpi.first.math.kinematics.SwerveModuleStateoptimize(edu.wpi.first.math.kinematics.SwerveModuleState state, edu.wpi.first.math.geometry.Rotation2d currentRotation, double lastSetSpeed) Optimizes the swerve module state to minimize the angle change between the current angle and the target angle.
-
Constructor Details
-
SwerveOptimization
public SwerveOptimization()
-
-
Method Details
-
optimize
public static edu.wpi.first.math.kinematics.SwerveModuleState optimize(edu.wpi.first.math.kinematics.SwerveModuleState state, edu.wpi.first.math.geometry.Rotation2d currentRotation, double lastSetSpeed) Optimizes the swerve module state to minimize the angle change between the current angle and the target angle.- Parameters:
state- The target statecurrentRotation- The current rotation of the module- Returns:
- The optimized state
-