Class Arm
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.mechanisms.arm.Arm
A superstructure to control both the Elevator and Pivot. Includes some important safety stuff so
this shouldn't be skipped.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
init()
Initializes theelevator
andpivot
.boolean
Checks if theelevator
andpivot
are at their target positions.void
periodic()
This method is responsible for ensuring safe interactions between the head and the chassis of the robot.setPositionCommand
(ArmPosition position) A command to set the elevator and wrist to a 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
-
Constructor Details
-
Arm
public Arm()Creates a new Arm subsystem using a new Elevator and Pivot. -
Arm
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 theelevator
andpivot
. Should be called pre-enable. -
setPositionCommand
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 theelevator
andpivot
are at their target positions.- Returns:
- True if both the elevator and pivot are at their target positions, false otherwise.
-
toggleBrakeModesCommand
-