public final static double FULL_RANGE = 270.0; // in degrees
public final static double OFFSET = -135.0; // in degrees
public final static double[] armPotValue = { 0.0, 45.0, 90.0 }; // 3 level
+ public final static double ARM_LENGTH = 0; // TODO: find actual length
+ public final static double HAND_LENGTH = 0; // TODO: find actual length
+ public final static double ARM_MOUNTED_HEIGHT = 0; // TODO: find actual
+ // height
}
public enum Defense {
private double hookHeight;
private double footHeight;
private double[] potAngles;
+
// angles corresponding to pre-determined heights we will need
public DefenseArm() {
defenseHand.set(speed);
}
+ public double getArmHorizontalDist() {
+ double arm = Constants.DefenseArm.ARM_LENGTH * Math.cos(getArmPotAngle());
+ double hand = Constants.DefenseArm.HAND_LENGTH
+ * Math.cos(getHandPotAngle());
+ return (arm + hand);
+ }
+
+ public double getArmHeight() {
+ double armMounted = Constants.DefenseArm.ARM_MOUNTED_HEIGHT;
+ double arm = Constants.DefenseArm.ARM_LENGTH * Math.sin(getArmPotAngle());
+ double hand = Constants.DefenseArm.HAND_LENGTH
+ * Math.sin(getHandPotAngle());
+ return (armMounted + arm + hand);
+ }
+
+ public boolean isOutsideRange() {
+ if (getArmHorizontalDist() < 15)
+ return false;
+ return true;
+ }
+
@Override
protected void initDefaultCommand() {
}