diff --git a/selfdrive/locationd/helpers.py b/selfdrive/locationd/helpers.py index 53299c847f221d..93e29291394a74 100644 --- a/selfdrive/locationd/helpers.py +++ b/selfdrive/locationd/helpers.py @@ -2,7 +2,6 @@ from typing import List, Optional, Tuple, Any from cereal import log -from openpilot.common.params import put_nonblocking class NPQueue: @@ -63,8 +62,3 @@ def handle_log(self, t: int, which: str, msg: log.Event) -> None: def get_msg(self, valid: bool, with_points: bool) -> log.Event: raise NotImplementedError - - -def cache_points(param_name, estimator, valid): - msg = estimator.get_msg(valid=valid, with_points=True) - put_nonblocking(param_name, msg.to_bytes()) diff --git a/selfdrive/locationd/torqued.py b/selfdrive/locationd/torqued.py index fa37cbbcc4fe93..21a5ebca5fa6f5 100755 --- a/selfdrive/locationd/torqued.py +++ b/selfdrive/locationd/torqued.py @@ -9,7 +9,7 @@ from openpilot.common.filter_simple import FirstOrderFilter from openpilot.common.swaglog import cloudlog from openpilot.selfdrive.controls.lib.vehicle_model import ACCELERATION_DUE_TO_GRAVITY -from openpilot.selfdrive.locationd.helpers import PointBuckets, ParameterEstimator, cache_points +from openpilot.selfdrive.locationd.helpers import PointBuckets, ParameterEstimator HISTORY = 5 # secs POINTS_PER_BUCKET = 1500 @@ -238,8 +238,8 @@ def main(): # Cache points every 60 seconds while onroad if sm.frame % 240 == 0: - cache_points("LiveTorqueParameters", estimator, sm.all_checks()) - + msg = estimator.get_msg(valid=sm.all_checks(), with_points=True) + params.put_nonblocking("LiveTorqueParameters", msg.to_bytes()) if __name__ == "__main__": main()