run control loops and write their output on new sensor values
This also includes sending solenoid values from their own thread at 50Hz
(formerly I613f95a6efb5efe428029e4825ba6caeb34ea326).
Change-Id: I3d3021cdbbf2ddf895e5ceebd4db299b4743e124
diff --git a/frc971/input/sensor_receiver.cc b/frc971/input/sensor_receiver.cc
index 61accc0..f5b2047 100644
--- a/frc971/input/sensor_receiver.cc
+++ b/frc971/input/sensor_receiver.cc
@@ -198,6 +198,17 @@
}
}
+ // Only send them out (approximately) every 10ms because the loops are now
+ // clocked off of this.
+ static int i = 0;
+ ++i;
+ if (i < 5) {
+ LOG(DEBUG, "skipping\n");
+ return;
+ } else {
+ i = 0;
+ }
+
other_sensors.MakeWithBuilder()
.sonar_distance(sonar_translate(data->main.ultrasonic_pulse_length))
.Send();