From 805a86b0dd8bd7e7f0868175db7c8cafe39a16df Mon Sep 17 00:00:00 2001 From: HaraldSchafer Date: Tue, 15 Sep 2020 07:44:13 -0700 Subject: [PATCH] only do reset if already calibrated (#2176) old-commit-hash: 0b849d5a4e417d73e4b821b909839f379d70e75d --- selfdrive/locationd/calibrationd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/locationd/calibrationd.py b/selfdrive/locationd/calibrationd.py index db0bcec6c7..9cda80cfe8 100755 --- a/selfdrive/locationd/calibrationd.py +++ b/selfdrive/locationd/calibrationd.py @@ -113,7 +113,7 @@ class Calibrator(): # If spread is too high, assume mounting was changed and reset to last block. # Make the transition smooth. Abrupt transistion are not good foor feedback loop through supercombo model. - if max(self.calib_spread) > MAX_ALLOWED_SPREAD: + if max(self.calib_spread) > MAX_ALLOWED_SPREAD and self.cal_status == Calibration.CALIBRATED: self.reset(self.rpys[self.block_idx - 1], valid_blocks=INPUTS_NEEDED, smooth_from=self.rpy) write_this_cycle = (self.idx == 0) and (self.block_idx % (INPUTS_WANTED//5) == 5)