Class CTREModuleState


  • public class CTREModuleState
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      CTREModuleState()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      • Methods inherited from class java.lang.Object

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

      • CTREModuleState

        public CTREModuleState()
    • Method Detail

      • 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 onboard control.
        Parameters:
        desiredState - The desired state.
        currentAngle - The current module angle.