Class SwerveModuleState

    • Field Detail

      • speedMetersPerSecond

        public double speedMetersPerSecond
        Speed of the wheel of the module.
      • angle

        public Rotation2d angle
        Angle of the module.
    • Constructor Detail

      • SwerveModuleState

        public SwerveModuleState()
        Constructs a SwerveModuleState with zeros for speed and angle.
      • SwerveModuleState

        public SwerveModuleState​(double speedMetersPerSecond,
                                 Rotation2d angle)
        Constructs a SwerveModuleState.
        speedMetersPerSecond - The speed of the wheel of the module.
        angle - The angle of the module.
    • Method Detail

      • compareTo

        public int compareTo​(SwerveModuleState o)
        Compares two swerve module states. One swerve module is "greater" than the other if its speed is higher than the other.
        Specified by:
        compareTo in interface Comparable<SwerveModuleState>
        o - The other swerve module.
        1 if this is greater, 0 if both are equal, -1 if other is greater.