From c08c17ce66f5ae347c830442d8e6694cb7572b03 Mon Sep 17 00:00:00 2001 From: James <91348155+FrogAi@users.noreply.github.com> Date: Mon, 1 Dec 2025 12:00:00 -0700 Subject: [PATCH] Decimate "Torque Estimator" if not previously calibrated --- frogpilot/common/frogpilot_variables.py | 2 ++ selfdrive/locationd/torqued.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/frogpilot/common/frogpilot_variables.py b/frogpilot/common/frogpilot_variables.py index 52fce61c1..c7ca7df19 100644 --- a/frogpilot/common/frogpilot_variables.py +++ b/frogpilot/common/frogpilot_variables.py @@ -241,7 +241,9 @@ class FrogPilotVariables: msg_bytes = self.params.get("LiveTorqueParameters") if msg_bytes: LTP = messaging.log_from_bytes(msg_bytes, log.LiveTorqueParametersData) + toggle.liveValid = LTP.liveValid else: + toggle.liveValid = False toggle.debug_mode = self.params.get_bool("DebugMode") diff --git a/selfdrive/locationd/torqued.py b/selfdrive/locationd/torqued.py index 22b101377..a020fc535 100755 --- a/selfdrive/locationd/torqued.py +++ b/selfdrive/locationd/torqued.py @@ -258,6 +258,9 @@ def main(demo=False): frogpilot_toggles = get_frogpilot_toggles() + if not frogpilot_toggles.liveValid: + estimator = TorqueEstimator(messaging.log_from_bytes(params.get("CarParams", block=True), car.CarParams), decimated=True) + estimator.frogpilot_toggles = frogpilot_toggles while True: