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/motors/BUILD b/motors/BUILD
index d7dc456..8fe5ff6 100644
--- a/motors/BUILD
+++ b/motors/BUILD
@@ -131,6 +131,7 @@
srcs = [
"simple_receiver.cc",
],
+ copts = ["-Wno-type-limits"],
restricted_to = mcu_cpus,
deps = [
":util",
@@ -153,6 +154,7 @@
srcs = [
"simpler_receiver.cc",
],
+ copts = ["-Wno-type-limits"],
restricted_to = mcu_cpus,
deps = [
":util",
diff --git a/motors/big/BUILD b/motors/big/BUILD
index 8ce81f1..062828f 100644
--- a/motors/big/BUILD
+++ b/motors/big/BUILD
@@ -36,6 +36,6 @@
"//motors:math",
"//motors:motor",
"//motors/peripheral:configuration",
- "//third_party/eigen",
+ "@org_tuxfamily_eigen//:eigen",
],
)
diff --git a/motors/fet12/BUILD b/motors/fet12/BUILD
index 673e1a7..5d25c41 100644
--- a/motors/fet12/BUILD
+++ b/motors/fet12/BUILD
@@ -76,7 +76,7 @@
"//motors:math",
"//motors:motor",
"//motors/peripheral:configuration",
- "//third_party/eigen",
+ "@org_tuxfamily_eigen//:eigen",
],
)
diff --git a/motors/pistol_grip/BUILD b/motors/pistol_grip/BUILD
index 1946c55..d00404e 100644
--- a/motors/pistol_grip/BUILD
+++ b/motors/pistol_grip/BUILD
@@ -102,6 +102,6 @@
"//motors:math",
"//motors:motor",
"//motors/peripheral:configuration",
- "//third_party/eigen",
+ "@org_tuxfamily_eigen//:eigen",
],
)
diff --git a/motors/simple_receiver.cc b/motors/simple_receiver.cc
index 0470c31..5f3af0a 100644
--- a/motors/simple_receiver.cc
+++ b/motors/simple_receiver.cc
@@ -22,11 +22,10 @@
namespace motors {
namespace {
-using ::frc971::control_loops::drivetrain::DrivetrainConfig;
-using ::frc971::control_loops::drivetrain::PolyDrivetrain;
using ::frc971::constants::ShifterHallEffect;
-using ::frc971::control_loops::DrivetrainQueue_Goal;
-using ::frc971::control_loops::DrivetrainQueue_Output;
+using ::frc971::control_loops::drivetrain::DrivetrainConfig;
+using ::frc971::control_loops::drivetrain::OutputT;
+using ::frc971::control_loops::drivetrain::PolyDrivetrain;
using ::motors::seems_reasonable::Spring;
namespace chrono = ::std::chrono;
@@ -547,20 +546,20 @@
(::std::abs(convert_input_width(4)) < 0.5f);
if (polydrivetrain != nullptr && spring != nullptr) {
- DrivetrainQueue_Goal goal;
- goal.control_loop_driving = false;
+ float throttle;
+ float wheel;
if (lost_drive_channel) {
- goal.throttle = 0.0f;
- goal.wheel = 0.0f;
+ throttle = 0.0f;
+ wheel = 0.0f;
} else {
- goal.throttle = convert_input_width(1);
- goal.wheel = -convert_input_width(0);
+ throttle = convert_input_width(1);
+ wheel = -convert_input_width(0);
}
- goal.quickturn = ::std::abs(polydrivetrain->velocity()) < 0.25f;
+ const bool quickturn = ::std::abs(polydrivetrain->velocity()) < 0.25f;
- DrivetrainQueue_Output output;
+ OutputT output;
- polydrivetrain->SetGoal(goal);
+ polydrivetrain->SetGoal(wheel, throttle, quickturn, false);
polydrivetrain->Update(12.0f);
polydrivetrain->SetOutput(&output);
diff --git a/motors/simpler_receiver.cc b/motors/simpler_receiver.cc
index 71d7e73..c3fcec9 100644
--- a/motors/simpler_receiver.cc
+++ b/motors/simpler_receiver.cc
@@ -20,11 +20,10 @@
namespace motors {
namespace {
-using ::frc971::control_loops::drivetrain::DrivetrainConfig;
-using ::frc971::control_loops::drivetrain::PolyDrivetrain;
using ::frc971::constants::ShifterHallEffect;
-using ::frc971::control_loops::DrivetrainQueue_Goal;
-using ::frc971::control_loops::DrivetrainQueue_Output;
+using ::frc971::control_loops::drivetrain::DrivetrainConfig;
+using ::frc971::control_loops::drivetrain::OutputT;
+using ::frc971::control_loops::drivetrain::PolyDrivetrain;
namespace chrono = ::std::chrono;
@@ -286,29 +285,29 @@
}
if (polydrivetrain != nullptr) {
- DrivetrainQueue_Goal goal;
- goal.control_loop_driving = false;
+ float throttle;
+ float wheel;
if (lost_drive_channel) {
- goal.throttle = 0.0f;
- goal.wheel = 0.0f;
+ throttle = 0.0f;
+ wheel = 0.0f;
} else {
- goal.throttle = convert_input_width(1);
- goal.wheel = -convert_input_width(3);
+ throttle = convert_input_width(1);
+ wheel = -convert_input_width(3);
}
- goal.quickturn = ::std::abs(polydrivetrain->velocity()) < 0.25f;
+ const bool quickturn = ::std::abs(polydrivetrain->velocity()) < 0.25f;
if (false) {
static int count = 0;
if (++count == 50) {
count = 0;
- printf("throttle: %d wheel: %d\n", (int)(goal.throttle * 100),
- (int)(goal.wheel * 100));
+ printf("throttle: %d wheel: %d\n", (int)(throttle * 100),
+ (int)(wheel * 100));
}
}
- DrivetrainQueue_Output output;
+ OutputT output;
- polydrivetrain->SetGoal(goal);
+ polydrivetrain->SetGoal(wheel, throttle, quickturn, false);
polydrivetrain->Update(12.0f);
polydrivetrain->SetOutput(&output);