From b8d3d1e9cc50fa2aa3b5e67838a010e8cc0c8129 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] Force Torque Controller --- frogpilot/common/frogpilot_variables.py | 1 + opendbc_repo/opendbc/car/interfaces.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/frogpilot/common/frogpilot_variables.py b/frogpilot/common/frogpilot_variables.py index 621e781f..9f9b3c78 100644 --- a/frogpilot/common/frogpilot_variables.py +++ b/frogpilot/common/frogpilot_variables.py @@ -516,6 +516,7 @@ class FrogPilotVariables: toggle.one_lane_change = self.get_value("OneLaneChange", condition=toggle.lane_changes) lateral_tuning = self.get_value("LateralTune") + toggle.force_torque_controller = self.get_value("ForceTorqueController", condition=lateral_tuning and not is_torque_car and not is_angle_car) toggle.use_turn_desires = self.get_value("TurnDesires", condition=lateral_tuning) lkas_button_control = self.get_value("LKASButtonControl", cast=float, condition=toggle.car_make != "subaru") diff --git a/opendbc_repo/opendbc/car/interfaces.py b/opendbc_repo/opendbc/car/interfaces.py index 2b764a15..f0c12420 100644 --- a/opendbc_repo/opendbc/car/interfaces.py +++ b/opendbc_repo/opendbc/car/interfaces.py @@ -170,6 +170,9 @@ class CarInterfaceBase(ABC): ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, ret.tireStiffnessFactor) # FrogPilot variables + toggles_to_check = ("force_torque_controller") + if ret.steerControlType != structs.CarParams.SteerControlType.angle and any(getattr(frogpilot_toggles, toggle, False) for toggle in toggles_to_check): + CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) return ret