Package swervelib.simulation
Class SwerveModuleSimulation
java.lang.Object
swervelib.simulation.SwerveModuleSimulation
Class to hold simulation data for
SwerveModule-
Constructor Summary
ConstructorsConstructorDescriptionCreate simulation class and initialize module at 0. -
Method Summary
Modifier and TypeMethodDescriptionedu.wpi.first.math.kinematics.SwerveModulePositionGet the simulated swerve module position.getState()Get theSwerveModuleState2of the simulated module.voidupdateStateAndPosition(SwerveModuleState2 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(swervelib.math.SwerveModuleState2, boolean, boolean)function when simulated.- Parameters:
desiredState- State the swerve module is set to.
-
getPosition
public edu.wpi.first.math.kinematics.SwerveModulePosition getPosition()Get the simulated swerve module position.- Returns:
SwerveModulePositionof the simulated module.
-
getState
Get theSwerveModuleState2of the simulated module.- Returns:
SwerveModuleState2of the simulated module.
-