Use jinja2 expressions in constants.json
Signed-off-by: Maxwell Henderson <mxwhenderson@gmail.com>
Change-Id: Ic7ce223fdaa2c9578265366abf788d19a21ac5d3
diff --git a/y2024/constants/common.jinja2 b/y2024/constants/common.jinja2
new file mode 100644
index 0000000..b260074
--- /dev/null
+++ b/y2024/constants/common.jinja2
@@ -0,0 +1,16 @@
+{% set pi = 3.14159265 %}
+
+{# we do this here so we keep the encoder ratio in plaintext and also keep the math we're using. #}
+{% set intake_pivot_encoder_ratio = (16.0 / 64.0) * (18.0 / 62.0) %}
+
+{%set zeroing_sample_size = 200 %}
+
+{%
+set intake_pivot_zero = {
+ "average_filter_size": zeroing_sample_size,
+ "one_revolution_distance": pi * 2.0 * intake_pivot_encoder_ratio,
+ "zeroing_threshold": 0.0005,
+ "moving_buffer_size": 20,
+ "allowable_encoder_error": 0.9
+}
+%}