From dbfb54b364635f4285bbbc7b6904de1e5a3d22eb Mon Sep 17 00:00:00 2001 From: roeibustein Date: Thu, 28 Jan 2016 19:36:42 -0800 Subject: [PATCH] write methods getArmAngle and getHandAngle --- .../team3501/robot/subsystems/DefenseArm.java | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/DefenseArm.java b/src/org/usfirst/frc/team3501/robot/subsystems/DefenseArm.java index af4158fb..adf9b5f8 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DefenseArm.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DefenseArm.java @@ -1,3 +1,4 @@ +<<<<<<< 41a8c498b73f7772d992078cea69ee5673d70668 package org.usfirst.frc.team3501.robot.subsystems; import org.usfirst.frc.team3501.robot.Constants; @@ -114,3 +115,78 @@ public class DefenseArm extends Subsystem { protected void initDefaultCommand() { } } +======= +package org.usfirst.frc.team3501.robot.subsystems; + +import org.usfirst.frc.team3501.robot.Constants; + +import edu.wpi.first.wpilibj.AnalogPotentiometer; +import edu.wpi.first.wpilibj.CANTalon; +import edu.wpi.first.wpilibj.command.Subsystem; + +public class DefenseArm extends Subsystem { + // Defense arm related objects + public AnalogPotentiometer defenseArmPotentiometer; + public CANTalon defenseArmMotor; + public CANTalon defenseHandMotor; + public double hookHeight; + public double footHeight; + + // Defense arm specific constants that relate to the degrees per pulse value + // for the potentiometers + // private final static double PULSES_PER_ROTATION = 1; // in pulses + public final static double FULL_RANGE = 270.0; // in degrees + public final static double OFFSET = -135.0; // in degrees + public final static double[] armPotValue = { 0.0, 45.0, 90.0 }; // 3 level + + // array; + + // do we want to use a hashmap?? + // angles at 0,45,90 (Potentiometer value readings) + // degrees + + public DefenseArm() { + defenseArmPotentiometer = new AnalogPotentiometer( + Constants.DefenseArm.ARM_CHANNEL, FULL_RANGE, OFFSET); + + defenseArmMotor = new CANTalon(Constants.DefenseArm.ARM_PORT); + defenseHandMotor = new CANTalon(Constants.DefenseArm.HAND_PORT); + } + + /*** + * <<<<<<< Updated upstream This method gets the height of the hook from the + * ground. The hook is attached to the end of the hand, which is attached to + * the arm. + * + * @return hookHeight gets height of hook from ground. The hook is attached to + * the end of the hand, which is attached the arm. The height is in + * inches. + * + */ + + public double getHookHeight() { + + return hookHeight; + } + + /*** + * This method gets the height of the foot from the ground. The foot is + * attached to the end of the hand, which is attached to the arm. + * + * @return footHeight gets height of foot from ground. The foot is attached to + * the end of the hand, which is attached the arm. The height is in + * inches. + * + */ + + public double getFootHeight() { + + return footHeight; + + } + + @Override + protected void initDefaultCommand() { + } +} +>>>>>>> write methods getArmAngle and getHandAngle -- 2.30.2