Class ClimbIOSim

java.lang.Object
frc.robot.subsystems.climb.ClimbIOSim
All Implemented Interfaces:
ClimbIO

public class ClimbIOSim extends Object implements 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.

  • Constructor Details

    • ClimbIOSim

      public ClimbIOSim()
      Creates a new ClimbIOSim and initializes the simulated Spark MAX.
  • Method Details

    • updateInputs

      public void updateInputs(ClimbIO.ClimbIOInputs inputs)
      Updates the simulation state and updates loggable inputs.
      Specified by:
      updateInputs in interface ClimbIO
      Parameters:
      inputs - The inputs object to update with simulated data.
    • setLiftVoltage

      public void setLiftVoltage(Voltage voltage)
      Description copied from interface: ClimbIO
      Run the lift motors at the specified voltage.
      Specified by:
      setLiftVoltage in interface ClimbIO
      Parameters:
      voltage - The voltage to apply to the motor controller.