Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions FtcRobotController/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ android {
buildConfig = true
}

compileSdk 34
compileSdkVersion 30

compileOptions {
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
namespace = 'com.qualcomm.ftcrobotcontroller'
}
Expand Down
4 changes: 2 additions & 2 deletions FtcRobotController/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="57"
android:versionName="10.1.1">
android:versionCode="58"
android:versionName="10.2">

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package vcsc.teamcode.opmodes.tele;

import com.pedropathing.localization.Pose;
import com.qualcomm.robotcore.eventloop.opmode.Disabled;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;

import vcsc.core.util.GamepadButton;
Expand Down
88 changes: 62 additions & 26 deletions TeamCode/src/main/java/vcsc/teamcode/opmodes/tele/Outreach.java
Original file line number Diff line number Diff line change
@@ -1,40 +1,76 @@
package vcsc.teamcode.opmodes.tele;

//Drive-only opmode for outreach events, Undertow V1

import com.pedropathing.localization.Pose;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import vcsc.teamcode.opmodes.base.BaseOpMode;
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.DcMotorSimple;

import com.acmerobotics.dashboard.FtcDashboard;
import com.acmerobotics.dashboard.config.Config;

@Config
@TeleOp(name = "OutreachTele", group = "Outreach")
public class Outreach extends OpMode {

private DcMotor frontLeft, frontRight, backLeft, backRight;

@TeleOp(name = "OutreachTele", group = "Main")
public class Outreach extends BaseOpMode {
final double DEFAULT_TURN_SPEED = 0.5;
final double DEFAULT_DRIVE_SPEED = 1;
double driveSpeed = DEFAULT_DRIVE_SPEED;
double turnSpeed = DEFAULT_TURN_SPEED;
public static double driveSpeed = 0.50; // we can change this via dash

@Override
public void init() {
super.init();
follower.setStartingPose(new Pose(0, 0, 0));
}
telemetry.addLine("Hello user, thank you for taking the time to try our robot!");
telemetry.addLine("Use the left stick to move the bot (forward/backward/move sideways).");
telemetry.addLine("Use the right stick to rotate the bot.");
telemetry.addLine("Robot is initializing...");
telemetry.addLine("");
telemetry.update();

// Init those REV motors
frontLeft = hardwareMap.get(DcMotor.class, "frontLeft");
frontRight = hardwareMap.get(DcMotor.class, "frontRight");
backLeft = hardwareMap.get(DcMotor.class, "backLeft");
backRight = hardwareMap.get(DcMotor.class, "backRight");

// Set motor directions for now
frontLeft.setDirection(DcMotorSimple.Direction.REVERSE);
backLeft.setDirection(DcMotorSimple.Direction.REVERSE);
frontRight.setDirection(DcMotorSimple.Direction.FORWARD);
backRight.setDirection(DcMotorSimple.Direction.FORWARD);

telemetry.addLine("✅ Initialization complete! Click start to begin driving.");
telemetry.update();

@Override
public void start() {
super.start();
}

@Override
public void loop() {
super.loop();

follower.setTeleOpMovementVectors(-gamepad1.left_stick_y * driveSpeed, -gamepad1.left_stick_x * driveSpeed, -gamepad1.right_stick_x * turnSpeed, true);
// drive.setDrivePowers(new PoseVelocity2d(
// new Vector2d(
// -gamepad1.left_stick_y * driveSpeed,
// -gamepad1.left_stick_x * driveSpeed
// ),
// -gamepad1.right_stick_x * turnSpeed
// ));
double y = gamepad1.left_stick_y * driveSpeed; // forward/backward
double x = -gamepad1.left_stick_x * driveSpeed; // strafe
double rx = -gamepad1.right_stick_x * driveSpeed; // rotate

// Calculate Mecanum Drive values for existance
double fl = y + x + rx;
double bl = y - x + rx;
double fr = y - x - rx;
double br = y + x - rx;

double max = Math.max(Math.abs(fl), Math.max(Math.abs(bl), Math.max(Math.abs(fr), Math.abs(br))));
if (max > 1.0) {
fl /= max;
bl /= max;
fr /= max;
br /= max;
}

frontLeft.setPower(fl);
backLeft.setPower(bl);
frontRight.setPower(fr);
backRight.setPower(br);

telemetry.addLine("Hello user, thank you for taking the time to try our robot!");
telemetry.addLine("Use the left stick to move the bot (forward/backward/move sideways).");
telemetry.addLine("Use the right stick to rotate the bot.");
telemetry.addData("Your speed for safety is limited to", "%.0f%%", driveSpeed * 100);
telemetry.update();
}
}
16 changes: 8 additions & 8 deletions build.dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ repositories {
}

dependencies {
implementation 'org.firstinspires.ftc:Inspection:10.1.1'
implementation 'org.firstinspires.ftc:Blocks:10.1.1'
implementation 'org.firstinspires.ftc:RobotCore:10.1.1'
implementation 'org.firstinspires.ftc:RobotServer:10.1.1'
implementation 'org.firstinspires.ftc:OnBotJava:10.1.1'
implementation 'org.firstinspires.ftc:Hardware:10.1.1'
implementation 'org.firstinspires.ftc:FtcCommon:10.1.1'
implementation 'org.firstinspires.ftc:Vision:10.1.1'
implementation 'org.firstinspires.ftc:Inspection:10.2.0'
implementation 'org.firstinspires.ftc:Blocks:10.2.0'
implementation 'org.firstinspires.ftc:RobotCore:10.2.0'
implementation 'org.firstinspires.ftc:RobotServer:10.2.0'
implementation 'org.firstinspires.ftc:OnBotJava:10.2.0'
implementation 'org.firstinspires.ftc:Hardware:10.2.0'
implementation 'org.firstinspires.ftc:FtcCommon:10.2.0'
implementation 'org.firstinspires.ftc:Vision:10.2.0'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.pedropathing:pedro:1.0.8'
implementation 'com.acmerobotics.dashboard:dashboard:0.4.16'
Expand Down