From a52821e983bbfc4059507c4d8352fa9ef242b8a9 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] Increase steering torque for Subaru Impreza --- opendbc_repo/opendbc/car/subaru/values.py | 2 ++ opendbc_repo/opendbc/safety/modes/subaru.h | 2 +- opendbc_repo/opendbc/safety/tests/test_subaru.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/opendbc_repo/opendbc/car/subaru/values.py b/opendbc_repo/opendbc/car/subaru/values.py index ddb1be19..e5e83e70 100644 --- a/opendbc_repo/opendbc/car/subaru/values.py +++ b/opendbc_repo/opendbc/car/subaru/values.py @@ -27,6 +27,8 @@ class CarControllerParams: self.STEER_DELTA_UP = 35 self.STEER_MAX = 1439 # FrogPilot variables + elif CP.carFingerprint == CAR.SUBARU_IMPREZA: + self.STEER_MAX = 3071 else: self.STEER_MAX = 2047 diff --git a/opendbc_repo/opendbc/safety/modes/subaru.h b/opendbc_repo/opendbc/safety/modes/subaru.h index b8227d82..94955cdd 100644 --- a/opendbc_repo/opendbc/safety/modes/subaru.h +++ b/opendbc_repo/opendbc/safety/modes/subaru.h @@ -136,7 +136,7 @@ static void subaru_rx_hook(const CANPacket_t *msg) { } static bool subaru_tx_hook(const CANPacket_t *msg) { - const TorqueSteeringLimits SUBARU_STEERING_LIMITS = SUBARU_STEERING_LIMITS_GENERATOR(2047, 50, 70); + const TorqueSteeringLimits SUBARU_STEERING_LIMITS = SUBARU_STEERING_LIMITS_GENERATOR(3071, 50, 70); const TorqueSteeringLimits SUBARU_GEN2_STEERING_LIMITS = SUBARU_STEERING_LIMITS_GENERATOR(1500, 35, 50); const LongitudinalLimits SUBARU_LONG_LIMITS = { diff --git a/opendbc_repo/opendbc/safety/tests/test_subaru.py b/opendbc_repo/opendbc/safety/tests/test_subaru.py index 69e29dd0..14ea0d55 100755 --- a/opendbc_repo/opendbc/safety/tests/test_subaru.py +++ b/opendbc_repo/opendbc/safety/tests/test_subaru.py @@ -166,7 +166,7 @@ class TestSubaruLongitudinalSafetyBase(TestSubaruSafetyBase, common.Longitudinal class TestSubaruTorqueSafetyBase(TestSubaruSafetyBase, common.DriverTorqueSteeringSafetyTest, common.SteerRequestCutSafetyTest): MAX_RATE_UP = 50 MAX_RATE_DOWN = 70 - MAX_TORQUE_LOOKUP = [0], [2047] + MAX_TORQUE_LOOKUP = [0], [3071] # Safety around steering req bit MIN_VALID_STEERING_FRAMES = 7