Package swervelib.simulation
Class SwerveModuleSimulation
java.lang.Object
swervelib.simulation.SwerveModuleSimulation
Class to hold simulation data for
SwerveModule
-
Constructor Summary
ConstructorDescriptionCreate simulation class and initialize module at 0. -
Method Summary
Modifier and TypeMethodDescriptionGet the simulated swerve module position.getState()
Get theSwerveModuleState
of the simulated module.void
updateStateAndPosition
(SwerveModuleState desiredState) Update the position and state of the module.
-
Constructor Details
-
SwerveModuleSimulation
public SwerveModuleSimulation()Create simulation class and initialize module at 0.
-
-
Method Details
-
updateStateAndPosition
Update the position and state of the module. Called fromSwerveModule.setDesiredState(edu.wpi.first.math.kinematics.SwerveModuleState, boolean, boolean)
function when simulated.- Parameters:
desiredState
- State the swerve module is set to.
-
getPosition
Get the simulated swerve module position.- Returns:
SwerveModulePosition
of the simulated module.
-
getState
Get theSwerveModuleState
of the simulated module.- Returns:
SwerveModuleState
of the simulated module.
-