Switch all robots over to use EventLoop
Stop using the old QueueGroup constructor for ControlLoop
Change-Id: I027febf86e75399a97cdb4dc50dbc475705e0393
diff --git a/y2019/control_loops/drivetrain/BUILD b/y2019/control_loops/drivetrain/BUILD
index 819c7f8..959e839 100644
--- a/y2019/control_loops/drivetrain/BUILD
+++ b/y2019/control_loops/drivetrain/BUILD
@@ -76,6 +76,7 @@
deps = [
":drivetrain_base",
"//aos:init",
+ "//aos/events:shm-event-loop",
"//frc971/control_loops/drivetrain:drivetrain_lib",
],
)
diff --git a/y2019/control_loops/drivetrain/drivetrain_main.cc b/y2019/control_loops/drivetrain/drivetrain_main.cc
index c872622..4e23987 100644
--- a/y2019/control_loops/drivetrain/drivetrain_main.cc
+++ b/y2019/control_loops/drivetrain/drivetrain_main.cc
@@ -1,5 +1,6 @@
#include "aos/init.h"
+#include "aos/events/shm-event-loop.h"
#include "frc971/control_loops/drivetrain/drivetrain.h"
#include "y2019/control_loops/drivetrain/drivetrain_base.h"
@@ -7,8 +8,9 @@
int main() {
::aos::Init();
+ ::aos::ShmEventLoop event_loop;
DrivetrainLoop drivetrain(
- ::y2019::control_loops::drivetrain::GetDrivetrainConfig());
+ ::y2019::control_loops::drivetrain::GetDrivetrainConfig(), &event_loop);
drivetrain.Run();
::aos::Cleanup();
return 0;
diff --git a/y2019/control_loops/superstructure/BUILD b/y2019/control_loops/superstructure/BUILD
index 79d851a..5d07e17 100644
--- a/y2019/control_loops/superstructure/BUILD
+++ b/y2019/control_loops/superstructure/BUILD
@@ -15,7 +15,7 @@
)
cc_library(
- name = 'superstructure_lib',
+ name = "superstructure_lib",
srcs = [
"superstructure.cc",
],
@@ -25,7 +25,7 @@
deps = [
":superstructure_queue",
"//aos/controls:control_loop",
- ]
+ ],
)
cc_binary(
@@ -36,5 +36,6 @@
deps = [
":superstructure_lib",
"//aos:init",
- ]
-)
\ No newline at end of file
+ "//aos/events:shm-event-loop",
+ ],
+)
diff --git a/y2019/control_loops/superstructure/superstructure.cc b/y2019/control_loops/superstructure/superstructure.cc
index 2f0832c..e87ef6e 100644
--- a/y2019/control_loops/superstructure/superstructure.cc
+++ b/y2019/control_loops/superstructure/superstructure.cc
@@ -7,10 +7,9 @@
namespace control_loops {
namespace superstructure {
-Superstructure::Superstructure(
- SuperstructureQueue *superstructure_queue)
- : aos::controls::ControlLoop<SuperstructureQueue>(
- superstructure_queue) {}
+Superstructure::Superstructure(::aos::EventLoop *event_loop,
+ const ::std::string &name)
+ : aos::controls::ControlLoop<SuperstructureQueue>(event_loop, name) {}
void Superstructure::RunIteration(
const SuperstructureQueue::Goal *unsafe_goal,
@@ -29,4 +28,4 @@
} // namespace superstructure
} // namespace control_loops
-} // namespace y2019
\ No newline at end of file
+} // namespace y2019
diff --git a/y2019/control_loops/superstructure/superstructure.h b/y2019/control_loops/superstructure/superstructure.h
index 1faa6b4..0d6765e 100644
--- a/y2019/control_loops/superstructure/superstructure.h
+++ b/y2019/control_loops/superstructure/superstructure.h
@@ -12,8 +12,9 @@
: public ::aos::controls::ControlLoop<SuperstructureQueue> {
public:
explicit Superstructure(
- SuperstructureQueue *my_superstructure =
- &superstructure_queue);
+ ::aos::EventLoop *event_loop,
+ const ::std::string &name =
+ ".y2019.control_loops.superstructure.superstructure_queue");
protected:
virtual void RunIteration(
@@ -31,4 +32,4 @@
} // namespace control_loops
} // namespace y2019
-#endif // Y2019_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_
\ No newline at end of file
+#endif // Y2019_CONTROL_LOOPS_SUPERSTRUCTURE_SUPERSTRUCTURE_H_
diff --git a/y2019/control_loops/superstructure/superstructure_main.cc b/y2019/control_loops/superstructure/superstructure_main.cc
index f3dd1ad..fe7be09 100644
--- a/y2019/control_loops/superstructure/superstructure_main.cc
+++ b/y2019/control_loops/superstructure/superstructure_main.cc
@@ -1,10 +1,13 @@
#include "y2019/control_loops/superstructure/superstructure.h"
+#include "aos/events/shm-event-loop.h"
#include "aos/init.h"
int main() {
::aos::Init();
- ::y2019::control_loops::superstructure::Superstructure superstructure;
+ ::aos::ShmEventLoop event_loop;
+ ::y2019::control_loops::superstructure::Superstructure superstructure(
+ &event_loop);
superstructure.Run();
::aos::Cleanup();
return 0;