Add initial shot table.
Also adjust the turret camera's mounting angle to match reality better
so the balls go in the middle of the goal.
Change-Id: Ifa0333fe5477002b7873f7cbfa0cf20c7b201d02
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/y2022/constants.cc b/y2022/constants.cc
index fb2c602..88b0e90 100644
--- a/y2022/constants.cc
+++ b/y2022/constants.cc
@@ -132,8 +132,15 @@
// Interpolation table for comp and practice robots
r.shot_interpolation_table = InterpolationTable<Values::ShotParams>({
- {1, {0.03, 18.0}},
- {10, {0.03, 18.0}},
+ {1, {0.1, 19.0}},
+ {1.9, {0.1, 19.0}}, // 1.7 in reality
+ {2.12, {0.15, 18.8}}, // 2.006 in reality
+ {2.9, {0.25, 19.2}}, // 2.92 in reality
+ {3.8, {0.30, 20.8}}, // 3.8 in reality
+ {4.9, {0.32, 22.8}}, // 4.97 in reality
+ {6.9, {0.40, 24.0}}, // 6.1 in reality
+ {7.9, {0.40, 25.0}}, // 6.5 in reality
+ {10, {0.40, 24.0}},
});
switch (team) {
diff --git a/y2022/vision/camera_definition.py b/y2022/vision/camera_definition.py
index 68549a4..219a41f 100644
--- a/y2022/vision/camera_definition.py
+++ b/y2022/vision/camera_definition.py
@@ -105,7 +105,7 @@
camera_yaw = 0.0
T = np.array([-7.0 * 0.0254, -3.0 * 0.0254, 34.0 * 0.0254])
elif pi_number == "pi3":
- camera_yaw = 180.0 * np.pi / 180.0
+ camera_yaw = 179.0 * np.pi / 180.0
T = np.array([-1.0 * 0.0254, 8.5 * 0.0254, 34.0 * 0.0254])
elif pi_number == "pi4":
camera_yaw = -90.0 * np.pi / 180.0
diff --git a/y2022/www/field_handler.ts b/y2022/www/field_handler.ts
index 63e73c7..bda6828 100644
--- a/y2022/www/field_handler.ts
+++ b/y2022/www/field_handler.ts
@@ -308,7 +308,11 @@
}
if (this.superstructureStatus) {
this.shotDistance.innerHTML = this.superstructureStatus.aimer() ?
- this.superstructureStatus.aimer().shotDistance().toFixed(2) :
+ (this.superstructureStatus.aimer().shotDistance() /
+ 0.0254).toFixed(2) +
+ 'in, ' +
+ this.superstructureStatus.aimer().shotDistance().toFixed(2) +
+ 'm' :
'NA';
this.fire.innerHTML = this.superstructureStatus.fire() ? 'true' : 'false';