Make ImuWatcher class for handling pico idiosyncracies
This provides a class to consistently handle the IMUValuesBatch coming
from the imu process on a pi.
Change-Id: Id2cdeb23fdd0a3e1c2bd01219678d957906112fa
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/frc971/imu_reader/BUILD b/frc971/imu_reader/BUILD
index 7d424c4..4825900 100644
--- a/frc971/imu_reader/BUILD
+++ b/frc971/imu_reader/BUILD
@@ -1,3 +1,6 @@
+load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
+load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
+
cc_library(
name = "imu",
srcs = [
@@ -14,8 +17,38 @@
"//aos/util:crc32",
"//frc971/wpilib:imu_batch_fbs",
"//frc971/wpilib:imu_fbs",
- "//y2022:constants",
"@com_github_google_glog//:glog",
"@com_google_absl//absl/types:span",
],
)
+
+flatbuffer_cc_library(
+ name = "imu_failures_fbs",
+ srcs = [
+ "imu_failures.fbs",
+ ],
+ visibility = ["//visibility:public"],
+)
+
+flatbuffer_ts_library(
+ name = "imu_failures_ts_fbs",
+ srcs = [
+ "imu_failures.fbs",
+ ],
+ visibility = ["//visibility:public"],
+)
+
+cc_library(
+ name = "imu_watcher",
+ srcs = ["imu_watcher.cc"],
+ hdrs = ["imu_watcher.h"],
+ visibility = ["//visibility:public"],
+ deps = [
+ ":imu_failures_fbs",
+ "//aos/events:event_loop",
+ "//frc971/control_loops/drivetrain:drivetrain_config",
+ "//frc971/wpilib:imu_batch_fbs",
+ "//frc971/zeroing:imu_zeroer",
+ "//frc971/zeroing:wrap",
+ ],
+)