mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-05 13:32:05 +08:00
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:
@@ -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
|
||||
Reference in New Issue
Block a user