Interface SystemSim<T>


public interface SystemSim<T>

System Simulation

This interface defines the contract for a system simulation, which can be used to abstract the behavior of all WPILib linear system sims in one interface.

  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the wrapped WPILib linear system simulation instance.
    org.wpilib.units.measure.Angle
    Gets the current position of the mechanism in the simulation.
    org.wpilib.units.measure.AngularVelocity
    Gets the current velocity of the mechanism in the simulation.
    static SystemSim<org.wpilib.simulation.DCMotorSim>
    of(org.wpilib.simulation.DCMotorSim dcMotorSim)
     
    static SystemSim<org.wpilib.simulation.ElevatorSim>
    of(org.wpilib.simulation.ElevatorSim elevatorSim, org.wpilib.units.measure.Distance drumRadius)
     
    static SystemSim<org.wpilib.simulation.FlywheelSim>
    of(org.wpilib.simulation.FlywheelSim flywheelSim)
     
    static SystemSim<org.wpilib.simulation.SingleJointedArmSim>
    of(org.wpilib.simulation.SingleJointedArmSim armSim)
     
    void
    setInputVoltage(org.wpilib.units.measure.Voltage voltage)
    Sets the input voltage for the simulation.
    void
    update(org.wpilib.units.measure.Time dt)
    Updates the simulation
  • Method Details

    • setInputVoltage

      void setInputVoltage(org.wpilib.units.measure.Voltage voltage)
      Sets the input voltage for the simulation.
      Parameters:
      voltage - The input voltage to set for the simulation.
    • update

      void update(org.wpilib.units.measure.Time dt)
      Updates the simulation
      Parameters:
      dt - The time step to advance the simulation
    • getMechanismPosition

      org.wpilib.units.measure.Angle getMechanismPosition()
      Gets the current position of the mechanism in the simulation.
      Returns:
      The current position of the mechanism.
    • getMechanismVelocity

      org.wpilib.units.measure.AngularVelocity getMechanismVelocity()
      Gets the current velocity of the mechanism in the simulation.
      Returns:
      The current velocity of the mechanism.
    • getLinearSystemSim

      Gets the wrapped WPILib linear system simulation instance.
      Returns:
      The wrapped WPILib linear system simulation instance.
    • of

      static SystemSim<org.wpilib.simulation.DCMotorSim> of(org.wpilib.simulation.DCMotorSim dcMotorSim)
    • of

      static SystemSim<org.wpilib.simulation.FlywheelSim> of(org.wpilib.simulation.FlywheelSim flywheelSim)
    • of

      static SystemSim<org.wpilib.simulation.SingleJointedArmSim> of(org.wpilib.simulation.SingleJointedArmSim armSim)
    • of

      static SystemSim<org.wpilib.simulation.ElevatorSim> of(org.wpilib.simulation.ElevatorSim elevatorSim, org.wpilib.units.measure.Distance drumRadius)