Package swervelib.parser
Class SwerveDriveConfiguration
java.lang.Object
swervelib.parser.SwerveDriveConfiguration
Swerve drive configurations used during SwerveDrive construction.
-
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleMax module speed in meters per second.doubleMax module speed in meters per second.Swerve IMUbooleanInvert the imu measurements.doubleMax module speed in meters per second.intNumber of modules on the robot.edu.wpi.first.math.geometry.Translation2d[]Swerve Module locations.Swerve Modules. -
Constructor Summary
ConstructorsConstructorDescriptionSwerveDriveConfiguration(SwerveModuleConfiguration[] moduleConfigs, SwerveIMU swerveIMU, double maxSpeed, boolean invertedIMU) Create swerve drive configuration. -
Method Summary
Modifier and TypeMethodDescriptioncreateModules(SwerveModuleConfiguration[] swerves) Create modules based off of the SwerveModuleConfiguration.
-
Field Details
-
moduleLocationsMeters
public edu.wpi.first.math.geometry.Translation2d[] moduleLocationsMetersSwerve Module locations. -
imu
Swerve IMU -
invertedIMU
public boolean invertedIMUInvert the imu measurements. -
maxSpeed
public double maxSpeedMax module speed in meters per second. -
attainableMaxTranslationalSpeedMetersPerSecond
public double attainableMaxTranslationalSpeedMetersPerSecondMax module speed in meters per second. -
attainableMaxRotationalVelocityRadiansPerSecond
public double attainableMaxRotationalVelocityRadiansPerSecondMax module speed in meters per second. -
moduleCount
public int moduleCountNumber of modules on the robot. -
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
Create modules based off of the SwerveModuleConfiguration.- Parameters:
swerves- Swerve constants.- Returns:
- Swerve Modules.
-