Class SwerveDriveConfiguration
- java.lang.Object
-
- frc.robot.subsystems.swervedrive2.swervelib.parser.SwerveDriveConfiguration
-
public class SwerveDriveConfiguration extends Object
Swerve drive configurations used during SwerveDrive construction.
-
-
Field Summary
Fields Modifier and Type Field Description SwerveIMUimuSwerve IMUbooleaninvertedIMUInvert the imu measurements.doublemaxSpeedMax speed in meters per second.intmoduleCountNumber of modules on the robot.edu.wpi.first.math.geometry.Translation2d[]moduleLocationsMetersSwerve Module locations.SwerveModule[]modulesSwerve Modules.
-
Constructor Summary
Constructors Constructor Description SwerveDriveConfiguration(SwerveModuleConfiguration[] moduleConfigs, SwerveIMU swerveIMU, double maxSpeed, boolean invertedIMU)Create swerve drive configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SwerveModule[]createModules(SwerveModuleConfiguration[] swerves)Create modules based off of the SwerveModuleConfiguration.
-
-
-
Field Detail
-
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 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.
-
-