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.edu.wpi.first.math.kinematics.SwerveModuleStategetState()Get theSwerveModuleStateof the simulated module.voidupdateStateAndPosition(edu.wpi.first.math.kinematics.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
public void updateStateAndPosition(edu.wpi.first.math.kinematics.SwerveModuleState desiredState) 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
public edu.wpi.first.math.kinematics.SwerveModulePosition getPosition()Get the simulated swerve module position.- Returns:
SwerveModulePositionof the simulated module.
-
getState
public edu.wpi.first.math.kinematics.SwerveModuleState getState()Get theSwerveModuleStateof the simulated module.- Returns:
SwerveModuleStateof the simulated module.
-