Class RollerSim

java.lang.Object
frc.spectrumLib.sim.RollerSim
All Implemented Interfaces:
Mountable

public class RollerSim extends Object implements Mountable
WPILib-backed simulation of a roller (flywheel) mechanism driven by a single Kraken X60 motor. Advances the TalonFX sim state on the shared SimLoop thread and animates the roller in a Mechanism2d canvas, coloring by spin direction. Implements Mountable so the roller axle can follow a parent Mount.
  • Constructor Details

    • RollerSim

      public RollerSim(RollerConfig config, Mechanism2d mech, TalonFX motor, String name)
      Parameters:
      mech - the Mechanism2d canvas to draw the roller on
      name - prefix for this sim's Mechanism2d element labels
  • Method Details

    • update

      public void update(double dt)
      One sim tick: steps the flywheel, feeds the rotor state back, and redraws.