add comment and fix

pull/28196/head
Shane Smiskol 2 years ago
parent 84e22e6dd1
commit 51116cddba
  1. 6
      selfdrive/car/ford/carcontroller.py

@ -82,10 +82,10 @@ class CarController:
### longitudinal control ### ### longitudinal control ###
# send acc msg at 50Hz # send acc msg at 50Hz
if self.CP.openpilotLongitudinalControl and (self.frame % CarControllerParams.ACC_CONTROL_STEP) == 0: if self.CP.openpilotLongitudinalControl and (self.frame % CarControllerParams.ACC_CONTROL_STEP) == 0:
# Both gas and accel are in m/s^2, accel is used solely for braking
accel = clip(actuators.accel, CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX) accel = clip(actuators.accel, CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX)
# TODO FIX gas = accel
gas = clip(actuators.accel, CarControllerParams.MIN_GAS, CarControllerParams.ACCEL_MAX) if not CC.longActive or gas < CarControllerParams.MIN_GAS:
if not CC.longActive:
gas = -5.0 gas = -5.0
stopping = CC.actuators.longControlState == LongCtrlState.stopping stopping = CC.actuators.longControlState == LongCtrlState.stopping

Loading…
Cancel
Save