Convert aos over to flatbuffers
Everything builds, and all the tests pass. I suspect that some entries
are missing from the config files, but those will be found pretty
quickly on startup.
There is no logging or live introspection of queue messages.
Change-Id: I496ee01ed68f202c7851bed7e8786cee30df29f5
diff --git a/frc971/queues/BUILD b/frc971/queues/BUILD
index 83ee252..e440638 100644
--- a/frc971/queues/BUILD
+++ b/frc971/queues/BUILD
@@ -1,10 +1,11 @@
-package(default_visibility = ['//visibility:public'])
+package(default_visibility = ["//visibility:public"])
-load('//aos/build:queues.bzl', 'queue_library')
+load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
-queue_library(
- name = 'gyro',
- srcs = [
- 'gyro.q',
- ],
+flatbuffer_cc_library(
+ name = "gyro",
+ srcs = [
+ "gyro.fbs",
+ ],
+ gen_reflections = 1,
)
diff --git a/frc971/queues/gyro.fbs b/frc971/queues/gyro.fbs
new file mode 100644
index 0000000..8a76678
--- /dev/null
+++ b/frc971/queues/gyro.fbs
@@ -0,0 +1,18 @@
+namespace frc971.sensors;
+
+// Published on "/drivetrain"
+table GyroReading {
+ // Positive is counter-clockwise (Austin says "it's Positive").
+ // Right-hand coordinate system around the Z-axis going up.
+ // The angle is measured in radians.
+ angle:double;
+ // The angular velocity in radians/sec
+ velocity:double;
+}
+
+// Published on "/drivetrain"
+table Uid {
+ uid:uint;
+}
+
+root_type GyroReading;
diff --git a/frc971/queues/gyro.q b/frc971/queues/gyro.q
deleted file mode 100644
index 0885738..0000000
--- a/frc971/queues/gyro.q
+++ /dev/null
@@ -1,16 +0,0 @@
-package frc971.sensors;
-
-// Published on ".frc971.sensors.gyro_reading"
-message GyroReading {
- // Positive is counter-clockwise (Austin says "it's Positive").
- // Right-hand coordinate system around the Z-axis going up.
- // The angle is measured in radians.
- double angle;
- // The angular velocity in radians/sec
- double velocity;
-};
-
-// Published on ".frc971.sensors.gyro_part_id"
-message Uid {
- uint32_t uid;
-};