Class FlywheelSim

java.lang.Object
edu.wpi.first.wpilibj.simulation.LinearSystemSim<N1,N1,N1>
edu.wpi.first.wpilibj.simulation.FlywheelSim

public class FlywheelSim extends LinearSystemSim<N1,N1,N1>
Represents a simulated flywheel mechanism.
  • Constructor Details

  • Method Details

    • setAngularVelocity

      public void setAngularVelocity(double velocity)
      Sets the flywheel's angular velocity.
      Parameters:
      velocity - The new velocity in radians per second.
    • getGearing

      public double getGearing()
      Returns the gear ratio of the flywheel.
      Returns:
      the flywheel's gear ratio.
    • getJ

      public double getJ()
      Returns the moment of inertia.
      Returns:
      The flywheel's moment of inertia in kg-m².
    • getGearbox

      public DCMotor getGearbox()
      Returns the gearbox for the flywheel.
      Returns:
      The flywheel's gearbox.
    • getAngularVelocity

      public double getAngularVelocity()
      Returns the flywheel's velocity.
      Returns:
      The flywheel's velocity in rad/s.
    • getAngularAcceleration

      public double getAngularAcceleration()
      Returns the flywheel's acceleration.
      Returns:
      The flywheel's acceleration in rad/s².
    • getTorque

      public double getTorque()
      Returns the flywheel's torque.
      Returns:
      The flywheel's torque in Newton-meters.
    • getCurrentDraw

      public double getCurrentDraw()
      Returns the flywheel's current draw.
      Returns:
      The flywheel's current draw in amps.
    • getInputVoltage

      public double getInputVoltage()
      Gets the input voltage for the flywheel.
      Returns:
      The flywheel's input voltage.
    • setInputVoltage

      public void setInputVoltage(double volts)
      Sets the input voltage for the flywheel.
      Parameters:
      volts - The input voltage.