-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/Train' into Train
- Loading branch information
Showing
6 changed files
with
92 additions
and
19 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/drive/tuning/NickTeleOp.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.drive.tuning; | ||
|
||
import com.acmerobotics.dashboard.config.Config; | ||
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; | ||
import com.qualcomm.robotcore.eventloop.opmode.TeleOp; | ||
import com.qualcomm.robotcore.hardware.CRServo; | ||
import com.qualcomm.robotcore.hardware.DcMotor; | ||
import com.qualcomm.robotcore.hardware.DcMotorSimple; | ||
|
||
@Config | ||
@TeleOp | ||
public class NickTeleOp extends LinearOpMode { | ||
|
||
|
||
private DcMotor rightFrontMotor; | ||
private DcMotor leftBackMotor; | ||
private DcMotor rightBackMotor; | ||
private CRServo Grabber; | ||
private CRServo tail; | ||
|
||
@Override | ||
public void runOpMode() throws InterruptedException { | ||
|
||
DcMotor leftFrontMotor = hardwareMap.get(DcMotor.class, "left_front_left_dw"); | ||
rightFrontMotor = hardwareMap.get(DcMotor.class, "right_front"); | ||
leftBackMotor = hardwareMap.get(DcMotor.class, "left_back"); | ||
rightBackMotor = hardwareMap.get(DcMotor.class, "right_back_right_dw"); | ||
Grabber = hardwareMap.get(CRServo.class, "Grabber"); | ||
tail = hardwareMap.get(CRServo.class, "servo"); | ||
|
||
|
||
waitForStart(); | ||
while (opModeIsActive()) { | ||
leftFrontMotor.setDirection(DcMotorSimple.Direction.REVERSE); | ||
leftBackMotor.setDirection(DcMotorSimple.Direction.REVERSE); | ||
double y = -gamepad1.left_stick_y; // Remember, Y stick is reversed! | ||
double x = gamepad1.left_stick_x; | ||
double rx = gamepad1.right_stick_x; | ||
|
||
leftFrontMotor.setPower(y + x + rx); | ||
leftBackMotor.setPower(y - x + rx); | ||
rightFrontMotor.setPower(y - x - rx); | ||
rightBackMotor.setPower(y + x - rx); | ||
|
||
if (gamepad1.left_bumper) { | ||
tail.setPower(1.0); | ||
} else if (gamepad1.right_bumper) { | ||
tail.setPower(-1.0); | ||
} else { | ||
tail.setPower(0.0); | ||
|
||
if (gamepad1.left_trigger > 0.5) { | ||
Grabber.setPower(1.0); | ||
} else if (gamepad1.right_trigger > 0.5) { | ||
Grabber.setPower(-1.0); | ||
} else { | ||
Grabber.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
4 changes: 4 additions & 0 deletions
4
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmode/NickAndTrumanTeleOp.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,4 @@ | ||
package org.firstinspires.ftc.teamcode.opmode; | ||
|
||
public class NickAndTrumanTeleOp { | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |