From c8dc3909f45c354fc8d8e0d78771f452677256a3 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 7 Feb 2022 21:05:55 -0800 Subject: [PATCH] give calibrationd rt priority (#23725) old-commit-hash: 8a0fc850b43f851d2ac7d8d87e54d557b537de91 --- selfdrive/locationd/calibrationd.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/selfdrive/locationd/calibrationd.py b/selfdrive/locationd/calibrationd.py index ae191bbebb..ae314e38c4 100755 --- a/selfdrive/locationd/calibrationd.py +++ b/selfdrive/locationd/calibrationd.py @@ -6,17 +6,20 @@ While the roll calibration is a real value that can be estimated, here we assume and the image input into the neural network is not corrected for roll. ''' +import gc import os -from typing import NoReturn import numpy as np -import cereal.messaging as messaging +from typing import NoReturn + from cereal import log -from selfdrive.hardware import TICI +import cereal.messaging as messaging from common.params import Params, put_nonblocking +from common.realtime import set_realtime_priority from common.transformations.model import model_height from common.transformations.camera import get_view_frame_from_road_frame from common.transformations.orientation import rot_from_euler, euler_from_rot from selfdrive.config import Conversions as CV +from selfdrive.hardware import TICI from selfdrive.swaglog import cloudlog MIN_SPEED_FILTER = 15 * CV.MPH_TO_MS @@ -191,6 +194,9 @@ class Calibrator(): def calibrationd_thread(sm=None, pm=None) -> NoReturn: + gc.disable() + set_realtime_priority(1) + if sm is None: sm = messaging.SubMaster(['cameraOdometry', 'carState'], poll=['cameraOdometry'])