Allow constructing control loops from flatbuffers
The core changes here are to:
* Allow constructing StateFeedbackLoop's from flatbuffers using the
code in *state_feedback_loop_converters.*
* Add constructors to the single-dof subsystem class to make use of
this.
* Add code to control_loops.py to generate JSON files with the requisite
constants (these end up containing identical information to the
generated .cc files).
* Add interfaces to actually support the new JSON codegen to single-dof
subsystem classes.
* Convert all of the drivetrains over to generating these. This I mostly
do so that I can write a test where Iconfirm that the .cc files and
the JSON files generate exactly the same content.
Change-Id: Iceac48f25ecac96200b7bf992c8f34a15fe6800c
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/y2024/control_loops/drivetrain/BUILD b/y2024/control_loops/drivetrain/BUILD
index e3c627a..0cca123 100644
--- a/y2024/control_loops/drivetrain/BUILD
+++ b/y2024/control_loops/drivetrain/BUILD
@@ -5,8 +5,10 @@
outs = [
"drivetrain_dog_motor_plant.h",
"drivetrain_dog_motor_plant.cc",
+ "drivetrain_dog_motor_plant.json",
"kalman_drivetrain_motor_plant.h",
"kalman_drivetrain_motor_plant.cc",
+ "kalman_drivetrain_motor_plant.json",
],
cmd = "$(location //y2024/control_loops/python:drivetrain) $(OUTS)",
target_compatible_with = ["@platforms//os:linux"],
@@ -20,10 +22,13 @@
outs = [
"polydrivetrain_dog_motor_plant.h",
"polydrivetrain_dog_motor_plant.cc",
+ "polydrivetrain_dog_motor_plant.json",
"polydrivetrain_cim_plant.h",
"polydrivetrain_cim_plant.cc",
+ "polydrivetrain_cim_plant.json",
"hybrid_velocity_drivetrain.h",
"hybrid_velocity_drivetrain.cc",
+ "hybrid_velocity_drivetrain.json",
],
cmd = "$(location //y2024/control_loops/python:polydrivetrain) $(OUTS)",
target_compatible_with = ["@platforms//os:linux"],