forked from FIRST-Tech-Challenge/FtcRobotController
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNextTeleOp.java
More file actions
52 lines (41 loc) · 1.87 KB
/
Copy pathNextTeleOp.java
File metadata and controls
52 lines (41 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DcMotorSimple;
import com.rowanmcalpin.nextftc.core.command.Command;
import com.rowanmcalpin.nextftc.ftc.NextFTCOpMode;
import com.rowanmcalpin.nextftc.ftc.driving.MecanumDriverControlled;
import com.rowanmcalpin.nextftc.ftc.hardware.controllables.MotorEx;
@TeleOp(name = "NextFTC TeleOp")
class NextTeleOp extends NextFTCOpMode {
/*public NextTeleOp() {
// Add in the subsystems when they are coded in
super(Claw.INSTANCE, Lift.INSTANCE);
}*/
// Setup the drivechain motors
public MotorEx frontLeftMotor;
public MotorEx frontRightMotor;
public MotorEx backLeftMotor;
public MotorEx backRightMotor;
public MotorEx[] motors;
public Command driverControlled;
@Override
public void onInit() {
frontLeftMotor = new MotorEx("frontLeft");
frontRightMotor = new MotorEx("frontRight");
backLeftMotor = new MotorEx("rearLeft");
backRightMotor = new MotorEx("rearRight");
// Change motor directions to suit robot
frontLeftMotor.setDirection(DcMotorSimple.Direction.REVERSE);
frontRightMotor.setDirection(DcMotorSimple.Direction.FORWARD);
backLeftMotor.setDirection(DcMotorSimple.Direction.REVERSE);
backRightMotor.setDirection(DcMotorSimple.Direction.FORWARD);
motors = new MotorEx[] {frontLeftMotor, frontRightMotor, backLeftMotor, backRightMotor};
}
@Override
public void onStartButtonPressed() {
driverControlled = new MecanumDriverControlled(motors, gamepadManager.getGamepad1());
driverControlled.invoke();
/*gamepadManager.getGamepad2().getDpadUp().setPressedCommand(Lift.INSTANCE::getToHigh);
gamepadManager.getGamepad2().getDpadDown().setPressedCommand(Lift.INSTANCE::getToLow);*/
}
}