Skip to content

Commit

Permalink
Merge pull request ftctechnh#68 from HarshiniSomisetty/master
Browse files Browse the repository at this point in the history
Changes to Ref
  • Loading branch information
JeremyYao committed Dec 27, 2017
2 parents fe29c5c + f846fa7 commit c0eef86
Showing 1 changed file with 31 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;

/**
* Created by Sahithi on 12/8/17.
* Created by Harshini on 12/8/17.
*/
@Autonomous(name = "FinalUniversalRef",group = "Auto")
public class FinalUniversalRef extends LinearOpMode
Expand All @@ -14,7 +14,7 @@ public void runOpMode()
{
newRobot = new NewRobotFinal(hardwareMap);
newRobot.initVuforia(hardwareMap);
sleep(300);
sleep(250);
char colorOfPlatform = newRobot.getColor(newRobot.getFloorColorSens());
telemetry.addData("color = ", colorOfPlatform);
telemetry.addData("Hue value", newRobot.getHueValue(newRobot.getFloorColorSens()));
Expand All @@ -27,25 +27,27 @@ public void runOpMode()
newRobot.openOrCloseDoor(true);
newRobot.moveWing(true);
newRobot.oldMoveLift(1);
sleep(500);
sleep(250);
char cipher = newRobot.getGlyphCipher();
char colorOfJewel = newRobot.getColor(newRobot.getrightWingColorSens());
char colorOfJewel = newRobot.getColor(newRobot.getleftWingColorSens());
telemetry.addData("jewel color = ", colorOfJewel);
telemetry.addData("Hue value", newRobot.getHueValue(newRobot.getrightWingColorSens()));
telemetry.addData("Hue value", newRobot.getHueValue(newRobot.getleftWingColorSens()));
telemetry.update();
switch (colorOfJewel)
{
case'r':
newRobot.driveStraight_In(8);
sleep(500);
//sleep(100);
newRobot.moveWing(false);
newRobot.driveStraight_In(-8);
newRobot.driveStraight_In(-8,.5);
sleep(100)
break;
case 'b':
newRobot.driveStraight_In(-8);
sleep(500);
//sleep(100);
newRobot.moveWing(false);
newRobot.driveStraight_In(8);
newRobot.driveStraight_In(8,.5);
sleep(100)
break;
default:
newRobot.moveWing(false);
Expand All @@ -56,29 +58,31 @@ public void runOpMode()
switch (newRobot.getGlyphCipher())
{
case 'l':
newRobot.driveStraight_In(22);
newRobot.driveStraight_In(5);
break;
case 'c':
newRobot.driveStraight_In(11.5f);
break;
case 'r':
newRobot.driveStraight_In(5);
newRobot.driveStraight_In(22);
break;
default:
newRobot.driveStraight_In(11.5f);
break;
}
newRobot.pivot_IMU(86, .25);
newRobot.pivot_IMU(80, .25);
newRobot.oldMoveLift(-1);
newRobot.openOrCloseDoor(false);
newRobot.driveStraight_In(16, .2);
newRobot.driveStraight_In(20);
newRobot.driveStraight_In(3,.2);
newRobot.driveStraight_In(-5,1);
newRobot.stopAllMotors();
break;
case 'r':
newRobot.openOrCloseDoor(true);
newRobot.moveWing(true);
newRobot.oldMoveLift(1);
sleep(500);
sleep(250);
cipher = newRobot.getGlyphCipher();
colorOfJewel = newRobot.getColor(newRobot.getrightWingColorSens());
telemetry.addData("jewel color = ", colorOfJewel);
Expand All @@ -88,16 +92,19 @@ public void runOpMode()
{
case 'r':
newRobot.driveStraight_In(-8);
sleep(500);
sleep(100);
newRobot.moveWing(false);
newRobot.driveStraight_In(8);
newRobot.driveStraight_In(8,.5);
sleep(100);
case 'b':
newRobot.driveStraight_In(8);
sleep(500);
sleep(100);
newRobot.moveWing(false);
newRobot.driveStraight_In(-8);
newRobot.driveStraight_In(-8,.5);
sleep(100);
break;
default:
newRobot.moveWing(false);
break;
}
telemetry.addData("Cipherr = ", cipher);
Expand All @@ -119,12 +126,16 @@ public void runOpMode()
newRobot.driveStraight_In(32);
break;
}
newRobot.pivot_IMU(-86, .25);
newRobot.pivot_IMU(-80, .25);
newRobot.oldMoveLift(-1);
newRobot.openOrCloseDoor(false);
newRobot.driveStraight_In(16,.2);
/*newRobot.driveStraight_In(16,.2);
newRobot.driveStraight_In(-5,1); */
newRobot.driveStraight_In(20);
newRobot.driveStraight_In(3,.2);
newRobot.driveStraight_In(-5,1);
newRobot.stopAllMotors();
break;
default:
newRobot.driveStraight_In(29, .4);
newRobot.openOrCloseDoor(true);
Expand Down

0 comments on commit c0eef86

Please sign in to comment.