Hide control_loop() inside ControlLoop better
control_loop() is a depenency we want to remove when we convert to
event loops. We want to only use the queue group to hold strings.
Change-Id: I3f444cd505ebb1e448f050e08f416e0901ce8afb
diff --git a/aos/controls/control_loop.h b/aos/controls/control_loop.h
index d52a5d1..335a1bb 100644
--- a/aos/controls/control_loop.h
+++ b/aos/controls/control_loop.h
@@ -63,14 +63,13 @@
}
// Constructs and sends a message on the output queue which sets everything to
- // a safe state (generally motors off). For some subclasses, this will be a
- // bit different (ie pistons).
- // The implementation here creates a new Output message, calls Zero() on it,
- // and then sends it.
- virtual void ZeroOutputs();
+ // a safe state. Default is to set everything to zero. Override Zero below
+ // to change that behavior.
+ void ZeroOutputs();
// Sets the output to zero.
- // Over-ride if a value of zero is not "off" for this subsystem.
+ // Override this if a value of zero (or false) is not "off" for this
+ // subsystem.
virtual void Zero(OutputType *output) { output->Zero(); }
// Runs the loop forever.
@@ -79,9 +78,6 @@
// Runs one cycle of the loop.
void Iterate() override;
- // Returns the name of the queue group.
- const char *name() { return control_loop_->name(); }
-
protected:
static void Quit(int /*signum*/) {
run_ = false;
@@ -101,9 +97,6 @@
OutputType *output,
StatusType *status) = 0;
- T *queue_group() { return control_loop_; }
- const T *queue_group() const { return control_loop_; }
-
private:
static constexpr ::std::chrono::milliseconds kStaleLogInterval =
::std::chrono::milliseconds(100);