Class SwerveDriveConfiguration

java.lang.Object
swervelib.parser.SwerveDriveConfiguration

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

    • moduleLocationsMeters

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

      public SwerveIMU imu
      Swerve IMU
    • 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.
    • modules

      public SwerveModule[] modules
      Swerve Modules.
  • Constructor Details

    • 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 Details

    • createModules

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