fix put_nonblocking reference

pull/30722/head
Adeeb Shihadeh 1 year ago
parent b53b505d2e
commit bd8a99ba28
  1. 6
      selfdrive/locationd/helpers.py
  2. 6
      selfdrive/locationd/torqued.py

@ -2,7 +2,6 @@ import numpy as np
from typing import List, Optional, Tuple, Any from typing import List, Optional, Tuple, Any
from cereal import log from cereal import log
from openpilot.common.params import put_nonblocking
class NPQueue: class NPQueue:
@ -63,8 +62,3 @@ class ParameterEstimator:
def get_msg(self, valid: bool, with_points: bool) -> log.Event: def get_msg(self, valid: bool, with_points: bool) -> log.Event:
raise NotImplementedError 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())

@ -9,7 +9,7 @@ from openpilot.common.realtime import config_realtime_process, DT_MDL
from openpilot.common.filter_simple import FirstOrderFilter from openpilot.common.filter_simple import FirstOrderFilter
from openpilot.common.swaglog import cloudlog from openpilot.common.swaglog import cloudlog
from openpilot.selfdrive.controls.lib.vehicle_model import ACCELERATION_DUE_TO_GRAVITY 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 HISTORY = 5 # secs
POINTS_PER_BUCKET = 1500 POINTS_PER_BUCKET = 1500
@ -238,8 +238,8 @@ def main():
# Cache points every 60 seconds while onroad # Cache points every 60 seconds while onroad
if sm.frame % 240 == 0: 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__": if __name__ == "__main__":
main() main()

Loading…
Cancel
Save