add getHookHeight method and getFootHeight method
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / DefenseArm.java
index 8d30599838198924c287d726bb83104e571294b9..33fb5f927aa91cd0b1457bca188079117bd9e33b 100755 (executable)
@@ -1,16 +1,70 @@
 package org.usfirst.frc.team3501.robot.subsystems;\r
 \r
+import org.usfirst.frc.team3501.robot.Constants;\r
+\r
 import edu.wpi.first.wpilibj.AnalogPotentiometer;\r
+import edu.wpi.first.wpilibj.CANTalon;\r
 import edu.wpi.first.wpilibj.command.Subsystem;\r
 \r
 public class DefenseArm extends Subsystem {\r
   // Defense arm related objects\r
-  private AnalogPotentiometer potentiometer;\r
+  public AnalogPotentiometer defenseArmPotentiometer;\r
+  public AnalogPotentiometer defenseHandPotentiometer;\r
+  public CANTalon defenseArmMotor;\r
+  public CANTalon defenseHandMotor;\r
+  public double hookHeight;\r
+  public double footHeight;\r
+\r
   // Defense arm specific constants that relate to the degrees per pulse value\r
   // for the potentiometers\r
-  private final static double PULSES_PER_ROTATION = 0; // in pulses\r
-  private final static double FULL_RANGE = 270.0; // in degrees\r
-  private final static double OFFSET = -135.0; // in degrees\r
+  // private final static double PULSES_PER_ROTATION = 1; // in pulses\r
+  public final static double FULL_RANGE = 270.0; // in degrees\r
+  public final static double OFFSET = -135.0; // in degrees\r
+  public final static double[] armPotValue = { 0.0, 45.0, 90.0 }; // 3 level\r
+\r
+  // array;\r
+\r
+  // do we want to use a hashmap??\r
+  // angles at 0,45,90 (Potentiometer value readings)\r
+  // degrees\r
+\r
+  public DefenseArm() {\r
+    defenseArmPotentiometer = new AnalogPotentiometer(\r
+        Constants.DefenseArm.ARM_CHANNEL,\r
+        FULL_RANGE, OFFSET);\r
+    defenseArmMotor = new CANTalon(Constants.DefenseArm.ARM_PORT);\r
+    defenseHandMotor = new CANTalon(Constants.DefenseArm.HAND_PORT);\r
+  }\r
+\r
+  /***\r
+   * This method gets the height of the hook from the ground. The hook is\r
+   * attached to the end of the hand, which is attached to the arm.\r
+   *\r
+   * @return hookHeight gets height of hook from ground. The hook is attached to\r
+   *         the end of the hand, which is attached the arm. The height is in\r
+   *         inches.\r
+   *\r
+   */\r
+\r
+  public double getHookHeight() {\r
+\r
+    return hookHeight;\r
+  }\r
+\r
+  /***\r
+   * This method gets the height of the foot from the ground. The foot is\r
+   * attached to the end of the hand, which is attached to the arm.\r
+   *\r
+   * @return footHeight gets height of foot from ground. The foot is attached to\r
+   *         the end of the hand, which is attached the arm. The height is in\r
+   *         inches.\r
+   *\r
+   */\r
+\r
+  public double getFootHeight() {\r
+\r
+    return footHeight;\r
+  }\r
 \r
   @Override\r
   protected void initDefaultCommand() {\r