Package frc.robot.subsystems
Class Arm
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.Arm
Creates the subsystem for the arm.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal com.revrobotics.CANSparkMax -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadjust(double amount) booleanGet if arm angle is close to the setpointvoidSet arm to extended positiondoubleGet angle of arm in degrees with a crossover outside of the configuration spacedoubleGet angle of arm in radians with a crossover outside of the configuration spacedoubleGet angle of wrist in degrees with a crossover outside of the configuration spacedoubleGet angle of wrist in radians with a crossover outside of the configuration spacevoidperiodic()voidSet arm to retracted positionvoidsetArmGoal(double goal) Set setpoint for arm angle in degreesvoidSet motors to brake modevoidSet motors to coast modevoidsetWristGoal(double goal) Set setpoint for wrist angle in degreesbooleanGet if wrist angle is close to the setpointMethods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd
-
Field Details
-
armSense
-
wristMotor
public final com.revrobotics.CANSparkMax wristMotor
-
-
Constructor Details
-
Arm
Arm Subsystem
-
-
Method Details
-
adjust
public void adjust(double amount) -
periodic
public void periodic() -
getArmAngle
public double getArmAngle()Get angle of arm in degrees with a crossover outside of the configuration space -
getArmAngleRad
public double getArmAngleRad()Get angle of arm in radians with a crossover outside of the configuration space -
getWristAngle
public double getWristAngle()Get angle of wrist in degrees with a crossover outside of the configuration space -
getWristAngleRad
public double getWristAngleRad()Get angle of wrist in radians with a crossover outside of the configuration space -
setArmGoal
public void setArmGoal(double goal) Set setpoint for arm angle in degrees -
setWristGoal
public void setWristGoal(double goal) Set setpoint for wrist angle in degrees -
armInPosition
public boolean armInPosition()Get if arm angle is close to the setpoint -
wristInPosition
public boolean wristInPosition()Get if wrist angle is close to the setpoint -
extendArm
public void extendArm()Set arm to extended position -
retractArm
public void retractArm()Set arm to retracted position -
setCoastMode
public void setCoastMode()Set motors to coast mode -
setBrakeMode
public void setBrakeMode()Set motors to brake mode
-