Skip to content

Commit 9540f5e

Browse files
authored
Merge pull request #12 from IrishRobotics/11-create-basic-op-mode-with-subsystems
11 create basic op mode with subsystems
2 parents 87989d7 + 0cdd8f3 commit 9540f5e

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

TeamCode/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ android {
2525

2626
dependencies {
2727
implementation project(':FtcRobotController')
28+
implementation 'org.ftclib.ftclib:core:2.1.1'
2829
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package org.firstinspires.ftc.teamcode;
2+
3+
import com.arcrobotics.ftclib.drivebase.MecanumDrive;
4+
import com.arcrobotics.ftclib.gamepad.GamepadEx;
5+
import com.arcrobotics.ftclib.hardware.motors.Motor;
6+
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
7+
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
8+
import com.qualcomm.robotcore.hardware.HardwareMap;
9+
10+
@TeleOp(name = "PrimaryOpMode", group= "NormalOpModes")
11+
public class PrimaryOpMode extends OpMode {
12+
private Motor fL, fR, bL, bR;
13+
private MecanumDrive drive;
14+
private GamepadEx driverOp;
15+
16+
@Override
17+
public void init() {
18+
fL = new Motor(hardwareMap, "frontLeftDrive");
19+
fR = new Motor(hardwareMap, "frontRightDrive");
20+
bL = new Motor(hardwareMap, "backLeftDrive");
21+
bR = new Motor(hardwareMap, "backRightDrive");
22+
23+
drive = new MecanumDrive(fL, fR, bL, bR);
24+
driverOp= new GamepadEx(gamepad1);
25+
}
26+
27+
@Override
28+
public void loop() {
29+
drive.driveRobotCentric(
30+
driverOp.getLeftX(),
31+
driverOp.getLeftY(),
32+
driverOp.getRightX()
33+
);
34+
}
35+
}

build.common.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ android {
5353
minSdkVersion 24
5454
//noinspection ExpiredTargetSdkVersion
5555
targetSdkVersion 28
56+
multiDexEnabled true
5657

5758
/**
5859
* We keep the versionCode and versionName of robot controller applications in sync with
@@ -89,14 +90,14 @@ android {
8990
signingConfig signingConfigs.release
9091

9192
ndk {
92-
abiFilters "armeabi-v7a", "arm64-v8a"
93+
abiFilters "armeabi-v7a"
9394
}
9495
}
9596
debug {
9697
debuggable true
9798
jniDebuggable true
9899
ndk {
99-
abiFilters "armeabi-v7a", "arm64-v8a"
100+
abiFilters "armeabi-v7a"
100101
}
101102
}
102103
}

0 commit comments

Comments
 (0)