forked from FIRST-Tech-Challenge/FtcRobotController
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
41 lines (34 loc) · 1.48 KB
/
Main.java
File metadata and controls
41 lines (34 loc) · 1.48 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
package org.firstinspires.ftc.teamcode;
import com.acmerobotics.dashboard.FtcDashboard;
import com.acmerobotics.dashboard.config.Config;
import com.acmerobotics.dashboard.telemetry.TelemetryPacket;
import com.qualcomm.hardware.lynx.LynxModule;
import com.qualcomm.robotcore.hardware.HardwareMap;
import org.firstinspires.ftc.robotcore.external.Telemetry;
import java.util.List;
@Config
public class Main {
private FtcDashboard dashboard;
public void init (HardwareMap hMap) {
List<LynxModule> allHubs = hMap.getAll(LynxModule.class);
for (LynxModule hub : allHubs) {
hub.setBulkCachingMode(LynxModule.BulkCachingMode.AUTO);
}
dashboard = FtcDashboard.getInstance();
}
public void update (Telemetry telemetry) {
telemetry.addData("heading", Drivebase.robotStats[0]);
telemetry.addData("direction", Drivebase.robotStats[1]);
telemetry.addData("desiredHeading", Drivebase.desiredHeading);
telemetry.addData("fixedHeading", Drivebase.fixedHeading);
telemetry.addData("timesAcrossZero", Drivebase.timesAcrossZero);
telemetry.update();
TelemetryPacket packet = new TelemetryPacket();
packet.put("telemetry", telemetry);
packet.fieldOverlay()
.setFill("blue")
.fillRect((Kinematics.X-Kinematics.robotwidth),(Kinematics.Y-Kinematics.robotwidth),40,40)
.strokeCircle(100,100,5);
dashboard.sendTelemetryPacket(packet);
}
}