Skip to content

Commit

Permalink
fix put_nonblocking reference
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh committed Dec 14, 2023
1 parent b53b505 commit bd8a99b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 0 additions & 6 deletions selfdrive/locationd/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from typing import List, Optional, Tuple, Any

from cereal import log
from openpilot.common.params import put_nonblocking


class NPQueue:
Expand Down Expand Up @@ -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())
6 changes: 3 additions & 3 deletions selfdrive/locationd/torqued.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

0 comments on commit bd8a99b

Please sign in to comment.