Make code run again on roborio
The code was still running some of the old queue stuff and getting
confused. Disable the old queue implementation stuff in initialization.
Change-Id: I3f4128c5fc71825845091cb52314b358bb9a182b
diff --git a/aos/BUILD b/aos/BUILD
index f6c6182..1afbcf8 100644
--- a/aos/BUILD
+++ b/aos/BUILD
@@ -6,8 +6,6 @@
srcs = [
"//aos:aos_dump",
"//aos:core",
- "//aos/logging:log_displayer",
- "//aos/logging:log_streamer",
"//aos/starter",
],
visibility = ["//visibility:public"],
@@ -17,7 +15,6 @@
name = "prime_start_binaries",
srcs = [
"//aos/events/logging:logger_main",
- "//aos/logging:binary_log_writer",
],
visibility = ["//visibility:public"],
)
@@ -27,8 +24,6 @@
srcs = [
# starter is hard coded to look for a non-stripped core...
"//aos:core",
- "//aos/logging:log_streamer.stripped",
- "//aos/logging:log_displayer.stripped",
"//aos:aos_dump.stripped",
"//aos/starter",
],
@@ -39,7 +34,6 @@
name = "prime_start_binaries_stripped",
srcs = [
"//aos/events/logging:logger_main.stripped",
- "//aos/logging:binary_log_writer.stripped",
],
visibility = ["//visibility:public"],
)
@@ -457,11 +451,11 @@
],
visibility = ["//visibility:public"],
deps = [
+ "//aos:macros",
"@com_github_google_flatbuffers//:flatbuffers",
"@com_github_google_glog//:glog",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
- "//aos:macros",
],
)
diff --git a/aos/init.cc b/aos/init.cc
index 957899c7..5d62868 100644
--- a/aos/init.cc
+++ b/aos/init.cc
@@ -58,25 +58,18 @@
google::InstallFailureSignalHandler();
}
-void InitNRT(bool for_realtime) {
+void InitNRT() {
InitStart();
- aos_core_create_shared_mem(false, for_realtime && ShouldBeRealtime());
- logging::RegisterQueueImplementation();
ExpandStackSize();
- AOS_LOG(INFO, "%s initialized non-realtime\n", program_invocation_short_name);
}
void InitCreate() {
InitStart();
- aos_core_create_shared_mem(true, false);
- logging::RegisterQueueImplementation();
AOS_LOG(INFO, "%s created shm\n", program_invocation_short_name);
}
void Init(int relative_priority) {
InitStart();
- aos_core_create_shared_mem(false, ShouldBeRealtime());
- logging::RegisterQueueImplementation();
GoRT(relative_priority);
}
diff --git a/aos/init.h b/aos/init.h
index 85d5da7..3ff56b8 100644
--- a/aos/init.h
+++ b/aos/init.h
@@ -5,6 +5,8 @@
namespace aos {
+// TODO(james): Clean up/unify the various init functions.
+
// Initializes glog and gflags.
void InitGoogle(int *argc, char ***argv);
@@ -13,8 +15,7 @@
// them again after fork(2)ing.
// Does the non-realtime parts of the initialization process.
-// If for_realtime is true, this sets up to call GoRT later.
-void InitNRT(bool for_realtime = false);
+void InitNRT();
// Initializes everything, including the realtime stuff.
// relative_priority adjusts the priority of this process relative to all of the
// other ones (positive for higher priority).
@@ -26,7 +27,7 @@
// exit gracefully).
void Cleanup();
-// Performs the realtime parts of initialization after InitNRT(true) has been called.
+// Performs the realtime parts of initialization after InitNRT() has been called.
void GoRT(int relative_priority = 0);
// Pins the current thread to CPU #number.
diff --git a/frc971/wpilib/wpilib_robot_base.h b/frc971/wpilib/wpilib_robot_base.h
index 978c48e..ea68306 100644
--- a/frc971/wpilib/wpilib_robot_base.h
+++ b/frc971/wpilib/wpilib_robot_base.h
@@ -50,7 +50,7 @@
class WPILibAdapterRobot : public frc::RobotBase {
public:
void StartCompetition() override {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
robot_.Run();
}
diff --git a/y2012/control_loops/accessories/accessories.cc b/y2012/control_loops/accessories/accessories.cc
index 726aede..86105e9 100644
--- a/y2012/control_loops/accessories/accessories.cc
+++ b/y2012/control_loops/accessories/accessories.cc
@@ -47,7 +47,7 @@
} // namespace y2012
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2012/control_loops/drivetrain/drivetrain_main.cc b/y2012/control_loops/drivetrain/drivetrain_main.cc
index 735f13f..ad55b26 100644
--- a/y2012/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2012/control_loops/drivetrain/drivetrain_main.cc
@@ -7,7 +7,7 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2012/joystick_reader.cc b/y2012/joystick_reader.cc
index 48e6eb5..4683b29 100644
--- a/y2012/joystick_reader.cc
+++ b/y2012/joystick_reader.cc
@@ -152,7 +152,7 @@
} // namespace y2012
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014/control_loops/claw/claw_main.cc b/y2014/control_loops/claw/claw_main.cc
index f21c7c5..6e8ff43 100644
--- a/y2014/control_loops/claw/claw_main.cc
+++ b/y2014/control_loops/claw/claw_main.cc
@@ -4,7 +4,7 @@
#include "aos/init.h"
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014/control_loops/drivetrain/drivetrain_main.cc b/y2014/control_loops/drivetrain/drivetrain_main.cc
index c210770..651757f 100644
--- a/y2014/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2014/control_loops/drivetrain/drivetrain_main.cc
@@ -7,7 +7,7 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014/control_loops/shooter/shooter_main.cc b/y2014/control_loops/shooter/shooter_main.cc
index 4161fdf..6f3b1f2 100644
--- a/y2014/control_loops/shooter/shooter_main.cc
+++ b/y2014/control_loops/shooter/shooter_main.cc
@@ -4,7 +4,7 @@
#include "aos/init.h"
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014/joystick_reader.cc b/y2014/joystick_reader.cc
index 6f94bfe..3f52c46 100644
--- a/y2014/joystick_reader.cc
+++ b/y2014/joystick_reader.cc
@@ -444,7 +444,7 @@
} // namespace y2014
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014_bot3/control_loops/drivetrain/drivetrain_main.cc b/y2014_bot3/control_loops/drivetrain/drivetrain_main.cc
index 05d09b3..0eb1bbe 100644
--- a/y2014_bot3/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2014_bot3/control_loops/drivetrain/drivetrain_main.cc
@@ -7,7 +7,7 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014_bot3/control_loops/rollers/rollers_main.cc b/y2014_bot3/control_loops/rollers/rollers_main.cc
index 906c067..443e18e 100644
--- a/y2014_bot3/control_loops/rollers/rollers_main.cc
+++ b/y2014_bot3/control_loops/rollers/rollers_main.cc
@@ -4,7 +4,7 @@
#include "aos/init.h"
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2014_bot3/joystick_reader.cc b/y2014_bot3/joystick_reader.cc
index 47546a7..1c06c8c 100644
--- a/y2014_bot3/joystick_reader.cc
+++ b/y2014_bot3/joystick_reader.cc
@@ -138,7 +138,7 @@
} // namespace y2014_bot3
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2016/control_loops/drivetrain/drivetrain_main.cc b/y2016/control_loops/drivetrain/drivetrain_main.cc
index b4fd9d8..ce65e0c 100644
--- a/y2016/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2016/control_loops/drivetrain/drivetrain_main.cc
@@ -7,7 +7,7 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2016/control_loops/shooter/shooter_main.cc b/y2016/control_loops/shooter/shooter_main.cc
index 6e46114..3545985 100644
--- a/y2016/control_loops/shooter/shooter_main.cc
+++ b/y2016/control_loops/shooter/shooter_main.cc
@@ -4,7 +4,7 @@
#include "aos/init.h"
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2016/control_loops/superstructure/superstructure_main.cc b/y2016/control_loops/superstructure/superstructure_main.cc
index abe2ec9..108a5a8 100644
--- a/y2016/control_loops/superstructure/superstructure_main.cc
+++ b/y2016/control_loops/superstructure/superstructure_main.cc
@@ -4,7 +4,7 @@
#include "aos/init.h"
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2016/joystick_reader.cc b/y2016/joystick_reader.cc
index d1b5e78..fbb91a5 100644
--- a/y2016/joystick_reader.cc
+++ b/y2016/joystick_reader.cc
@@ -461,7 +461,7 @@
} // namespace y2016
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2017/control_loops/drivetrain/drivetrain_main.cc b/y2017/control_loops/drivetrain/drivetrain_main.cc
index c9da772..f604479 100644
--- a/y2017/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2017/control_loops/drivetrain/drivetrain_main.cc
@@ -7,7 +7,7 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2017/control_loops/superstructure/superstructure_main.cc b/y2017/control_loops/superstructure/superstructure_main.cc
index eedba6f..6b43d15 100644
--- a/y2017/control_loops/superstructure/superstructure_main.cc
+++ b/y2017/control_loops/superstructure/superstructure_main.cc
@@ -4,7 +4,7 @@
#include "aos/init.h"
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2017/joystick_reader.cc b/y2017/joystick_reader.cc
index e42085a..c7f0666 100644
--- a/y2017/joystick_reader.cc
+++ b/y2017/joystick_reader.cc
@@ -321,7 +321,7 @@
} // namespace y2017
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2018/control_loops/drivetrain/drivetrain_main.cc b/y2018/control_loops/drivetrain/drivetrain_main.cc
index e5c68c5..c9fea5d 100644
--- a/y2018/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2018/control_loops/drivetrain/drivetrain_main.cc
@@ -7,7 +7,7 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2018/control_loops/superstructure/superstructure_main.cc b/y2018/control_loops/superstructure/superstructure_main.cc
index 3200ead..f072c68 100644
--- a/y2018/control_loops/superstructure/superstructure_main.cc
+++ b/y2018/control_loops/superstructure/superstructure_main.cc
@@ -4,7 +4,7 @@
#include "aos/init.h"
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2018/joystick_reader.cc b/y2018/joystick_reader.cc
index c9778b8..c8c5385 100644
--- a/y2018/joystick_reader.cc
+++ b/y2018/joystick_reader.cc
@@ -389,7 +389,7 @@
} // namespace y2018
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2019/control_loops/drivetrain/drivetrain_main.cc b/y2019/control_loops/drivetrain/drivetrain_main.cc
index 77df69b..cbc65e0 100644
--- a/y2019/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2019/control_loops/drivetrain/drivetrain_main.cc
@@ -8,7 +8,7 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2019/control_loops/superstructure/superstructure_main.cc b/y2019/control_loops/superstructure/superstructure_main.cc
index f831774..b98c249 100644
--- a/y2019/control_loops/superstructure/superstructure_main.cc
+++ b/y2019/control_loops/superstructure/superstructure_main.cc
@@ -4,7 +4,7 @@
#include "aos/init.h"
int main(int /*argc*/, char * /*argv*/ []) {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2019/joystick_reader.cc b/y2019/joystick_reader.cc
index 0f37112..59906c7 100644
--- a/y2019/joystick_reader.cc
+++ b/y2019/joystick_reader.cc
@@ -663,7 +663,7 @@
} // namespace y2019
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2020/control_loops/drivetrain/drivetrain_main.cc b/y2020/control_loops/drivetrain/drivetrain_main.cc
index 66b9cc7..04bd107 100644
--- a/y2020/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2020/control_loops/drivetrain/drivetrain_main.cc
@@ -6,7 +6,7 @@
using ::frc971::control_loops::drivetrain::DrivetrainLoop;
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2020/control_loops/superstructure/superstructure_main.cc b/y2020/control_loops/superstructure/superstructure_main.cc
index 101a0c7..aa74d56 100644
--- a/y2020/control_loops/superstructure/superstructure_main.cc
+++ b/y2020/control_loops/superstructure/superstructure_main.cc
@@ -4,7 +4,7 @@
#include "aos/init.h"
int main(int /*argc*/, char * /*argv*/ []) {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");
diff --git a/y2020/joystick_reader.cc b/y2020/joystick_reader.cc
index 105506e..06b8e40 100644
--- a/y2020/joystick_reader.cc
+++ b/y2020/joystick_reader.cc
@@ -65,7 +65,7 @@
} // namespace y2020
int main() {
- ::aos::InitNRT(true);
+ ::aos::InitNRT();
aos::FlatbufferDetachedBuffer<aos::Configuration> config =
aos::configuration::ReadConfig("config.json");