Package frc.robot.subsystems
Class Arm
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.Arm
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
,edu.wpi.first.wpilibj2.command.Subsystem
public class Arm
extends edu.wpi.first.wpilibj2.command.SubsystemBase
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
edu.wpi.first.wpilibj2.command.Command
ArmDefaultCommand
(Supplier<Double> armVelocity, Supplier<Double> elevatorVelocity) edu.wpi.first.wpilibj2.command.Command
double
double
edu.wpi.first.wpilibj2.command.Command
void
periodic()
edu.wpi.first.wpilibj2.command.Command
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 setpointedu.wpi.first.wpilibj2.command.Command
edu.wpi.first.wpilibj2.command.Command
SetTargets
(Supplier<Double> distance) edu.wpi.first.wpilibj2.command.Command
SetTargetsAuto
(Supplier<Double> distance) edu.wpi.first.wpilibj2.command.Command
Stow()
stows the arm and elevatoredu.wpi.first.wpilibj2.command.Command
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
-
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
public edu.wpi.first.wpilibj2.command.Command RaiseElevator() -
lowerElevator
public edu.wpi.first.wpilibj2.command.Command lowerElevator() -
Stow
public edu.wpi.first.wpilibj2.command.Command 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
public edu.wpi.first.wpilibj2.command.Command SetTargets(Constants.ShootingConstants.ShootingPosition position) -
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
public edu.wpi.first.wpilibj2.command.Command ToggleBrakeModes() -
EnableBrakeMode
public edu.wpi.first.wpilibj2.command.Command EnableBrakeMode() -
periodic
public void periodic() -
getArmAbsoluteEncoderPosition
public double getArmAbsoluteEncoderPosition() -
getElevatorAbsoluteEncoderPosition
public double getElevatorAbsoluteEncoderPosition() -
getMotorTab
-
areArmAndElevatorAtTarget
public boolean areArmAndElevatorAtTarget()
-