torqued: add DEBUG flag (#36161)

Add a debug flag to torqued
master
Kacper Rączy 24 hours ago committed by GitHub
parent 96c00271e3
commit 889ce4c4fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      selfdrive/locationd/torqued.py

@ -1,4 +1,5 @@
#!/usr/bin/env python3
import os
import numpy as np
from collections import deque, defaultdict
@ -242,6 +243,8 @@ class TorqueEstimator(ParameterEstimator):
def main(demo=False):
config_realtime_process([0, 1, 2, 3], 5)
DEBUG = bool(int(os.getenv("DEBUG", "0")))
pm = messaging.PubMaster(['liveTorqueParameters'])
sm = messaging.SubMaster(['carControl', 'carOutput', 'carState', 'liveCalibration', 'livePose', 'liveDelay'], poll='livePose')
@ -258,7 +261,7 @@ def main(demo=False):
# 4Hz driven by livePose
if sm.frame % 5 == 0:
pm.send('liveTorqueParameters', estimator.get_msg(valid=sm.all_checks()))
pm.send('liveTorqueParameters', estimator.get_msg(valid=sm.all_checks(), with_points=DEBUG))
# Cache points every 60 seconds while onroad
if sm.frame % 240 == 0:

Loading…
Cancel
Save