mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 05:24:06 +08:00
fix put_nonblocking reference
This commit is contained in:
@@ -2,7 +2,6 @@ import numpy as np
|
||||
from typing import List, Optional, Tuple, Any
|
||||
|
||||
from cereal import log
|
||||
from openpilot.common.params import put_nonblocking
|
||||
|
||||
|
||||
class NPQueue:
|
||||
@@ -63,8 +62,3 @@ class ParameterEstimator:
|
||||
|
||||
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())
|
||||
|
||||
@@ -9,7 +9,7 @@ from openpilot.common.realtime import config_realtime_process, DT_MDL
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user