Package frc.robot.subsystems.climb
Class ClimbIOSim
java.lang.Object
frc.robot.subsystems.climb.ClimbIOSim
- All Implemented Interfaces:
ClimbIO
Physics simulation implementation of
ClimbIO.
This class uses SparkMaxSim to simulate the Spark MAX motor controller for the climb
mechanism, backed by a DCMotorSim physics model. Limit switch behavior is emulated via
SparkLimitSwitchSim based on the simulated position. Configuration mirrors ClimbIOSpark.
-
Nested Class Summary
Nested classes/interfaces inherited from interface frc.robot.subsystems.climb.ClimbIO
ClimbIO.ClimbIOInputs -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ClimbIOSim and initializes the simulated Spark MAX. -
Method Summary
Modifier and TypeMethodDescriptionvoidsetLiftVoltage(Voltage voltage) Run the lift motors at the specified voltage.voidupdateInputs(ClimbIO.ClimbIOInputs inputs) Updates the simulation state and updates loggable inputs.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface frc.robot.subsystems.climb.ClimbIO
clearFaults
-
Constructor Details
-
ClimbIOSim
public ClimbIOSim()Creates a new ClimbIOSim and initializes the simulated Spark MAX.
-
-
Method Details
-
updateInputs
Updates the simulation state and updates loggable inputs.- Specified by:
updateInputsin interfaceClimbIO- Parameters:
inputs- The inputs object to update with simulated data.
-
setLiftVoltage
Description copied from interface:ClimbIORun the lift motors at the specified voltage.- Specified by:
setLiftVoltagein interfaceClimbIO- Parameters:
voltage- The voltage to apply to the motor controller.
-