-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFieldMeasurements.java
More file actions
37 lines (29 loc) · 1.13 KB
/
FieldMeasurements.java
File metadata and controls
37 lines (29 loc) · 1.13 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
package org.firstinspires.ftc.teamcode;
public class FieldMeasurements {
public static final double TILE_WIDTH = 610; //3728.44037 in encoder ticks //2.15 per two tiles
private static final int ticksPerRotation = 1440;
private static final int diameter = 100; //in mm
//2 feet = 609.6mm, length of tile
//diameter * 3.14 = C, 609.6mm*1440 ticks/C (mm) = ticks per tile
private static final double ticksPerTile = (609.6 * 1440) / (diameter * 3.14);
public static final long TIME_FOR_TILE = 1075; //in MS
private static final int STAGEONE_HEIGHT = 1000; //IN TICKS
private static final int STAGETWO_HEIGHT = 2000; //IN TICKS
private static final int STAGETHREE_HEIGHT = 3750;
private static final double circumfrence = 3.61;
public static int getStageHeight(int stage) {
if (stage == 1) {
return STAGEONE_HEIGHT;
}
if (stage == 2) {
return STAGETWO_HEIGHT;
}
if (stage == 3) {
return STAGETHREE_HEIGHT;
}
return -1;
}
public static int getTicksPerTile() {
return (int)ticksPerTile;
}
}