Skip to content

Commit 1ef6e68

Browse files
committed
Merge remote-tracking branch 'origin/Train' into Train
2 parents 602f454 + f529b30 commit 1ef6e68

File tree

6 files changed

+92
-19
lines changed

6 files changed

+92
-19
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package org.firstinspires.ftc.teamcode.drive.tuning;
2+
3+
import com.acmerobotics.dashboard.config.Config;
4+
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
5+
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
6+
import com.qualcomm.robotcore.hardware.CRServo;
7+
import com.qualcomm.robotcore.hardware.DcMotor;
8+
import com.qualcomm.robotcore.hardware.DcMotorSimple;
9+
10+
@Config
11+
@TeleOp
12+
public class NickTeleOp extends LinearOpMode {
13+
14+
15+
private DcMotor rightFrontMotor;
16+
private DcMotor leftBackMotor;
17+
private DcMotor rightBackMotor;
18+
private CRServo Grabber;
19+
private CRServo tail;
20+
21+
@Override
22+
public void runOpMode() throws InterruptedException {
23+
24+
DcMotor leftFrontMotor = hardwareMap.get(DcMotor.class, "left_front_left_dw");
25+
rightFrontMotor = hardwareMap.get(DcMotor.class, "right_front");
26+
leftBackMotor = hardwareMap.get(DcMotor.class, "left_back");
27+
rightBackMotor = hardwareMap.get(DcMotor.class, "right_back_right_dw");
28+
Grabber = hardwareMap.get(CRServo.class, "Grabber");
29+
tail = hardwareMap.get(CRServo.class, "servo");
30+
31+
32+
waitForStart();
33+
while (opModeIsActive()) {
34+
leftFrontMotor.setDirection(DcMotorSimple.Direction.REVERSE);
35+
leftBackMotor.setDirection(DcMotorSimple.Direction.REVERSE);
36+
double y = -gamepad1.left_stick_y; // Remember, Y stick is reversed!
37+
double x = gamepad1.left_stick_x;
38+
double rx = gamepad1.right_stick_x;
39+
40+
leftFrontMotor.setPower(y + x + rx);
41+
leftBackMotor.setPower(y - x + rx);
42+
rightFrontMotor.setPower(y - x - rx);
43+
rightBackMotor.setPower(y + x - rx);
44+
45+
if (gamepad1.left_bumper) {
46+
tail.setPower(1.0);
47+
} else if (gamepad1.right_bumper) {
48+
tail.setPower(-1.0);
49+
} else {
50+
tail.setPower(0.0);
51+
52+
if (gamepad1.left_trigger > 0.5) {
53+
Grabber.setPower(1.0);
54+
} else if (gamepad1.right_trigger > 0.5) {
55+
Grabber.setPower(-1.0);
56+
} else {
57+
Grabber.setPower(0.0);
58+
}
59+
}
60+
}
61+
}
62+
}

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmode/LearningTeleOp.java

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,15 @@
1313
public class LearningTeleOp extends LinearOpMode {
1414

1515

16+
17+
18+
1619
private DcMotor leftFrontMotor;
1720
private DcMotor rightFrontMotor;
1821
private DcMotor leftBackMotor;
1922
private DcMotor rightBackMotor;
2023
private CRServo Grabber;
24+
private CRServo tail;
2125

2226
@Override
2327
public void runOpMode() throws InterruptedException {
@@ -27,6 +31,8 @@ public void runOpMode() throws InterruptedException {
2731
leftBackMotor = hardwareMap.get(DcMotor.class, "left_back");
2832
rightBackMotor = hardwareMap.get(DcMotor.class, "right_back_right_dw");
2933
Grabber = hardwareMap.get(CRServo.class, "Grabber");
34+
tail = hardwareMap.get(CRServo.class, "servo");
35+
3036

3137
waitForStart();
3238
while (opModeIsActive()) {
@@ -40,25 +46,23 @@ public void runOpMode() throws InterruptedException {
4046
leftBackMotor.setPower(y - x + rx);
4147
rightFrontMotor.setPower(y - x - rx);
4248
rightBackMotor.setPower(y + x - rx);
43-
if (gamepad1.a){
44-
leftBackMotor.setPower(2);
45-
rightBackMotor.setPower(2);
46-
leftFrontMotor.setPower(2);
47-
rightFrontMotor.setPower(2);}
4849

50+
if (gamepad1.left_bumper) {
51+
tail.setPower(1.0);
52+
} else if (gamepad1.right_bumper) {
53+
tail.setPower(-1.0);
54+
} else {
55+
tail.setPower(0.0);
4956

57+
if (gamepad1.left_trigger > 0.5) {
58+
Grabber.setPower(1.0);
59+
} else if (gamepad1.right_trigger > 0.5) {
60+
Grabber.setPower(-1.0);
61+
} else {
62+
Grabber.setPower(0.0);
5063

51-
if (gamepad1.left_bumper)
52-
Grabber.setPower(1);
53-
else if (gamepad1.right_bumper)
54-
Grabber.setPower(-1);
55-
else Grabber.setPower(0);
56-
//3 hours for 1 bracket... always remember to click code->reformat code
57-
58-
//TODO: Mess with servo in slot 2 in order to make the dog's arm rotate
59-
64+
}
65+
}
6066
}
61-
6267
}
63-
}
64-
68+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package org.firstinspires.ftc.teamcode.opmode;
2+
3+
public class NickAndTrumanTeleOp {
4+
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ buildscript {
1111
}
1212
dependencies {
1313
// Note for FTC Teams: Do not modify this yourself.
14-
classpath 'com.android.tools.build:gradle:7.2.0'
14+
classpath 'com.android.tools.build:gradle:8.6.1'
1515
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20'
1616
}
1717
}

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ org.gradle.caching=true
1111

1212
# Allow Gradle to use up to 1 GB of RAM
1313
org.gradle.jvmargs=-Xmx1024M
14+
android.defaults.buildfeatures.buildconfig=true
15+
android.nonTransitiveRClass=false
16+
android.nonFinalResIds=false
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)