Add swerve flatbuffer files

Change-Id: I5af8e738f51e389c7d61354d728987de55c939ab
Signed-off-by: Yash Maheshwari <yashmahe2018@gmail.com>
diff --git a/frc971/control_loops/swerve/BUILD b/frc971/control_loops/swerve/BUILD
index ea6dd7c..3bd3453 100644
--- a/frc971/control_loops/swerve/BUILD
+++ b/frc971/control_loops/swerve/BUILD
@@ -1,5 +1,18 @@
 load("//aos/flatbuffers:generate.bzl", "static_flatbuffer")
 
+package(default_visibility = ["//visibility:public"])
+
+static_flatbuffer(
+    name = "swerve_drivetrain_goal_fbs",
+    srcs = ["swerve_drivetrain_goal.fbs"],
+)
+
+static_flatbuffer(
+    name = "swerve_drivetrain_status_fbs",
+    srcs = ["swerve_drivetrain_status.fbs"],
+    deps = ["//frc971/control_loops:profiled_subsystem_fbs"],
+)
+
 static_flatbuffer(
     name = "swerve_drivetrain_output_fbs",
     srcs = ["swerve_drivetrain_output.fbs"],
diff --git a/frc971/control_loops/swerve/swerve_drivetrain_goal.fbs b/frc971/control_loops/swerve/swerve_drivetrain_goal.fbs
new file mode 100644
index 0000000..eab0d0d
--- /dev/null
+++ b/frc971/control_loops/swerve/swerve_drivetrain_goal.fbs
@@ -0,0 +1,32 @@
+namespace frc971.control_loops.swerve;
+
+// States what translation control type goal we will care about
+// SPEED means we will control translation with speed (m/s)
+// CURRENT mean we will control translation with current (amps)
+enum TranslationControlTypeGoal : ubyte {
+  SPEED,
+  CURRENT,
+}
+
+// Takes in either current or speed
+// Uses current if both are given
+table SwerveModuleGoal {
+  // Angle in radians.
+  rotation_angle:double (id: 0);
+  // Tells us whether we use current
+  // or speed to control translation
+  translation_control_type_goal: TranslationControlTypeGoal (id: 1);
+  // Current in amps.
+  translation_current:double (id: 2);
+  // Speed in meters per second.
+  translation_speed:double (id: 3);
+}
+
+table Goal {
+    front_left_goal:SwerveModuleGoal (id: 0);
+    front_right_goal:SwerveModuleGoal (id: 1);
+    back_left_goal:SwerveModuleGoal (id: 2);
+    back_right_goal:SwerveModuleGoal (id: 3);
+}
+
+root_type Goal;
diff --git a/frc971/control_loops/swerve/swerve_drivetrain_status.fbs b/frc971/control_loops/swerve/swerve_drivetrain_status.fbs
new file mode 100644
index 0000000..dc50af5
--- /dev/null
+++ b/frc971/control_loops/swerve/swerve_drivetrain_status.fbs
@@ -0,0 +1,21 @@
+include "frc971/control_loops/profiled_subsystem.fbs";
+
+namespace frc971.control_loops.swerve;
+
+table SwerveModuleStatus {
+    // Goal speed in meters per second.
+    goal_translation_speed:double (id: 0);
+    // Absolute encoder for rotation
+    rotation:frc971.control_loops.AbsoluteEncoderProfiledJointStatus (id: 1);
+    // Translation speed in meters per second.
+    translation_speed:double (id: 2);
+}
+
+table Status {
+    front_left_status:SwerveModuleStatus (id: 0);
+    front_right_status:SwerveModuleStatus (id: 1);
+    back_left_status:SwerveModuleStatus (id: 2);
+    back_right_status:SwerveModuleStatus (id: 3);
+}
+
+root_type Status;