Class SmartOpponentConfig.ModuleConfig
java.lang.Object
swervelib.simulation.ironmaple.simulation.opponentsim.SmartOpponentConfig.ModuleConfig
- Enclosing class:
- SmartOpponentConfig
The SmartOpponent's Module Config, this is an inner config that is only the module configuration.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumModule Options that MUST be set for theSmartOpponentConfigto be valid.static enumA few module presets to simplify configs that don't need to be specific. -
Field Summary
FieldsModifier and TypeFieldDescriptiondoublecom.pathplanner.lib.config.ModuleConfigdoubledouble -
Method Summary
Modifier and TypeMethodDescriptionConstructs a newSmartOpponentConfig.ModuleConfigfrom aSmartOpponentConfig.ModuleConfig.Copies the ModuleConfig from another ModuleConfig.Creates a newSwerveModuleSimulationfrom aModuleConfig.com.pathplanner.lib.config.ModuleConfigCreates a newModuleConfigfrom aModuleConfig.booleanChecks if the config is valid.withDriveCurrentLimit(Current driveCurrentLimit) Sets the driveCurrentlimit.withDriveFrictionVoltage(Voltage driveFrictionVoltage) Sets the friction voltage for the drive motor.withDriveGearRatio(double driveGearRatio) Sets the gear ratios for the drive motor.withDriveMotor(DCMotor driveMotor) Sets the driveDCMotor.withMaxDriveVelocity(LinearVelocity maxDriveVelocity) Sets the max drive velocity.withSteerAngularInertia(MomentOfInertia steerAngularInertia) Sets the steer angular inertia.withSteerFrictionVoltage(Voltage steerFrictionVoltage) Sets the friction voltage for the steer motor.withSteerGearRatio(double steerGearRatio) Sets the gear ratio for the steer motor.withSteerMotor(DCMotor dcMotor) Sets the steerDCMotor.withWheelCOF(double wheelCOF) Sets the wheel Coefficient of Friction.withWheelRadius(Distance wheelRadius) Sets the wheel radius.
-
Field Details
-
wheelRadius
-
wheelCOF
public double wheelCOF -
driveMotor
-
steerMotor
-
driveGearRatio
public double driveGearRatio -
steerGearRatio
public double steerGearRatio -
driveFrictionVoltage
-
steerFrictionVoltage
-
steerAngularInertia
-
maxDriveVelocity
-
driveCurrentLimit
-
requiredModuleOptions
-
moduleSim
-
pathplannerModuleConfig
public com.pathplanner.lib.config.ModuleConfig pathplannerModuleConfig
-
-
Method Details
-
createModuleSimConfig
Creates a newSwerveModuleSimulationfrom aModuleConfig. Gets saved for later use.- Returns:
- the new
SwerveModuleSimulation.
-
updatePathplannerModuleConfig
public com.pathplanner.lib.config.ModuleConfig updatePathplannerModuleConfig()Creates a newModuleConfigfrom aModuleConfig.- Returns:
- the new
ModuleConfig.
-
validConfig
public boolean validConfig()Checks if the config is valid.- Returns:
- true if the config is valid, false otherwise.
-
withWheelRadius
Sets the wheel radius.- Parameters:
wheelRadius- The wheel radius.- Returns:
- this, for chaining.
-
withWheelCOF
Sets the wheel Coefficient of Friction.- Parameters:
wheelCOF- The wheel Coefficient of Friction.- Returns:
- this, for chaining.
-
withDriveMotor
Sets the driveDCMotor.- Parameters:
driveMotor- The driveDCMotor.- Returns:
- this, for chaining.
-
withSteerMotor
Sets the steerDCMotor.- Parameters:
dcMotor- The steerDCMotor.- Returns:
- this, for chaining.
-
withDriveGearRatio
Sets the gear ratios for the drive motor.- Parameters:
driveGearRatio- The gear ratio for the drive motor.- Returns:
- this, for chaining.
-
withSteerGearRatio
Sets the gear ratio for the steer motor.- Parameters:
steerGearRatio- The gear ratio for the steer motor.- Returns:
- this, for chaining.
-
withDriveFrictionVoltage
Sets the friction voltage for the drive motor.- Parameters:
driveFrictionVoltage- The friction voltage for the drive motor.- Returns:
- this, for chaining.
-
withSteerFrictionVoltage
Sets the friction voltage for the steer motor.- Parameters:
steerFrictionVoltage- The friction voltage for the steer motor.- Returns:
- this, for chaining.
-
withSteerAngularInertia
public SmartOpponentConfig.ModuleConfig withSteerAngularInertia(MomentOfInertia steerAngularInertia) Sets the steer angular inertia.- Parameters:
steerAngularInertia- The steer angular inertia.- Returns:
- this, for chaining.
-
withMaxDriveVelocity
Sets the max drive velocity.- Parameters:
maxDriveVelocity- The max drive velocity.- Returns:
- this, for chaining.
-
withDriveCurrentLimit
Sets the driveCurrentlimit.- Parameters:
driveCurrentLimit- The driveCurrentlimit.- Returns:
- this, for chaining.
-
copy
Copies the ModuleConfig from another ModuleConfig.- Parameters:
other- the other ModuleConfig to copy from.- Returns:
- this, for chaining.
-
clone
Constructs a newSmartOpponentConfig.ModuleConfigfrom aSmartOpponentConfig.ModuleConfig.- Parameters:
other- the other ModuleConfig to copy from.- Returns:
- the new ModuleConfig.
-