Package frc.robot.subsystems
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
FieldsModifier and TypeFieldDescriptionfinal 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 towerfinal edu.wpi.first.wpilibj2.command.button.Trigger
Trigger that is active when the elbow is on the front side.Method Summary
Modifier and TypeMethodDescriptionedu.wpi.first.units.measure.Angle
Gets the current elbow angleedu.wpi.first.units.measure.Distance
Gets the current elevator heightstatic CoralArm
Gets the singleton instance of the CoralArm subsystem.void
periodic()
edu.wpi.first.wpilibj2.command.Command
setClimb()
Command to move the arm to the CLIMB positionedu.wpi.first.wpilibj2.command.Command
setHigh()
Command to move the arm to the HIGH positionedu.wpi.first.wpilibj2.command.Command
Command to move the arm to the INTAKE positionedu.wpi.first.wpilibj2.command.Command
setLow()
Command to move the arm to the LOW positionedu.wpi.first.wpilibj2.command.Command
setMid()
Command to move the arm to the MID positionedu.wpi.first.wpilibj2.command.Command
setPosition
(String setpointKey) Creates a command to set the arm position based on a predefined setpoint nameedu.wpi.first.wpilibj2.command.Command
setZero()
Command to move the arm to the ZERO positionMethods 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 onFrontTrigger that is active when the elbow is on the front side.aboveSafeHeight
public final edu.wpi.first.wpilibj2.command.button.Trigger aboveSafeHeightTrigger that is active when the elevator is at a safe height.inSafeAngle
public final edu.wpi.first.wpilibj2.command.button.Trigger inSafeAngleTrigger that is active when the elbow angle won't hit the elevator tower
Method Details
getInstance
Gets the singleton instance of the CoralArm subsystem.- Returns:
- The singleton instance.
setPosition
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()