Move the swerve_drivetrain*.fbs files to frc971/control_loop/swerve
We had ended up with multiple folders, which was irritating.
Also, get rid of the speed fields of the position message until we can
do something with them.
Change-Id: I0eb48bfa8390e361e587f5b4c6c6fc122d730e16
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/frc971/control_loops/swerve/BUILD b/frc971/control_loops/swerve/BUILD
index e411fc9..4e06932 100644
--- a/frc971/control_loops/swerve/BUILD
+++ b/frc971/control_loops/swerve/BUILD
@@ -1,3 +1,19 @@
+load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
+
+static_flatbuffer(
+ name = "swerve_drivetrain_output_fbs",
+ srcs = ["swerve_drivetrain_output.fbs"],
+ visibility = ["//visibility:public"],
+ deps = ["//frc971/control_loops:can_talonfx_fbs"],
+)
+
+static_flatbuffer(
+ name = "swerve_drivetrain_position_fbs",
+ srcs = ["swerve_drivetrain_position.fbs"],
+ visibility = ["//visibility:public"],
+ deps = ["//frc971/control_loops:control_loops_fbs"],
+)
+
py_binary(
name = "simulation",
srcs = [
diff --git a/frc971/control_loops/swerve/swerve_drivetrain_output.fbs b/frc971/control_loops/swerve/swerve_drivetrain_output.fbs
new file mode 100644
index 0000000..43ba0ed
--- /dev/null
+++ b/frc971/control_loops/swerve/swerve_drivetrain_output.fbs
@@ -0,0 +1,16 @@
+namespace frc971.control_loops.drivetrain.swerve;
+
+table SwerveModuleOutput {
+ // Current in Amps.
+ rotation_current:double (id: 0);
+ translation_current:double (id: 1);
+}
+
+table Output {
+ front_left_output:SwerveModuleOutput (id: 0);
+ front_right_output:SwerveModuleOutput (id: 1);
+ back_left_output:SwerveModuleOutput (id: 2);
+ back_right_output:SwerveModuleOutput (id: 3);
+}
+
+root_type Output;
diff --git a/frc971/control_loops/swerve/swerve_drivetrain_position.fbs b/frc971/control_loops/swerve/swerve_drivetrain_position.fbs
new file mode 100644
index 0000000..bad8af1
--- /dev/null
+++ b/frc971/control_loops/swerve/swerve_drivetrain_position.fbs
@@ -0,0 +1,17 @@
+namespace frc971.control_loops.drivetrain.swerve;
+
+table SwerveModulePosition {
+ // Rotation in radians
+ rotation_encoder:double (id: 0);
+ // Translation in meters
+ translation_encoder:double (id: 1);
+}
+
+table Position {
+ front_left_position:SwerveModulePosition (id: 0);
+ front_right_position:SwerveModulePosition (id: 1);
+ back_left_position:SwerveModulePosition (id: 2);
+ back_right_position:SwerveModulePosition (id: 3);
+}
+
+root_type Position;