sonar changes

This commit is contained in:
Adam Long 2016-10-14 00:19:05 +00:00
parent 5c4b376047
commit 4b5e70730a
2 changed files with 3 additions and 4 deletions

View File

@ -37,8 +37,7 @@ public class RobotMap {
public static double fWidth = 483.467261958;
public static double fHeight = 362.600446468;
public static int sonar = 2;
//public static int goalHeight = 102;
public static int goalHeight = 64;
public static int goalHeight = 85;
//Misc
public static int mainArmPresetCollect = -5;
public static int mainArmPresetTraverse = 10;

View File

@ -90,8 +90,8 @@ public class MainArm extends PIDSubsystem {
return false;
}
public double getShooterAngleError(){
double correctedHeight = (RobotMap.goalHeight + 26) - 44; //44 is the distance between the ground and the sonar
return (180/Math.PI) * Math.atan(correctedHeight/(getSonarDistance()-5));
double correctedHeight = (RobotMap.goalHeight + 24) - 44; //44 is the distance between the ground and the sonar
return (180/Math.PI) * Math.atan(correctedHeight/(getSonarDistance()-1));
}
public double getSonarDistanceRaw(){
return sonar.getVoltage();