paramsd: Sort messages in each update iteration before processing (#22403)

* sort livelocationKalman and carState messages in each update iteration before processing

* update refs

* update refs

* update refs

* update again

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 83a53618b3
commatwo_master
Vivek Aithal 4 years ago committed by GitHub
parent 782d7023d2
commit 9f96d63520
  1. 7
      selfdrive/locationd/paramsd.py
  2. 2
      selfdrive/test/process_replay/ref_commit

@ -123,17 +123,14 @@ def main(sm=None, pm=None):
# When driving in wet conditions the stiffness can go down, and then be too low on the next drive
# Without a way to detect this we have to reset the stiffness every drive
params['stiffnessFactor'] = 1.0
learner = ParamsLearner(CP, params['steerRatio'], params['stiffnessFactor'], math.radians(params['angleOffsetAverageDeg']))
angle_offset_average = params['angleOffsetAverageDeg']
angle_offset = angle_offset_average
while True:
sm.update()
for which, updated in sm.updated.items():
if updated:
for which in sorted(sm.updated.keys(), key=lambda x: sm.logMonoTime[x]):
if sm.updated[which]:
t = sm.logMonoTime[which] * 1e-9
learner.handle_log(t, which, sm[which])

@ -1 +1 @@
dc264ed5d283bbfe4dd44c5f65db3eb5cef210eb
5ee94677282bcea512e0d929e55e71308f14d530
Loading…
Cancel
Save