forked from FIRST-Tech-Challenge/FtcRobotController
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
01/25/2022 Copies of autonomous for Shirley were made and adjusted fo…
…r use at League Meet FIRST-Tech-Challenge#3 at Mojave High School
- Loading branch information
1 parent
2b7c7af
commit bb3adeb
Showing
8 changed files
with
382 additions
and
4 deletions.
There are no files selected for viewing
132 changes: 132 additions & 0 deletions
132
...src/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Blue_Storage_Mojave.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
package org.firstinspires.ftc.teamcode.mojave; | ||
|
||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous; | ||
import com.qualcomm.robotcore.eventloop.opmode.Disabled; | ||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; | ||
import com.qualcomm.robotcore.hardware.CRServo; | ||
import com.qualcomm.robotcore.hardware.DcMotor; | ||
import com.qualcomm.robotcore.hardware.Servo; | ||
import com.qualcomm.robotcore.util.ElapsedTime; | ||
|
||
@Autonomous(name = "Shirley Blue Storage Unit Mojave") | ||
@SuppressWarnings({"unused"}) | ||
public class AUTO_Shirley_Blue_Storage_Mojave extends LinearOpMode | ||
{ | ||
private DcMotor frontDrive, backDrive, raiseClaw; | ||
private Servo rotateClaw, claw; | ||
private CRServo carousel; | ||
private ElapsedTime runtime = new ElapsedTime(); | ||
|
||
@Override | ||
public void runOpMode() throws InterruptedException | ||
{ | ||
frontDrive = hardwareMap.get(DcMotor.class, "frontDrive"); | ||
backDrive = hardwareMap.get(DcMotor.class, "backDrive"); | ||
raiseClaw = hardwareMap.get(DcMotor.class, "raiseClaw"); | ||
rotateClaw = hardwareMap.get(Servo.class, "rotateClaw"); | ||
claw = hardwareMap.get(Servo.class, "claw"); | ||
carousel = hardwareMap.get(CRServo.class, "carousel"); | ||
|
||
frontDrive.setDirection(DcMotor.Direction.REVERSE); | ||
backDrive.setDirection(DcMotor.Direction.FORWARD); | ||
raiseClaw.setDirection(DcMotor.Direction.FORWARD); | ||
|
||
telemetry.addData("Status", "Initialized"); | ||
telemetry.update(); | ||
|
||
//initialize claw | ||
rotateClaw.setPosition(0.75); | ||
claw.setPosition(1.0); | ||
|
||
waitForStart(); | ||
|
||
//move awy from wall | ||
frontDrive.setPower(0.5); | ||
backDrive.setPower(0.5); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 0.2) | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
|
||
while(opModeIsActive() && runtime.seconds() < 0.5) telemetry.update();//pause | ||
|
||
//turn towards storage unit | ||
frontDrive.setPower(0.5); | ||
backDrive.setPower(-0.5); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 0.2) | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
|
||
//line up with wall | ||
frontDrive.setPower(1.0); | ||
backDrive.setPower(1.0); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 0.8)//previously 1.7, 1.4 | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
|
||
while(opModeIsActive() && runtime.seconds() < 0.25) telemetry.update(); | ||
|
||
//angle to line up with carousel | ||
frontDrive.setPower(-0.25);//prev -0.5 | ||
backDrive.setPower(0.25);//prev 0.5 | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 0.7)//previously 0.95 | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
|
||
//drive back to meet carousel | ||
frontDrive.setPower(-0.5); | ||
backDrive.setPower(-0.5); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 2.6)//previously 2.6, 2.8 | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
|
||
//spin the carousel | ||
frontDrive.setPower(-0.1); | ||
//backDrive.setPower(-0.1); | ||
carousel.setPower(-1.0); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 10.00) | ||
{ | ||
telemetry.update(); | ||
} | ||
carousel.setPower(0.0); | ||
frontDrive.setPower(0.0); | ||
//backDrive.setPower(0.0); | ||
|
||
//drive "completely in" to storage unit | ||
frontDrive.setPower(1.0); | ||
backDrive.setPower(0.4);//prev 0.5 | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 0.75)//previously 0.6 | ||
{ | ||
telemetry.update(); | ||
} | ||
backDrive.setPower(1.0); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 0.4)//previously 0.5 | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
...c/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Blue_Warehouse_Mojave.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package org.firstinspires.ftc.teamcode.mojave; | ||
|
||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous; | ||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; | ||
import com.qualcomm.robotcore.hardware.CRServo; | ||
import com.qualcomm.robotcore.hardware.DcMotor; | ||
import com.qualcomm.robotcore.hardware.Servo; | ||
import com.qualcomm.robotcore.util.ElapsedTime; | ||
|
||
@Autonomous(name = "Shirley Blue Warehouse Mojave") | ||
@SuppressWarnings({"unused"}) | ||
public class AUTO_Shirley_Blue_Warehouse_Mojave extends LinearOpMode | ||
{ | ||
private DcMotor frontDrive, backDrive; | ||
private Servo rotateClaw, claw; | ||
private CRServo carousel; | ||
private ElapsedTime runtime = new ElapsedTime(); | ||
|
||
@Override | ||
public void runOpMode() throws InterruptedException | ||
{ | ||
frontDrive = hardwareMap.get(DcMotor.class, "frontDrive"); | ||
backDrive = hardwareMap.get(DcMotor.class, "backDrive"); | ||
rotateClaw = hardwareMap.get(Servo.class, "rotateClaw"); | ||
carousel = hardwareMap.get(CRServo.class, "carousel"); | ||
claw = hardwareMap.get(Servo.class, "claw"); | ||
|
||
frontDrive.setDirection(DcMotor.Direction.REVERSE); | ||
backDrive.setDirection(DcMotor.Direction.FORWARD); | ||
|
||
telemetry.addData("Status", "Initialized"); | ||
telemetry.update(); | ||
|
||
waitForStart(); | ||
|
||
//turn towards warehouse | ||
frontDrive.setPower(-1.0); | ||
backDrive.setPower(1.0); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 0.5)//prev 0.4 | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
|
||
//drive "completely in" to storage unit | ||
frontDrive.setPower(1.0); | ||
backDrive.setPower(1.0); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 1.6) | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
} | ||
} |
124 changes: 124 additions & 0 deletions
124
.../src/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Red_Storage_Mojave.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
package org.firstinspires.ftc.teamcode.mojave; | ||
|
||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous; | ||
import com.qualcomm.robotcore.eventloop.opmode.Disabled; | ||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; | ||
import com.qualcomm.robotcore.hardware.CRServo; | ||
import com.qualcomm.robotcore.hardware.DcMotor; | ||
import com.qualcomm.robotcore.hardware.Servo; | ||
import com.qualcomm.robotcore.util.ElapsedTime; | ||
|
||
@Autonomous(name = "Shirley Red Storage Unit Mojave") | ||
@SuppressWarnings({"unused"}) | ||
public class AUTO_Shirley_Red_Storage_Mojave extends LinearOpMode | ||
{ | ||
private DcMotor frontDrive, backDrive, raiseClaw; | ||
private Servo rotateClaw, claw; | ||
private CRServo carousel; | ||
private ElapsedTime runtime = new ElapsedTime(); | ||
|
||
@Override | ||
public void runOpMode() throws InterruptedException | ||
{ | ||
frontDrive = hardwareMap.get(DcMotor.class, "frontDrive"); | ||
backDrive = hardwareMap.get(DcMotor.class, "backDrive"); | ||
raiseClaw = hardwareMap.get(DcMotor.class, "raiseClaw"); | ||
rotateClaw = hardwareMap.get(Servo.class, "rotateClaw"); | ||
claw = hardwareMap.get(Servo.class, "claw"); | ||
carousel = hardwareMap.get(CRServo.class, "carousel"); | ||
|
||
frontDrive.setDirection(DcMotor.Direction.REVERSE); | ||
backDrive.setDirection(DcMotor.Direction.FORWARD); | ||
raiseClaw.setDirection(DcMotor.Direction.FORWARD); | ||
|
||
telemetry.addData("Status", "Initialized"); | ||
telemetry.update(); | ||
|
||
//initialize claw | ||
rotateClaw.setPosition(0.75); | ||
claw.setPosition(1.0); | ||
|
||
waitForStart(); | ||
|
||
//move awy from wall | ||
frontDrive.setPower(0.5); | ||
backDrive.setPower(0.5); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 0.2) | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
|
||
while(opModeIsActive() && runtime.seconds() < 0.5) telemetry.update();//pause | ||
|
||
//turn towards storage unit | ||
frontDrive.setPower(-0.5); | ||
backDrive.setPower(0.5); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 0.2) | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
|
||
//line up with wall | ||
frontDrive.setPower(1.0); | ||
backDrive.setPower(1.0); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 1.7)//previously 1.6,1.65 | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
|
||
//angle to line up with carousel | ||
frontDrive.setPower(0.5); | ||
backDrive.setPower(-0.5); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 0.7)//previously 0.55,0.6 | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
|
||
//drive back to meet carousel | ||
frontDrive.setPower(-0.5); | ||
backDrive.setPower(-0.5); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 2.6)//previously 1.3,1.7,2.0,2.3 | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
|
||
//spin the carousel | ||
//frontDrive.setPower(-0.1); | ||
backDrive.setPower(-0.1); | ||
carousel.setPower(1.0); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 10.00) | ||
{ | ||
telemetry.update(); | ||
} | ||
carousel.setPower(0.0); | ||
//frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
|
||
//drive "completely in" to storage unit | ||
frontDrive.setPower(1.0); | ||
backDrive.setPower(1.0); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 0.75)//previously 0.6 | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
...rc/main/java/org/firstinspires/ftc/teamcode/mojave/AUTO_Shirley_Red_Warehouse_Mojave.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package org.firstinspires.ftc.teamcode.mojave; | ||
|
||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous; | ||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; | ||
import com.qualcomm.robotcore.hardware.CRServo; | ||
import com.qualcomm.robotcore.hardware.DcMotor; | ||
import com.qualcomm.robotcore.hardware.Servo; | ||
import com.qualcomm.robotcore.util.ElapsedTime; | ||
|
||
@Autonomous(name = "Shirley Red Warehouse Mojave") | ||
@SuppressWarnings({"unused"}) | ||
public class AUTO_Shirley_Red_Warehouse_Mojave extends LinearOpMode | ||
{ | ||
private DcMotor frontDrive, backDrive; | ||
private Servo rotateClaw, claw; | ||
private CRServo carousel; | ||
private ElapsedTime runtime = new ElapsedTime(); | ||
|
||
@Override | ||
public void runOpMode() throws InterruptedException | ||
{ | ||
frontDrive = hardwareMap.get(DcMotor.class, "frontDrive"); | ||
backDrive = hardwareMap.get(DcMotor.class, "backDrive"); | ||
rotateClaw = hardwareMap.get(Servo.class, "rotateClaw"); | ||
claw = hardwareMap.get(Servo.class, "claw"); | ||
carousel = hardwareMap.get(CRServo.class, "carousel"); | ||
|
||
frontDrive.setDirection(DcMotor.Direction.REVERSE); | ||
backDrive.setDirection(DcMotor.Direction.FORWARD); | ||
|
||
telemetry.addData("Status", "Initialized"); | ||
telemetry.update(); | ||
|
||
//initialize claw | ||
rotateClaw.setPosition(0.75); | ||
claw.setPosition(1.0); | ||
|
||
waitForStart(); | ||
|
||
//turn towards warehouse | ||
frontDrive.setPower(1.0); | ||
backDrive.setPower(-1.0); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 0.4)//0.35 | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
|
||
//drive "completely in" to storage unit | ||
frontDrive.setPower(1.0); | ||
backDrive.setPower(1.0); | ||
runtime.reset(); | ||
while(opModeIsActive() && runtime.seconds() < 1.6) | ||
{ | ||
telemetry.update(); | ||
} | ||
frontDrive.setPower(0.0); | ||
backDrive.setPower(0.0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.