frc2019.robot.subsystems.Arm

Subsystem for the arm. The arm is a two-joint arm, with an elbow connected to the baby carriage, and a wrist that moves the Cargo Manipulator up and down. The arm contains both the Cargo Manipulator and the “Beak” (Hatch Mechanism).

Commands

public Arm()

Constructor for Arm.

Both motors are set to brake mode.

The motors are brushless.

Limit Switches are normally open.

public void initDefaultCommand()

Associates the Articulate command with the subsystem Arm.

public void drive(double speed, boolean hold)

Drives the motor. Elbow runs, but wrist does not. Default command that moves the motor.

public void elbow(double speed)

Drives the elbow motor as well as defining limit behavior. Puts encoder data to the SmartDashboard. Used if drive() is not.

public void wrist(double speed)

Drives the wrist motor. Puts Gyro and Encoder values to the SmartDashboard. Sets Deadband for input and applies rudimentary PID.

private double getAngle()

Gets the angle of the gyro on the arm.

public void resetGyro()

Resets the gyro value. Requires class below to call.

public class ResetGyro

Class that allows ResetGyro() to work.

ResetGyro()

resets the gyro.

initialize()

Calls resetGyro()

public class Arm

ResetGyro() and initialize() are the only functions that are under the class ResetGyro. Everything else exists under the class Arm.

public double getElbowEncoderPosition()

Gets the position of the encoder on the elbow.

public double getWristEncoderPosition()

Gets the position of the encoder on the wrist.

public double getWristEncoderPositionRaw()

TODO: Figure out if this is used or not.

private void resetEncoderPosition()

Resets both the wrist and elbow encoder positions.

private void resetGyroAngle()

Resets the angle of the gyros.

private void toggleGyro()

Toggles whether the gyro is being used or not.