Qt: show current calibration values (#20455)

* show current calibration

* read calibration from capnp

* use CalStatus

* cleanup calibrationd.py

* remove import capnp

* keep json writing,remove comment

* fix test error

* cleanup

* remove test_read_saved_params

* cleanup

* write out capnp

* restore test

* clean up

* get calibration from CalibrationParams

* cleanup

* update calibration when the description is visible

* cleanup

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
Dean Lee
2021-04-07 06:02:40 +08:00
committed by GitHub
parent 795b9ab35e
commit 57fe8488ac
4 changed files with 38 additions and 8 deletions
+2 -5
View File
@@ -80,7 +80,7 @@ class Calibrator():
rpy_init = list(msg.liveCalibration.rpyCalib)
valid_blocks = msg.liveCalibration.validBlocks
except (ValueError, capnp.lib.capnp.KjException):
# TODO: remove this when offroad can read capnp
# TODO: remove this after next release
calibration_params = json.loads(calibration_params)
rpy_init = calibration_params["calib_radians"]
valid_blocks = calibration_params['valid_blocks']
@@ -134,10 +134,7 @@ class Calibrator():
write_this_cycle = (self.idx == 0) and (self.block_idx % (INPUTS_WANTED//5) == 5)
if self.param_put and write_this_cycle:
# TODO: change to raw bytes when offroad can read capnp
cal_params = {"calib_radians": list(self.rpy),
"valid_blocks": int(self.valid_blocks)}
put_nonblocking("CalibrationParams", json.dumps(cal_params).encode('utf8'))
put_nonblocking("CalibrationParams", self.get_msg().to_bytes())
def handle_v_ego(self, v_ego):
self.v_ego = v_ego