add getHookHeight method and getFootHeight method
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / DefenseArm.java
1 package org.usfirst.frc.team3501.robot.subsystems;
2
3 import org.usfirst.frc.team3501.robot.Constants;
4
5 import edu.wpi.first.wpilibj.AnalogPotentiometer;
6 import edu.wpi.first.wpilibj.CANTalon;
7 import edu.wpi.first.wpilibj.command.Subsystem;
8
9 public class DefenseArm extends Subsystem {
10 // Defense arm related objects
11 public AnalogPotentiometer defenseArmPotentiometer;
12 public AnalogPotentiometer defenseHandPotentiometer;
13 public CANTalon defenseArmMotor;
14 public CANTalon defenseHandMotor;
15 public double hookHeight;
16 public double footHeight;
17
18 // Defense arm specific constants that relate to the degrees per pulse value
19 // for the potentiometers
20 // private final static double PULSES_PER_ROTATION = 1; // in pulses
21 public final static double FULL_RANGE = 270.0; // in degrees
22 public final static double OFFSET = -135.0; // in degrees
23 public final static double[] armPotValue = { 0.0, 45.0, 90.0 }; // 3 level
24
25 // array;
26
27 // do we want to use a hashmap??
28 // angles at 0,45,90 (Potentiometer value readings)
29 // degrees
30
31 public DefenseArm() {
32 defenseArmPotentiometer = new AnalogPotentiometer(
33 Constants.DefenseArm.ARM_CHANNEL,
34 FULL_RANGE, OFFSET);
35 defenseArmMotor = new CANTalon(Constants.DefenseArm.ARM_PORT);
36 defenseHandMotor = new CANTalon(Constants.DefenseArm.HAND_PORT);
37 }
38
39 /***
40 * This method gets the height of the hook from the ground. The hook is
41 * attached to the end of the hand, which is attached to the arm.
42 *
43 * @return hookHeight gets height of hook from ground. The hook is attached to
44 * the end of the hand, which is attached the arm. The height is in
45 * inches.
46 *
47 */
48
49 public double getHookHeight() {
50
51 return hookHeight;
52 }
53
54 /***
55 * This method gets the height of the foot from the ground. The foot is
56 * attached to the end of the hand, which is attached to the arm.
57 *
58 * @return footHeight gets height of foot from ground. The foot is attached to
59 * the end of the hand, which is attached the arm. The height is in
60 * inches.
61 *
62 */
63
64 public double getFootHeight() {
65
66 return footHeight;
67 }
68
69 @Override
70 protected void initDefaultCommand() {
71 }
72 }