Class CTREModuleState
java.lang.Object
frc.team_8840_lib.utils.controllers.swerve.CTREModuleState
Credit to https://github.com/frc3512/SwerveBot-2022/blob/main/src/main/java/frc/lib/math/OnboardModuleState.java
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic edu.wpi.first.math.kinematics.SwerveModuleStateoptimize(edu.wpi.first.math.kinematics.SwerveModuleState desiredState, edu.wpi.first.math.geometry.Rotation2d currentAngle) Minimize the change in heading the desired swerve module state would require by potentially reversing the direction the wheel spins.
-
Constructor Details
-
CTREModuleState
public CTREModuleState()
-
-
Method Details
-
optimize
public static edu.wpi.first.math.kinematics.SwerveModuleState optimize(edu.wpi.first.math.kinematics.SwerveModuleState desiredState, edu.wpi.first.math.geometry.Rotation2d currentAngle) Minimize the change in heading the desired swerve module state would require by potentially reversing the direction the wheel spins. Customized from WPILib's version to include placing in appropriate scope for CTRE and REV onboard control as both controllers as of writing don't have support for continuous input.- Parameters:
desiredState- The desired state.currentAngle- The current module angle.
-