Skip to content

Commit

Permalink
Synchronize gas and accel after accel was tweaked
Browse files Browse the repository at this point in the history
  • Loading branch information
blue-genie committed Oct 26, 2024
1 parent 92da02f commit e6b6f42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opendbc/car/ford/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def update(self, CC, CS, now_nanos):
# send acc msg at 50Hz
if self.CP.openpilotLongitudinalControl and (self.frame % CarControllerParams.ACC_CONTROL_STEP) == 0:
accel = actuators.accel
gas = accel

if CC.longActive:
# Compensate for engine creep at low speed.
Expand All @@ -115,6 +114,7 @@ def update(self, CC, CS, now_nanos):
accel = clip(accel, CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX)

# Both gas and accel are in m/s^2, accel is used solely for braking
gas = accel
if not CC.longActive or gas < CarControllerParams.MIN_GAS:
gas = CarControllerParams.INACTIVE_GAS

Expand Down

0 comments on commit e6b6f42

Please sign in to comment.