Add constant arm length and command getArmHeight
authorShivani Oghanta <shivani.oghanta@gmail.com>
Sun, 7 Feb 2016 02:25:59 +0000 (18:25 -0800)
committerShivani Oghanta <shivani.oghanta@gmail.com>
Fri, 12 Feb 2016 04:31:31 +0000 (20:31 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/subsystems/IntakeArm.java

index ae5941b3e21d9892b3865f655d7f29c64b9c8988..216d816d57c721dfb2550ee433b72f088e0d2a6f 100644 (file)
@@ -77,7 +77,8 @@ public class Constants {
                public static final double OUTPUT_SPEED = -0.5;
                public final static double FULL_RANGE = 270.0; // in degrees
                public final static double OFFSET = -135.0; // in degrees
-               public final static double ZERO_ANGLE = 0;
+               public final static double ZERO_ANGLE = 180; // in degrees
+               public final static double ARM_LENGTH = 15; // in inches
        }
 
        public static class DefenseArm {
index 1314a544995ffc8b6370d80a9ae33d72c8ad3783..28dbb139910464e5c271387851ef91d18bf57670 100755 (executable)
@@ -123,7 +123,11 @@ public class IntakeArm extends Subsystem {
         * @return angle of potentiometer
         */
        public double getArmAngle() {
-               return intakePot.get();
+               return intakePot.get() + Constants.IntakeArm.ZERO_ANGLE;
+       }
+
+       public double getArmHeight() {
+               return Constants.IntakeArm.ARM_LENGTH * Math.sin(getArmAngle());
        }
 
        @Override