Package frc.spectrumLib.sim
Class RollerSim
java.lang.Object
frc.spectrumLib.sim.RollerSim
- All Implemented Interfaces:
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.-
Nested Class Summary
Nested classes/interfaces inherited from interface frc.spectrumLib.sim.Mountable
Mountable.MountedConfig -
Constructor Summary
ConstructorsConstructorDescriptionRollerSim(RollerConfig config, Mechanism2d mech, TalonFX motor, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoidupdate(double dt) One sim tick: steps the flywheel, feeds the rotor state back, and redraws.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface frc.spectrumLib.sim.Mountable
getUpdatedX, getUpdatedX, getUpdatedY, getUpdatedY
-
Constructor Details
-
RollerSim
- Parameters:
mech- the Mechanism2d canvas to draw the roller onname- 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.
-