Class SelfControlledSwerveDriveSimulation.SelfControlledModuleSimulation
java.lang.Object
org.ironmaple.simulation.drivesims.SelfControlledSwerveDriveSimulation.SelfControlledModuleSimulation
- Enclosing class:
- SelfControlledSwerveDriveSimulation
public static class SelfControlledSwerveDriveSimulation.SelfControlledModuleSimulation
extends Object
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionoptimizeAndRunModuleState
(SwerveModuleState setPoint) Runs the control loops for swerve states on a simulated module.void
runModuleState
(SwerveModuleState setPoint) withCurrentLimits
(edu.wpi.first.units.measure.Current driveCurrentLimit, edu.wpi.first.units.measure.Current steerCurrentLimit) withSteerPID
(PIDController steerController)
-
Field Details
-
instance
-
-
Constructor Details
-
SelfControlledModuleSimulation
-
-
Method Details
-
withSteerPID
public SelfControlledSwerveDriveSimulation.SelfControlledModuleSimulation withSteerPID(PIDController steerController) -
withCurrentLimits
public SelfControlledSwerveDriveSimulation.SelfControlledModuleSimulation withCurrentLimits(edu.wpi.first.units.measure.Current driveCurrentLimit, edu.wpi.first.units.measure.Current steerCurrentLimit) -
optimizeAndRunModuleState
Runs the control loops for swerve states on a simulated module.
Optimizes the set-point using
SwerveModuleState.optimize(SwerveModuleState, Rotation2d)
.Executes a closed-loop control on the swerve module.
- Parameters:
setPoint
- the desired state to optimize and apply- Returns:
- the optimized swerve module state after control execution
-
runModuleState
-
getMeasuredState
-
getModulePosition
-