clocksync: The clock estimate should add the rtt time not subtract it

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-12-13 21:14:12 -05:00
parent add528532e
commit 8d62318c5f
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ class ClockSync:
pred_stddev = math.sqrt(self.prediction_variance) pred_stddev = math.sqrt(self.prediction_variance)
self.serial.set_clock_est(new_freq, self.time_avg + TRANSMIT_EXTRA, self.serial.set_clock_est(new_freq, self.time_avg + TRANSMIT_EXTRA,
int(self.clock_avg - 3. * pred_stddev)) int(self.clock_avg - 3. * pred_stddev))
self.clock_est = (self.time_avg - self.min_half_rtt, self.clock_est = (self.time_avg + self.min_half_rtt,
self.clock_avg, new_freq) self.clock_avg, new_freq)
#logging.debug("regr %.3f: freq=%.3f d=%d(%.3f)", #logging.debug("regr %.3f: freq=%.3f d=%d(%.3f)",
# sent_time, new_freq, clock - exp_clock, pred_stddev) # sent_time, new_freq, clock - exp_clock, pred_stddev)