Class ElevatorIOTalonFXSim

java.lang.Object
frc.alotobots.reefscape.subsystems.elevator.io.ElevatorIOTalonFXSim
All Implemented Interfaces:
ElevatorIO

public class ElevatorIOTalonFXSim extends Object implements ElevatorIO
Motor Control Types
  • Constructor Details

    • ElevatorIOTalonFXSim

      public ElevatorIOTalonFXSim()
  • Method Details

    • updateInputs

      public void updateInputs(ElevatorIO.ElevatorIOInputs inputs)
      Description copied from interface: ElevatorIO
      Updates the input values from the elevator hardware. Called periodically to refresh sensor and motor data.
      Specified by:
      updateInputs in interface ElevatorIO
      Parameters:
      inputs - The inputs object to update with the latest values
    • setElevatorPosition

      public void setElevatorPosition(Distance position, int pidSlot)
      Sets the elevator to a specific position using closed-loop control.
      Specified by:
      setElevatorPosition in interface ElevatorIO
      Parameters:
      position - The target position as a Distance unit
      pidSlot - The PID slot to use (0 for velocity mode, 1 for position mode)
    • setElevatorPositionMotionMagic

      public void setElevatorPositionMotionMagic(Distance position, int pidSlot)
      Sets the elevator to a specific position using closed-loop control.
      Specified by:
      setElevatorPositionMotionMagic in interface ElevatorIO
      Parameters:
      position - The target position as a Distance unit
      pidSlot - The PID slot to use (0 for velocity mode, 1 for position mode)
    • setElevatorVelocity

      public void setElevatorVelocity(LinearVelocity velocity, int pidSlot)
      Sets the elevator to a specific velocity using closed-loop control.
      Specified by:
      setElevatorVelocity in interface ElevatorIO
      Parameters:
      velocity - The target velocity as a LinearVelocity unit
      pidSlot - The PID slot to use (0 for velocity mode, 1 for position mode)
    • setElevatorOpenLoop

      public void setElevatorOpenLoop(double percentOutput)
      Sets the elevator motors to run in open-loop mode at the specified output percentage.
      Specified by:
      setElevatorOpenLoop in interface ElevatorIO
      Parameters:
      percentOutput - The motor output as a percentage (-1.0 to 1.0)
    • setElevatorBrakeMode

      public void setElevatorBrakeMode(boolean brake)
      Sets the brake mode for the elevator motors.
      Specified by:
      setElevatorBrakeMode in interface ElevatorIO
      Parameters:
      brake - true to enable brake mode, false for coast mode
    • resetRotorPositions

      public void resetRotorPositions(Distance height)
      Resets the rotor sensors of both motors to be equal to the given height
      Specified by:
      resetRotorPositions in interface ElevatorIO
      Parameters:
      height - The height off the floor the elevator is at
    • stop

      public void stop()
      Stops all elevator motor movement.
      Specified by:
      stop in interface ElevatorIO