Class SwerveDriveConfiguration


  • public class SwerveDriveConfiguration
    extends Object
    Swerve drive configurations used during SwerveDrive construction.
    • Field Detail

      • moduleLocationsMeters

        public edu.wpi.first.math.geometry.Translation2d[] moduleLocationsMeters
        Swerve Module locations.
      • invertedIMU

        public boolean invertedIMU
        Invert the imu measurements.
      • maxSpeed

        public double maxSpeed
        Max speed in meters per second.
      • moduleCount

        public int moduleCount
        Number of modules on the robot.
    • Constructor Detail

      • SwerveDriveConfiguration

        public SwerveDriveConfiguration​(SwerveModuleConfiguration[] moduleConfigs,
                                        SwerveIMU swerveIMU,
                                        double maxSpeed,
                                        boolean invertedIMU)
        Create swerve drive configuration.
        Parameters:
        moduleConfigs - Module configuration.
        swerveIMU - Swerve IMU.
        maxSpeed - Max speed of the robot in meters per second.
        invertedIMU - Invert the IMU.
    • Method Detail

      • createModules

        public SwerveModule[] createModules​(SwerveModuleConfiguration[] swerves)
        Create modules based off of the SwerveModuleConfiguration.
        Parameters:
        swerves - Swerve constants.
        Returns:
        Swerve Modules.