From 580051a33bc96e1e83300629e9c04817928d0851 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sun, 30 Aug 2020 18:52:03 -0700 Subject: [PATCH] calibrationd --- selfdrive/locationd/calibrationd.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/selfdrive/locationd/calibrationd.py b/selfdrive/locationd/calibrationd.py index a27e284a9c..b32bbedb30 100755 --- a/selfdrive/locationd/calibrationd.py +++ b/selfdrive/locationd/calibrationd.py @@ -156,7 +156,7 @@ def calibrationd_thread(sm=None, pm=None): send_counter = 0 while 1: - sm.update() + sm.update(wait_for="cameraOdometry") # if no inputs still publish calibration if not sm.updated['carState'] and not sm.updated['cameraOdometry']: @@ -165,9 +165,6 @@ def calibrationd_thread(sm=None, pm=None): if sm.updated['carState']: calibrator.handle_v_ego(sm['carState'].vEgo) - if send_counter % 25 == 0: - calibrator.send_data(pm) - send_counter += 1 if sm.updated['cameraOdometry']: new_vp = calibrator.handle_cam_odom(sm['cameraOdometry'].trans, @@ -175,6 +172,10 @@ def calibrationd_thread(sm=None, pm=None): sm['cameraOdometry'].transStd, sm['cameraOdometry'].rotStd) + if send_counter % 5 == 0: + calibrator.send_data(pm) + send_counter += 1 + if DEBUG and new_vp is not None: print('got new vp', new_vp)