diff --git a/selfdrive/car/ford/carcontroller.py b/selfdrive/car/ford/carcontroller.py index a369221569..4232520090 100644 --- a/selfdrive/car/ford/carcontroller.py +++ b/selfdrive/car/ford/carcontroller.py @@ -82,13 +82,9 @@ class CarController: ### longitudinal control ### # send acc msg at 50Hz if self.CP.openpilotLongitudinalControl and (self.frame % CarControllerParams.ACC_CONTROL_STEP) == 0: - if CC.longActive: - accel = clip(actuators.accel, CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX) - gas = accel - if accel < -0.5: - gas = -5.0 - else: - accel = 0.0 # -0.0008 m/s^2 on CAN + accel = clip(actuators.accel, CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX) + gas = clip(actuators.accel, CarControllerParams.MIN_GAS, CarControllerParams.ACCEL_MAX) + if not CC.longActive: gas = -5.0 stopping = CC.actuators.longControlState == LongCtrlState.stopping diff --git a/selfdrive/car/ford/values.py b/selfdrive/car/ford/values.py index 6a0639cee3..6425179a27 100644 --- a/selfdrive/car/ford/values.py +++ b/selfdrive/car/ford/values.py @@ -31,6 +31,8 @@ class CarControllerParams: ACCEL_MAX = 2.0 # m/s^s max acceleration ACCEL_MIN = -3.5 # m/s^s max deceleration + MIN_GAS = -0.5 + INACTIVE_GAS = -5.0 def __init__(self, CP): pass