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/frc971/control_loops/python/polydrivetrain.py b/frc971/control_loops/python/polydrivetrain.py
index a45d738..c3d47a6 100644
--- a/frc971/control_loops/python/polydrivetrain.py
+++ b/frc971/control_loops/python/polydrivetrain.py
@@ -490,7 +490,8 @@
namespaces=namespaces,
scalar_type=scalar_type)
- dog_loop_writer.Write(drivetrain_files[0], drivetrain_files[1])
+ dog_loop_writer.Write(drivetrain_files[0], drivetrain_files[1],
+ drivetrain_files[2])
hybrid_loop_writer = control_loop.ControlLoopWriter(
"HybridVelocityDrivetrain", [
@@ -504,12 +505,12 @@
plant_type='StateFeedbackHybridPlant',
observer_type='HybridKalman')
- hybrid_loop_writer.Write(hybrid_files[0], hybrid_files[1])
+ hybrid_loop_writer.Write(hybrid_files[0], hybrid_files[1], hybrid_files[2])
cim_writer = control_loop.ControlLoopWriter("CIM", [CIM()],
scalar_type=scalar_type)
- cim_writer.Write(motor_files[0], motor_files[1])
+ cim_writer.Write(motor_files[0], motor_files[1], motor_files[2])
def PlotPolyDrivetrainMotions(drivetrain_params):