torqued: fix cache loading (#29088)

* torqued: fix cache loading

* rm that
pull/29090/head
Adeeb Shihadeh 2 years ago committed by GitHub
parent 2e31d445c6
commit 4bac67c0f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      selfdrive/locationd/torqued.py

@ -139,8 +139,8 @@ class TorqueEstimator:
torque_cache = params.get("LiveTorqueParameters") torque_cache = params.get("LiveTorqueParameters")
if params_cache is not None and torque_cache is not None: if params_cache is not None and torque_cache is not None:
try: try:
with log.Event.from_bytes(torque_cache).liveTorqueParameters as log_evt: with log.Event.from_bytes(torque_cache) as log_evt:
cache_ltp = log_evt cache_ltp = log_evt.liveTorqueParameters
with car.CarParams.from_bytes(params_cache) as msg: with car.CarParams.from_bytes(params_cache) as msg:
cache_CP = msg cache_CP = msg
if self.get_restore_key(cache_CP, cache_ltp.version) == self.get_restore_key(CP, VERSION): if self.get_restore_key(cache_CP, cache_ltp.version) == self.get_restore_key(CP, VERSION):
@ -266,7 +266,6 @@ def main(sm=None, pm=None):
params = Params() params = Params()
with car.CarParams.from_bytes(params.get("CarParams", block=True)) as CP: with car.CarParams.from_bytes(params.get("CarParams", block=True)) as CP:
estimator = TorqueEstimator(CP) estimator = TorqueEstimator(CP)
estimator = TorqueEstimator(CP)
def cache_params(sig, frame): def cache_params(sig, frame):
signal.signal(sig, signal.SIG_DFL) signal.signal(sig, signal.SIG_DFL)

Loading…
Cancel
Save