Skip to content

Commit

Permalink
GAC: Ford support (commaai#226)
Browse files Browse the repository at this point in the history
* GAC: Ford support

* Update CHANGELOGS.md
  • Loading branch information
sunnyhaibin authored Aug 11, 2023
1 parent d7a2214 commit 9bc1632
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion CHANGELOGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ sunnypilot - 0.9.4.1 (2023-08-xx)
* UPDATED: Synced with commaai's 0.9.4 release
* NEW❗: Moonrise driving model
* NEW❗: Ford upstream models support
* G.A.C. support for Ford will be implemented in future updates
* UPDATED: Dynamic Lane Profile selector in the "SP - Controls" menu
* REMOVED: Dynamic Lane Profile driving screen UI button
* FIXED: Disallow torque lateral control for angle control platforms (e.g. Ford, Nissan, Tesla)
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/ford/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def update(self, CC, CS, now_nanos):
if (self.frame % CarControllerParams.ACC_UI_STEP) == 0 or send_ui:
can_sends.append(create_acc_ui_msg(self.packer, self.CAN, self.CP, main_on, CC.latActive,
fcw_alert, CS.out.cruiseState.standstill, hud_control,
CS.acc_tja_status_stock_values))
CS.acc_tja_status_stock_values, CS.gac_tr))

self.main_on_last = main_on
self.lkas_enabled_last = CC.latActive
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/car/ford/fordcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def create_acc_msg(packer, CAN: CanBus, long_active: bool, gas: float, accel: fl


def create_acc_ui_msg(packer, CAN: CanBus, CP, main_on: bool, enabled: bool, fcw_alert: bool, standstill: bool,
hud_control, stock_values: dict):
hud_control, stock_values: dict, gac_tr):
"""
Creates a CAN message for the Ford IPC adaptive cruise, forward collision warning and traffic jam
assist status.
Expand Down Expand Up @@ -211,7 +211,7 @@ def create_acc_ui_msg(packer, CAN: CanBus, CP, main_on: bool, enabled: bool, fcw
"AccFllwMde_B_Dsply": 1 if hud_control.leadVisible else 0, # Lead indicator
"AccStopMde_B_Dsply": 1 if standstill else 0,
"AccWarn_D_Dsply": 0, # ACC warning
"AccTGap_D_Dsply": 4, # Fixed time gap in UI
"AccTGap_D_Dsply": gac_tr, # Fixed time gap in UI
})

# Forwards FCW alert from IPMA
Expand Down
1 change: 1 addition & 0 deletions selfdrive/car/ford/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def _update(self, c):
if not self.CS.prev_lkas_enabled and self.CS.lkas_enabled:
self.CS.madsEnabled = not self.CS.madsEnabled
self.CS.madsEnabled = self.get_acc_mads(ret.cruiseState.enabled, self.CS.accEnabled, self.CS.madsEnabled)
ret, self.CS = self.toggle_gac(ret, self.CS, self.CS.buttonStates["gapAdjustCruise"], 1, 3, 4, "-")
else:
self.CS.madsEnabled = False

Expand Down

0 comments on commit 9bc1632

Please sign in to comment.