-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRobotController.java
More file actions
82 lines (65 loc) · 2.27 KB
/
Copy pathRobotController.java
File metadata and controls
82 lines (65 loc) · 2.27 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package org.firstinspires.ftc.teamcode;
import com.acmerobotics.dashboard.FtcDashboard;
import com.acmerobotics.dashboard.telemetry.MultipleTelemetry;
import com.arcrobotics.ftclib.command.CommandScheduler;
import com.arcrobotics.ftclib.gamepad.GamepadEx;
import com.qualcomm.robotcore.hardware.Gamepad;
import com.qualcomm.robotcore.hardware.HardwareMap;
import org.firstinspires.ftc.robotcore.external.Telemetry;
import org.firstinspires.ftc.teamcode.util.TeamColor;
import org.firstinspires.ftc.teamcode.util.opModes.OpModeType;
public class RobotController {
public final GamepadEx driverController;
public final GamepadEx actionController;
private final OpModeType opModeType;
private final HardwareMap hardwareMap;
private final MultipleTelemetry telemetry;
private final TeamColor teamColor;
public RobotController(OpModeType opModeType, HardwareMap hMap, Telemetry telemetry, Gamepad driverController, Gamepad actionController, TeamColor teamColor) {
this.opModeType = opModeType;
this.hardwareMap = hMap;
this.teamColor = teamColor;
this.telemetry = new MultipleTelemetry(telemetry, FtcDashboard.getInstance().getTelemetry());
this.driverController = new GamepadEx(driverController);
this.actionController = new GamepadEx(actionController);
FtcDashboard.getInstance().stopCameraStream();
}
public void init() {
CommandScheduler.getInstance().reset();
switch (this.opModeType) {
case TELE_OP: {
initTeleOpMode();
break;
}
case AUTO: {
initAutoOpMode();
break;
}
case DEBUG: {
initTestingOpMode();
break;
}
}
}
public void initTeleOpMode() {
initDriverButtons();
initActionButtons();
}
public void initAutoOpMode() {
}
public void initTestingOpMode() {
initTestingButtons();
}
public void initDriverButtons() {
}
public void initActionButtons() {
}
public void initTestingButtons() {
}
public TeamColor getTeamColor() {
return teamColor;
}
public MultipleTelemetry getTelemetry() {
return telemetry;
}
}