forked from FIRST-Tech-Challenge/FtcRobotController
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made a seperate auto called TwentyBlueRightTest which includes all th…
…e robot movements to move the robot from the beginning to the front of their respective backdrop april tags. Miles needs to add the pixel dropper code and vision code in here.
- Loading branch information
Showing
4 changed files
with
98 additions
and
7 deletions.
There are no files selected for viewing
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
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
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
71 changes: 71 additions & 0 deletions
71
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/TwentyBlueRightTest.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,71 @@ | ||
package org.firstinspires.ftc.teamcode.opmodes; | ||
|
||
import com.acmerobotics.dashboard.FtcDashboard; | ||
import com.acmerobotics.dashboard.telemetry.MultipleTelemetry; | ||
import com.qualcomm.robotcore.eventloop.opmode.Autonomous; | ||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; | ||
|
||
import org.firstinspires.ftc.robotcore.external.hardware.camera.CameraName; | ||
import org.firstinspires.ftc.teamcode.Var; | ||
import org.firstinspires.ftc.teamcode.configurations.RobotConfiguration; | ||
import org.firstinspires.ftc.teamcode.odo.DriveForwardPID; | ||
import org.firstinspires.ftc.teamcode.odo.TurnPID; | ||
|
||
@Autonomous | ||
public class TwentyBlueRightTest extends LinearOpMode{ | ||
private DriveForwardPID forwardPID; | ||
private TurnPID turnPID; | ||
private RobotConfiguration robot; | ||
|
||
@Override | ||
public void runOpMode() throws InterruptedException { | ||
RobotConfiguration robot = RobotConfiguration.currentConfiguration().invoke(hardwareMap); | ||
robot.clearEncoders(); | ||
DriveForwardPID drivePID = new DriveForwardPID(robot); | ||
TurnPID turnPID = new TurnPID(robot); | ||
telemetry = new MultipleTelemetry(telemetry, FtcDashboard.getInstance().getTelemetry()); | ||
robot = RobotConfiguration.currentConfiguration().invoke(hardwareMap); | ||
waitForStart(); | ||
if (!opModeIsActive()) return; | ||
/*Left spike marker BlueRightAuto | ||
/drivePID.DriveReverse(21.0, telemetry); | ||
turnPID.TurnRobot(45.0, telemetry); | ||
drivePID.DriveReverse(3.0, telemetry); | ||
turnPID.TurnRobot(-45.0, telemetry); | ||
drivePID.strafeLeft(2, telemetry); | ||
drivePID.DriveReverse(25, telemetry); | ||
sleep(250); | ||
turnPID.TurnRobot(95, telemetry); | ||
drivePID.DriveReverse(80, telemetry); | ||
drivePID.strafeRight(27, telemetry);*/ | ||
|
||
/*Center spike marker BlueRightAuto | ||
drivePID.DriveReverse(27, telemetry); | ||
drivePID.strafeLeft(7, telemetry); | ||
drivePID.DriveReverse(24, telemetry); | ||
turnPID.TurnRobot(95, telemetry); | ||
drivePID.DriveReverse(87, telemetry); | ||
drivePID.strafeRight(22, telemetry);*/ | ||
|
||
//Right spike marker BlueRightAuto | ||
drivePID.DriveReverse(16.0, telemetry); | ||
turnPID.TurnRobot(-60.0, telemetry); | ||
turnPID.TurnRobot(60, telemetry); | ||
drivePID.strafeRight(4.5, telemetry); | ||
drivePID.DriveReverse(34, telemetry); | ||
sleep(250); | ||
turnPID.TurnRobot(90, telemetry); | ||
drivePID.DriveReverse(78, telemetry); | ||
drivePID.strafeRight(20.5, telemetry); | ||
|
||
while (opModeIsActive()) { | ||
telemetry.addData("LEFT ", drivePID.LeftOdoDist()); | ||
telemetry.addData("RIGHT", drivePID.RightOdoDist()); | ||
telemetry.update(); | ||
sleep(20); | ||
} | ||
|
||
|
||
|
||
} | ||
} |