Make y2020 multinode!
Update the configs. It all starts on a roboRIO, and forwards RobotState
between nodes. Need to finalize deployment for pi's.
Change-Id: I2601419a94ca154e9663c916e9b8987d73ffa814
diff --git a/aos/events/simulated_network_bridge.cc b/aos/events/simulated_network_bridge.cc
index 6b03b2f..1f56e46 100644
--- a/aos/events/simulated_network_bridge.cc
+++ b/aos/events/simulated_network_bridge.cc
@@ -32,8 +32,29 @@
// Kicks us to re-fetch and schedule the timer.
void Schedule() {
- if (fetcher_->context().data == nullptr || sent_) {
- sent_ = !fetcher_->FetchNext();
+ // Keep pulling messages out of the fetcher until we find one in the future.
+ while (true) {
+ if (fetcher_->context().data == nullptr || sent_) {
+ sent_ = !fetcher_->FetchNext();
+ }
+ if (sent_) {
+ break;
+ }
+ if (fetcher_->context().monotonic_event_time +
+ send_node_factory_->network_delay() +
+ send_node_factory_->send_delay() >
+ fetch_node_factory_->monotonic_now()) {
+ break;
+ }
+
+ // TODO(austin): Not cool. We want to actually forward these. This means
+ // we need a more sophisticated concept of what is running.
+ LOG(WARNING) << "Not forwarding message on "
+ << configuration::CleanedChannelToString(fetcher_->channel())
+ << " because we aren't running. Set at "
+ << fetcher_->context().monotonic_event_time << " now is "
+ << fetch_node_factory_->monotonic_now();
+ sent_ = true;
}
if (fetcher_->context().data == nullptr) {