Package frc.robot.subsystems
Class Arm
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.Arm
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
ArmDefaultCommand
(Supplier<Double> armVelocity, Supplier<Double> elevatorVelocity) double
double
void
periodic()
void
setArmTarget
(double targetDegrees) safely set the target angle for the armvoid
setArmTargetByDistanceExtended
(double distance) sets the arm target based on the distance to the speaker and the interpolation tablevoid
setArmTargetByDistanceRetracted
(double distance) void
setArmVelocity
(double velocityDegreesPerSec) sets the velocity for the arm by moving a position setpointvoid
setElevatorTarget
(double target) safely set the target height for the elevatorvoid
setElevatorVelocity
(double velocityDegreesPerSec) sets the velocity for the elevator by moving a position setpointSetTargets
(Supplier<Double> distance) SetTargetsAuto
(Supplier<Double> distance) Stow()
stows the arm and elevatorMethods 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.
-
-
Method Details
-
setArmTarget
public void setArmTarget(double targetDegrees) safely set the target angle for the arm- Parameters:
targetDegrees
- the target angle for the arm in degrees
-
setArmTargetByDistanceExtended
public void setArmTargetByDistanceExtended(double distance) sets the arm target based on the distance to the speaker and the interpolation table- Parameters:
distance
- the distance to the speaker in meters
-
setArmTargetByDistanceRetracted
public void setArmTargetByDistanceRetracted(double distance) -
RaiseElevator
-
lowerElevator
-
Stow
stows the arm and elevator- Returns:
- a command to stow the arm and elevator
-
setArmVelocity
public void setArmVelocity(double velocityDegreesPerSec) sets the velocity for the arm by moving a position setpoint- Parameters:
velocityDegreesPerSec
- the velocity for the arm in degrees per second
-
setElevatorTarget
public void setElevatorTarget(double target) safely set the target height for the elevator- Parameters:
target
- the target height for the elevator in inches
-
SetTargets
-
SetTargets
-
SetTargetsAuto
-
setElevatorVelocity
public void setElevatorVelocity(double velocityDegreesPerSec) sets the velocity for the elevator by moving a position setpoint- Parameters:
velocityDegreesPerSec
- the velocity for the elevator in degrees per second
-
ArmDefaultCommand
-
ToggleBrakeModes
-
EnableBrakeMode
-
periodic
public void periodic() -
getArmAbsoluteEncoderPosition
public double getArmAbsoluteEncoderPosition() -
getElevatorAbsoluteEncoderPosition
public double getElevatorAbsoluteEncoderPosition() -
getMotorTab
-
areArmAndElevatorAtTarget
public boolean areArmAndElevatorAtTarget()
-