2
0
mirror of https://github.com/team2059/Zaphod synced 2025-01-07 22:14:14 -05:00

Revert "Committed after first practice match. We now have a working Auto sequence 2"

This reverts commit 30dfdd0f22a7207baffade6f124fbeefc8bd58e6.
This commit is contained in:
Austen Adler 2014-03-13 18:24:42 -07:00
parent 232cb67950
commit bf44c95b23

View File

@ -80,19 +80,16 @@ public:
SmartDashboard::PutNumber("Throttle", throttle); SmartDashboard::PutNumber("Throttle", throttle);
SmartDashboard::PutNumber("upLimit", 120.0f); SmartDashboard::PutNumber("upLimit", 120.0f);
SmartDashboard::PutNumber("armPot", potToDegrees(armPot.GetAverageVoltage())); SmartDashboard::PutNumber("armPot", potToDegrees(armPot.GetAverageVoltage()));
SmartDashboard::PutNumber("Log Level", 1.0f); SmartDashboard::PutNumber("Log Level", 1);
//Ultrasonic //Ultrasonic
SmartDashboard::PutNumber("Wall Left", voltToDistance(WallSonicLeft.GetAverageVoltage(),true)); SmartDashboard::PutNumber("Wall Left", voltToDistance(WallSonicLeft.GetAverageVoltage(),true));
SmartDashboard::PutNumber("Wall Right", voltToDistance(WallSonicRight.GetAverageVoltage(),true)); SmartDashboard::PutNumber("Wall Right", voltToDistance(WallSonicRight.GetAverageVoltage(),true));
SmartDashboard::PutNumber("Ball Left", voltToDistance(BallSonicLeft.GetAverageVoltage())); SmartDashboard::PutNumber("Ball Left", voltToDistance(BallSonicLeft.GetAverageVoltage()));
SmartDashboard::PutNumber("Ball Right", voltToDistance(BallSonicRight.GetAverageVoltage())); SmartDashboard::PutNumber("Ball Right", voltToDistance(BallSonicRight.GetAverageVoltage()));
//Autonomous values //Autonomous values
SmartDashboard::PutNumber("Auto Distance",70.0f);
SmartDashboard::PutNumber("Collector Speed",1.0f);
SmartDashboard::PutNumber("AutoPower",0.455f); SmartDashboard::PutNumber("AutoPower",0.455f);
SmartDashboard::PutNumber("AutoCorrection",0.06f); SmartDashboard::PutNumber("AutoCorrection",0.06f);
SmartDashboard::PutNumber("Initial Drive Delay",2.0f); SmartDashboard::PutNumber("Inital Drive Timeout", 2.5f);
SmartDashboard::PutNumber("Inital Drive Timeout", 4.5f);
SmartDashboard::PutNumber("First Shot Start", 0.5f); SmartDashboard::PutNumber("First Shot Start", 0.5f);
SmartDashboard::PutNumber("First Shot Stop", 1.0f); SmartDashboard::PutNumber("First Shot Stop", 1.0f);
SmartDashboard::PutNumber("Reverse direction start",0.0f); SmartDashboard::PutNumber("Reverse direction start",0.0f);
@ -102,7 +99,7 @@ public:
SmartDashboard::PutNumber("Second Shot Start", 0.5f); SmartDashboard::PutNumber("Second Shot Start", 0.5f);
SmartDashboard::PutNumber("Second Shot Stop", 1.0f); SmartDashboard::PutNumber("Second Shot Stop", 1.0f);
SmartDashboard::PutNumber("Autonomous step",0.0f); SmartDashboard::PutNumber("Autonomous step",0.0f);
SmartDashboard::PutNumber("Autonomous sequence", 2.0f); SmartDashboard::PutNumber("Autonomous sequence", 0.0f);
//Shooter presets //Shooter presets
SmartDashboard::PutNumber("ShortRange",0.465f); //Power for the shooter when against the low goal SmartDashboard::PutNumber("ShortRange",0.465f); //Power for the shooter when against the low goal
SmartDashboard::PutNumber("ShooterButtonPower10",0.605f); SmartDashboard::PutNumber("ShooterButtonPower10",0.605f);
@ -274,7 +271,7 @@ public:
//Autonomous0{{{ //Autonomous0{{{
//Drive{{{ //Drive{{{
if(currentStep==0){ if(currentStep==0){
if(voltToDistance(WallSonicLeft.GetAverageVoltage(),true)>=SmartDashboard::GetNumber("Auto Distance")){ if(voltToDistance(WallSonicLeft.GetAverageVoltage(),true)>=40.0f){
driveRobot(-1.0f,correction); driveRobot(-1.0f,correction);
}else{ }else{
driveRobot(0.0f,0.0f); driveRobot(0.0f,0.0f);
@ -304,6 +301,7 @@ public:
//}}} //}}}
//Lower Shooter{{{ //Lower Shooter{{{
if(currentStep==2&&c>SmartDashboard::GetNumber("Reverse direction start")*200){ if(currentStep==2&&c>SmartDashboard::GetNumber("Reverse direction start")*200){
driveRobot(-1.0f,correction);
if(40.0f<=potToDegrees(armPot.GetAverageVoltage())){ if(40.0f<=potToDegrees(armPot.GetAverageVoltage())){
shootRobot(-0.3f); shootRobot(-0.3f);
}else{ }else{
@ -321,7 +319,7 @@ public:
//Autonomous1{{{ //Autonomous1{{{
//Drive{{{ //Drive{{{
if(currentStep==0){ if(currentStep==0){
if(voltToDistance(WallSonicLeft.GetAverageVoltage(),true)>=SmartDashboard::GetNumber("Auto Distance")){ if(voltToDistance(WallSonicLeft.GetAverageVoltage(),true)>=40.0f){
driveRobot(-1.0f,correction); driveRobot(-1.0f,correction);
}else{ }else{
driveRobot(0.0f,0.0f); driveRobot(0.0f,0.0f);
@ -367,7 +365,7 @@ public:
//}}} //}}}
//Drive{{{ //Drive{{{
if(currentStep==3&&c>SmartDashboard::GetNumber("Second Drive Start")*200){ if(currentStep==3&&c>SmartDashboard::GetNumber("Second Drive Start")*200){
if(voltToDistance(WallSonicLeft.GetAverageVoltage(),true)>=SmartDashboard::GetNumber("Auto Distance")){ if(voltToDistance(WallSonicLeft.GetAverageVoltage(),true)>=40.0f){
driveRobot(-1.0f,correction); driveRobot(-1.0f,correction);
}else{ }else{
driveRobot(0.0f,0.0f); driveRobot(0.0f,0.0f);
@ -399,15 +397,13 @@ public:
}else if(SmartDashboard::GetNumber("Autonomous sequence")==2){ }else if(SmartDashboard::GetNumber("Autonomous sequence")==2){
//Autonomous2{{{ //Autonomous2{{{
//Drive{{{ //Drive{{{
if(currentStep==0&&c>SmartDashboard::GetNumber("Initial Drive Delay")*200){ if(currentStep==0){
setMotorValue(6, 1, SmartDashboard::GetNumber("Collector Speed")); if(voltToDistance(WallSonicLeft.GetAverageVoltage(),true)>=40.0f){
if(voltToDistance(WallSonicLeft.GetAverageVoltage(),true)>=SmartDashboard::GetNumber("Auto Distance")){
driveRobot(-1.0f,correction); driveRobot(-1.0f,correction);
}else{ }else{
driveRobot(0.0f,0.0f); driveRobot(0.0f,0.0f);
} }
if(c==SmartDashboard::GetNumber("Inital Drive Timeout")*200){ if(c==SmartDashboard::GetNumber("Inital Drive Timeout")*200){
setMotorValue(6, 1, 0);
driveRobot(0.0f,0.0f); driveRobot(0.0f,0.0f);
currentStep++; currentStep++;
c=0; c=0;