java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.mechanisms.arm.Arm
All Implemented Interfaces:
Sendable, Subsystem

public class Arm extends SubsystemBase
A superstructure to control both the Elevator and Pivot. Includes some important safety stuff so this shouldn't be skipped.
  • Constructor Details

    • Arm

      public Arm()
      Creates a new Arm subsystem using a new Elevator and Pivot.
    • Arm

      public Arm(Elevator elevator, Pivot pivot)
      Creates a new Arm subsystem using the provided Elevator and Pivot.
      Parameters:
      elevator - The Elevator to use.
      pivot - The Pivot to use.
  • Method Details

    • periodic

      public void periodic()
      This method is responsible for ensuring safe interactions between the head and the chassis of the robot.

      This method will check the setpoint of the wrist, and, in the case that it is too low for the current elevator position, it will set the target to the lowest safe position.

    • init

      public void init()
      Initializes the elevator and pivot. Should be called pre-enable.
    • setPositionCommand

      public Command setPositionCommand(ArmPosition position)
      A command to set the elevator and wrist to a position.
      Parameters:
      position - The Constants.ArmPosition to set the elevator and wrist to.
      Returns:
      Command to run.
    • isAtTarget

      public boolean isAtTarget()
      Checks if the elevator and pivot are at their target positions.
      Returns:
      True if both the elevator and pivot are at their target positions, false otherwise.
    • toggleBrakeModesCommand

      public Command toggleBrakeModesCommand()