write methods getArmAngle and getHandAngle
authorroeibustein <roei.burstein@gmail.com>
Fri, 29 Jan 2016 03:36:42 +0000 (19:36 -0800)
committerShaina Chen <shaina.sierra@gmail.com>
Fri, 5 Feb 2016 04:21:15 +0000 (20:21 -0800)
src/org/usfirst/frc/team3501/robot/subsystems/DefenseArm.java

index af4158fb42d4e36837ae28c06a8049465a81c98b..adf9b5f87e1c31e5ec717ce66d48820af7780c8c 100755 (executable)
@@ -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