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