From e75dc5718c899bc90c67859cce3114b102e85f6c Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 17 Jun 2021 14:19:24 -0700 Subject: [PATCH] make locationd and paramsd RT (#21264) old-commit-hash: f01ebc56807a9946ae06a9e6b1bf366bf5a124e0 --- selfdrive/locationd/locationd.cc | 2 +- selfdrive/locationd/paramsd.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/selfdrive/locationd/locationd.cc b/selfdrive/locationd/locationd.cc index df2a208f3..f2e81316c 100755 --- a/selfdrive/locationd/locationd.cc +++ b/selfdrive/locationd/locationd.cc @@ -469,7 +469,7 @@ int Localizer::locationd_thread() { } int main() { - setpriority(PRIO_PROCESS, 0, -20); + set_realtime_priority(5); Localizer localizer; return localizer.locationd_thread(); diff --git a/selfdrive/locationd/paramsd.py b/selfdrive/locationd/paramsd.py index e297be3ae..3eaf8cec0 100755 --- a/selfdrive/locationd/paramsd.py +++ b/selfdrive/locationd/paramsd.py @@ -8,7 +8,7 @@ import numpy as np import cereal.messaging as messaging from cereal import car from common.params import Params, put_nonblocking -from common.realtime import DT_MDL +from common.realtime import set_realtime_priority, DT_MDL from common.numpy_fast import clip from selfdrive.locationd.models.car_kf import CarKalman, ObservationKind, States from selfdrive.locationd.models.constants import GENERATED_DIR @@ -73,6 +73,7 @@ class ParamsLearner: def main(sm=None, pm=None): gc.disable() + set_realtime_priority(5) if sm is None: sm = messaging.SubMaster(['liveLocationKalman', 'carState'], poll=['liveLocationKalman'])