Class SwerveModuleSimulation

java.lang.Object
swervelib.simulation.SwerveModuleSimulation

public class SwerveModuleSimulation extends Object
Class to hold simulation data for SwerveModule
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create simulation class and initialize module at 0.
  • Method Summary

    Modifier and Type
    Method
    Description
    edu.wpi.first.math.kinematics.SwerveModulePosition
    Get the simulated swerve module position.
    edu.wpi.first.math.kinematics.SwerveModuleState
    Get the SwerveModuleState of the simulated module.
    void
    updateStateAndPosition(edu.wpi.first.math.kinematics.SwerveModuleState desiredState)
    Update the position and state of the module.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 from SwerveModule.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:
      SwerveModulePosition of the simulated module.
    • getState

      public edu.wpi.first.math.kinematics.SwerveModuleState getState()
      Get the SwerveModuleState of the simulated module.
      Returns:
      SwerveModuleState of the simulated module.