clean that up

pull/28196/head
Shane Smiskol 2 years ago
parent 2e8055d056
commit d5bbe17afe
  1. 10
      selfdrive/car/ford/carcontroller.py
  2. 2
      selfdrive/car/ford/values.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

@ -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

Loading…
Cancel
Save