clocksync: Don't filter any of the initial syncronization clock messages

Add a 50ms delay from the initial clock measurement to the first
get_clock query.  Disable the prediction_variance filter on each
get_clock query so that none of those measurements are ignored.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-05-02 11:08:02 -04:00
parent 07e8011f51
commit f4429a54a9
1 changed files with 2 additions and 1 deletions

View File

@ -39,9 +39,10 @@ class ClockSync:
self.prediction_variance = (.001 * self.mcu_freq)**2 self.prediction_variance = (.001 * self.mcu_freq)**2
# Enable periodic get_clock timer # Enable periodic get_clock timer
for i in range(8): for i in range(8):
self.reactor.pause(self.reactor.monotonic() + 0.050)
self.last_prediction_time = -9999.
params = serial.send_with_response('get_clock', 'clock') params = serial.send_with_response('get_clock', 'clock')
self._handle_clock(params) self._handle_clock(params)
self.reactor.pause(self.reactor.monotonic() + 0.050)
self.get_clock_cmd = serial.get_msgparser().create_command('get_clock') self.get_clock_cmd = serial.get_msgparser().create_command('get_clock')
self.cmd_queue = serial.alloc_command_queue() self.cmd_queue = serial.alloc_command_queue()
serial.register_response(self._handle_clock, 'clock') serial.register_response(self._handle_clock, 'clock')