Class CoralArm

java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.CoralArm
All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable, edu.wpi.first.wpilibj2.command.Subsystem

public class CoralArm extends edu.wpi.first.wpilibj2.command.SubsystemBase
Subsystem that controls the Coral Arm, responsible for moving the arm to different positions.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final edu.wpi.first.wpilibj2.command.button.Trigger
    Trigger that is active when the elevator is at a safe height.
    final edu.wpi.first.wpilibj2.command.button.Trigger
    Trigger that is active when the elbow angle won't hit the elevator tower
    final edu.wpi.first.wpilibj2.command.button.Trigger
    Trigger that is active when the elbow is on the front side.
  • Method Summary

    Modifier and Type
    Method
    Description
    edu.wpi.first.units.measure.Angle
    Gets the current elbow angle
    edu.wpi.first.units.measure.Distance
    Gets the current elevator height
    static CoralArm
    Gets the singleton instance of the CoralArm subsystem.
    void
     
    edu.wpi.first.wpilibj2.command.Command
    Command to move the arm to the CLIMB position
    edu.wpi.first.wpilibj2.command.Command
    Command to move the arm to the HIGH position
    edu.wpi.first.wpilibj2.command.Command
    Command to move the arm to the INTAKE position
    edu.wpi.first.wpilibj2.command.Command
    Command to move the arm to the LOW position
    edu.wpi.first.wpilibj2.command.Command
    Command to move the arm to the MID position
    edu.wpi.first.wpilibj2.command.Command
    setPosition(String setpointKey)
    Creates a command to set the arm position based on a predefined setpoint name
    edu.wpi.first.wpilibj2.command.Command
    Command to move the arm to the ZERO position

    Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase

    addChild, getName, getSubsystem, initSendable, setName, setSubsystem

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem

    defer, getCurrentCommand, getDefaultCommand, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
  • Field Details

    • onFront

      public final edu.wpi.first.wpilibj2.command.button.Trigger onFront
      Trigger that is active when the elbow is on the front side.
    • aboveSafeHeight

      public final edu.wpi.first.wpilibj2.command.button.Trigger aboveSafeHeight
      Trigger that is active when the elevator is at a safe height.
    • inSafeAngle

      public final edu.wpi.first.wpilibj2.command.button.Trigger inSafeAngle
      Trigger that is active when the elbow angle won't hit the elevator tower
  • Method Details

    • getInstance

      public static CoralArm getInstance()
      Gets the singleton instance of the CoralArm subsystem.
      Returns:
      The singleton instance.
    • setPosition

      public edu.wpi.first.wpilibj2.command.Command setPosition(String setpointKey)
      Creates a command to set the arm position based on a predefined setpoint name
      Parameters:
      setpointKey - The key of the predefined setpoint in ARM_SETPOINTS
      Returns:
      A command that moves the arm to the specified position
    • setZero

      public edu.wpi.first.wpilibj2.command.Command setZero()
      Command to move the arm to the ZERO position
      Returns:
      Command to set the arm to the ZERO position
    • setIntake

      public edu.wpi.first.wpilibj2.command.Command setIntake()
      Command to move the arm to the INTAKE position
      Returns:
      Command to set the arm to the INTAKE position
    • setLow

      public edu.wpi.first.wpilibj2.command.Command setLow()
      Command to move the arm to the LOW position
      Returns:
      Command to set the arm to the LOW position
    • setMid

      public edu.wpi.first.wpilibj2.command.Command setMid()
      Command to move the arm to the MID position
      Returns:
      Command to set the arm to the MID position
    • setHigh

      public edu.wpi.first.wpilibj2.command.Command setHigh()
      Command to move the arm to the HIGH position
      Returns:
      Command to set the arm to the HIGH position
    • setClimb

      public edu.wpi.first.wpilibj2.command.Command setClimb()
      Command to move the arm to the CLIMB position
      Returns:
      Command to set the arm to the CLIMB position
    • getCurrentElbowAngle

      public edu.wpi.first.units.measure.Angle getCurrentElbowAngle()
      Gets the current elbow angle
      Returns:
      Current elbow angle
    • getCurrentElevatorHeight

      public edu.wpi.first.units.measure.Distance getCurrentElevatorHeight()
      Gets the current elevator height
      Returns:
      Current elevator height
    • periodic

      public void periodic()