Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/Train' into Train
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickT209 committed Oct 14, 2024
2 parents 602f454 + f529b30 commit 1ef6e68
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 19 deletions.
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);
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
public class LearningTeleOp extends LinearOpMode {





private DcMotor leftFrontMotor;
private DcMotor rightFrontMotor;
private DcMotor leftBackMotor;
private DcMotor rightBackMotor;
private CRServo Grabber;
private CRServo tail;

@Override
public void runOpMode() throws InterruptedException {
Expand All @@ -27,6 +31,8 @@ public void runOpMode() throws InterruptedException {
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()) {
Expand All @@ -40,25 +46,23 @@ public void runOpMode() throws InterruptedException {
leftBackMotor.setPower(y - x + rx);
rightFrontMotor.setPower(y - x - rx);
rightBackMotor.setPower(y + x - rx);
if (gamepad1.a){
leftBackMotor.setPower(2);
rightBackMotor.setPower(2);
leftFrontMotor.setPower(2);
rightFrontMotor.setPower(2);}

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);

if (gamepad1.left_bumper)
Grabber.setPower(1);
else if (gamepad1.right_bumper)
Grabber.setPower(-1);
else Grabber.setPower(0);
//3 hours for 1 bracket... always remember to click code->reformat code

//TODO: Mess with servo in slot 2 in order to make the dog's arm rotate

}
}
}

}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package org.firstinspires.ftc.teamcode.opmode;

public class NickAndTrumanTeleOp {
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
}
dependencies {
// Note for FTC Teams: Do not modify this yourself.
classpath 'com.android.tools.build:gradle:7.2.0'
classpath 'com.android.tools.build:gradle:8.6.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20'
}
}
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ org.gradle.caching=true

# Allow Gradle to use up to 1 GB of RAM
org.gradle.jvmargs=-Xmx1024M
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
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

0 comments on commit 1ef6e68

Please sign in to comment.