Search in sources :

Example 1 with JoshuaField

use of com.team2753.splines.field.JoshuaField in project Relic_Main by TeamOverdrive.

the class RED_CLOSE method runOpMode.

@Override
public void runOpMode() throws InterruptedException {
    RedClose_Paths.calculateRedClose(new JoshuaField());
    waitForStart("Red", true);
}
Also used : JoshuaField(com.team2753.splines.field.JoshuaField)

Example 2 with JoshuaField

use of com.team2753.splines.field.JoshuaField in project Relic_Main by TeamOverdrive.

the class BLUE_CLOSE method runOpMode.

@Override
public void runOpMode() throws InterruptedException {
    BlueClose_Paths.calculateBlueClose(new JoshuaField());
    Robot.init(this, true);
    telemetry.addData("Here", "");
    telemetry.update();
    waitForStart();
    this.SuperHitJewel(Jewel_Color.Red, Jewel_Color.Blue);
    Robot.getIntake().releaseIntake();
    Thread intake = new Thread(new Runnable() {

        @Override
        public void run() {
            sleep(200);
            while (!Thread.interrupted()) {
                Robot.getIntake().setLeftRightPower(1.0, 1.0);
                sleep(1500);
                Robot.getIntake().setLeftRightPower(-1.0, 1.0);
                sleep(200);
                Thread.yield();
            }
            sleep(400);
            Robot.getIntake().reverse();
        }
    });
    intake.start();
    BlueClose_Paths.pathFromBlueCloseToGlyphPit.goRight();
    new FollowPath(this, Robot.getDrive(), BlueClose_Paths.pathFromBlueCloseToGlyphPit, -1, -1);
    while (!Robot.getDrive().turnToAngle(-90) && !isStopRequested()) Thread.yield();
    new FollowPath(this, Robot.getDrive(), BlueClose_Paths.pathFromBlueCloseGlyphPitToLeftColumn, 1, 1);
    while (!Robot.getSlammer().setSlammerState(Slammer.SLAMMER_State.HOLDING) && !isStopRequested()) Thread.yield();
    intake.interrupt();
    while (!Robot.getSlammer().setSlammerState(Slammer.SLAMMER_State.SCORING) && !isStopRequested()) Thread.yield();
    sleep(1000);
    while (!Robot.getSlammer().setSlammerState(Slammer.SLAMMER_State.INTAKING) && !isStopRequested()) Thread.yield();
// Robot.getDrive().encoderDrive(0.3, -5, -5, 2);
}
Also used : JoshuaField(com.team2753.splines.field.JoshuaField) FollowPath(com.team2753.splines.FollowPath)

Example 3 with JoshuaField

use of com.team2753.splines.field.JoshuaField in project Relic_Main by TeamOverdrive.

the class RED_FAR method runOpMode.

@Override
public void runOpMode() throws InterruptedException {
    RedFar_Paths.calculateRedFar(new JoshuaField());
    waitForStart("Red", true);
    Robot.getDrive().zeroSensors();
    SuperHitJewel(jewel_Color, Jewel_Color.Red);
    RelicRecoveryVuMark useThisVuMark = RelicRecoveryVuMark.CENTER;
    switch(useThisVuMark) {
        case LEFT:
            Robot.getDrive().encoderDrive(0.4, 30, 30, 3);
            // Turn 90
            Robot.getDrive().turnCW(90, 0.3, 3);
            // Drive forward
            Robot.getDrive().encoderDrive(0.4, -18.8, -18.8, 3);
            // Turn 90
            Robot.getDrive().turnCCW(90, 0.3, 4);
            while (!Robot.getSlammer().setStopperState(Slammer.STOPPER_State.OPEN) && opModeIsActive()) Robot.getIntake().releaseIntake();
            sleep(40);
            new Thread(new Runnable() {

                @Override
                public void run() {
                    sleep(1000);
                    Robot.getSlammer().setStopperState(Slammer.STOPPER_State.CLOSED);
                }
            }).start();
            intakeThread.start();
            // From Column to pit
            new FollowPath(this, Robot.getDrive(), leftToGP, -1, 1);
            sleep(500);
            // Drive a little forward
            Robot.getDrive().encoderDrive(0.3, 0, (Constants.WHEEL_BASE * PI * 25) / 180, 3);
            Robot.getDrive().encoderDrive(0.8, 35, 35, 4);
            intakeThread.interrupt();
            while (!Robot.getSlammer().setSlammerState(Slammer.SLAMMER_State.SCORING) && opModeIsActive()) Thread.yield();
            sleep(2000);
            Robot.getDrive().encoderDrive(0.2, -4, -4, 2);
            while (opModeIsActive() && !Robot.getSlammer().setSlammerState(Slammer.SLAMMER_State.INTAKING)) idle();
            break;
        case CENTER:
            new FollowPath(this, Robot.getDrive(), bsToCenter, 1, 1);
            while (!Robot.getSlammer().setStopperState(Slammer.STOPPER_State.OPEN)) Robot.getIntake().releaseIntake();
            break;
        case RIGHT:
            new FollowPath(this, Robot.getDrive(), bsToRight, 1, 1);
            while (!Robot.getSlammer().setStopperState(Slammer.STOPPER_State.OPEN)) Robot.getIntake().releaseIntake();
            // sleep(1000);
            break;
        case UNKNOWN:
            break;
    }
}
Also used : JoshuaField(com.team2753.splines.field.JoshuaField) FollowPath(com.team2753.splines.FollowPath) RelicRecoveryVuMark(org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark)

Example 4 with JoshuaField

use of com.team2753.splines.field.JoshuaField in project Relic_Main by TeamOverdrive.

the class BLUE_FAR method runOpMode.

@Override
public void runOpMode() throws InterruptedException {
    BlueFar_Paths.calculateBlueFar(new JoshuaField());
    waitForStart("BlueCloseMTI", true);
}
Also used : JoshuaField(com.team2753.splines.field.JoshuaField)

Aggregations

JoshuaField (com.team2753.splines.field.JoshuaField)4 FollowPath (com.team2753.splines.FollowPath)2 RelicRecoveryVuMark (org.firstinspires.ftc.robotcore.external.navigation.RelicRecoveryVuMark)1