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: 83a53618b3a04377ee55561da7460a6f5da7d8d1
This commit is contained in:
Vivek Aithal
2021-10-07 18:21:11 -07:00
committed by GitHub
parent 782d7023d2
commit 9f96d63520
2 changed files with 3 additions and 6 deletions
+2 -5
View File
@@ -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
View File
@@ -1 +1 @@
dc264ed5d283bbfe4dd44c5f65db3eb5cef210eb
5ee94677282bcea512e0d929e55e71308f14d530