delete second potentiometer for defense hand
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / DefenseArm.java
CommitLineData
ebd3530c
YN
1package org.usfirst.frc.team3501.robot.subsystems;\r
2\r
da11cb45
YN
3import org.usfirst.frc.team3501.robot.Constants;\r
4\r
3f5489cc 5import edu.wpi.first.wpilibj.AnalogPotentiometer;\r
3d825b61 6import edu.wpi.first.wpilibj.CANTalon;\r
ebd3530c
YN
7import edu.wpi.first.wpilibj.command.Subsystem;\r
8\r
5585bd31 9public class DefenseArm extends Subsystem {\r
3f5489cc 10 // Defense arm related objects\r
dae46a1d 11 public AnalogPotentiometer defenseArmPotentiometer;\r
1826a8dc 12 public AnalogPotentiometer defenseHandPotentiometer;\r
dae46a1d
YA
13 public CANTalon defenseArmMotor;\r
14 public CANTalon defenseHandMotor;\r
f661626f 15 public double hookHeight;\r
da11cb45 16\r
3f5489cc
YN
17 // Defense arm specific constants that relate to the degrees per pulse value\r
18 // for the potentiometers\r
dae46a1d 19 // private final static double PULSES_PER_ROTATION = 1; // in pulses\r
dc5aab20
YA
20 public final static double FULL_RANGE = 270.0; // in degrees\r
21 public final static double OFFSET = -135.0; // in degrees\r
22 public final static double[] armPotValue = { 0.0, 45.0, 90.0 }; // 3 level\r
f661626f 23\r
dc5aab20 24 // array;\r
8d2a8664 25\r
dc5aab20 26 // do we want to use a hashmap??\r
dae46a1d 27 // angles at 0,45,90 (Potentiometer value readings)\r
54b029e6 28 // degrees\r
da11cb45
YN
29\r
30 public DefenseArm() {\r
dae46a1d
YA
31 defenseArmPotentiometer = new AnalogPotentiometer(\r
32 Constants.DefenseArm.ARM_CHANNEL,\r
da11cb45 33 FULL_RANGE, OFFSET);\r
f661626f 34 Constants.DefenseArm.HAND_CHANNEL);\r
dae46a1d
YA
35 defenseArmMotor = new CANTalon(Constants.DefenseArm.ARM_PORT);\r
36 defenseHandMotor = new CANTalon(Constants.DefenseArm.HAND_PORT);\r
da11cb45 37 }\r
3f5489cc 38\r
f661626f
YA
39 /***\r
40 * This method gets the height of the hook from the ground. The hook is\r
41 * attached to the end of the hand, which is attached to the arm.\r
42 * \r
43 * @return hookHeight gets height of hook from ground. The hook is attached to\r
44 * the end of the hand, which is attached the arm.\r
45 * \r
46 */\r
47\r
48 public double getHookHeight() {\r
49 return hookHeight;\r
50 }\r
51\r
76273676
YN
52 @Override\r
53 protected void initDefaultCommand() {\r
54 }\r
ebd3530c 55}\r