From dde883675cd62481a03ca8203e3404094cc26004 Mon Sep 17 00:00:00 2001 From: Cameron Clough Date: Sat, 13 May 2023 18:46:15 -0700 Subject: [PATCH] send inactive signals --- panda | 2 +- selfdrive/car/ford/carcontroller.py | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/panda b/panda index 50c275ea01..d403ef25b1 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit 50c275ea012d38043d7f1ad0b8bed3c2b3ba609b +Subproject commit d403ef25b11eaa1ba1c64ca9cc50fa78e6e30bfe diff --git a/selfdrive/car/ford/carcontroller.py b/selfdrive/car/ford/carcontroller.py index 29b86f4ff6..38a6c829f1 100644 --- a/selfdrive/car/ford/carcontroller.py +++ b/selfdrive/car/ford/carcontroller.py @@ -82,12 +82,16 @@ class CarController: ### longitudinal control ### # send acc msg at 50Hz if self.CP.openpilotLongitudinalControl and (self.frame % CarControllerParams.ACC_CONTROL_STEP) == 0: - accel = clip(actuators.accel, CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX) - - gas = accel - decel = accel < 0.0 - if accel < -0.5: + if CC.longActive: + accel = clip(actuators.accel, CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX) + gas = accel + decel = accel < 0.0 + if accel < -0.5: + gas = -5.0 + else: + accel = 0.0 # -0.0008 m/s^2 on CAN gas = -5.0 + decel = False stopping = CC.actuators.longControlState == LongCtrlState.stopping can_sends.append(create_acc_msg(self.packer, CC.longActive, gas, accel, decel, stopping))