mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-28 01:52:06 +08:00
Ford: handle metric cruise speed (v2) (#31463)
* Ford: handle metric cruise speed (v2) **Description** I found a signal which appears to match the IPC "Show km/h" setting. Requires https://github.com/commaai/opendbc/pull/1010. **Verification** - [ ] Test in car and confirm that toggling the "Show km/h" setting does not result in the cruise speed shown in openpilot being incorrect. - [ ] Test in a non-English (metric) car. * not present on Q4 * fix freq * test * Revert "test" This reverts commit 5e3a9f6df126d51685157de1e52bd6695db40fac. * Update ref_commit --------- Co-authored-by: Shane Smiskol <shane@smiskol.com> old-commit-hash: b59ae50961244de60b7bc426e5566c24278adc85
This commit is contained in:
@@ -57,7 +57,8 @@ class CarState(CarStateBase):
|
||||
ret.steerFaultTemporary |= cp.vl["Lane_Assist_Data3_FD1"]["LatCtlSte_D_Stat"] not in (1, 2, 3)
|
||||
|
||||
# cruise state
|
||||
ret.cruiseState.speed = cp.vl["EngBrakeData"]["Veh_V_DsplyCcSet"] * CV.MPH_TO_MS
|
||||
is_metric = cp.vl["INSTRUMENT_PANEL"]["METRIC_UNITS"] == 1 if not self.CP.flags & FordFlags.CANFD else False
|
||||
ret.cruiseState.speed = cp.vl["EngBrakeData"]["Veh_V_DsplyCcSet"] * (CV.KPH_TO_MS if is_metric else CV.MPH_TO_MS)
|
||||
ret.cruiseState.enabled = cp.vl["EngBrakeData"]["CcStat_D_Actl"] in (4, 5)
|
||||
ret.cruiseState.available = cp.vl["EngBrakeData"]["CcStat_D_Actl"] in (3, 4, 5)
|
||||
ret.cruiseState.nonAdaptive = cp.vl["Cluster_Info1_FD1"]["AccEnbl_B_RqDrv"] == 0
|
||||
@@ -131,6 +132,10 @@ class CarState(CarStateBase):
|
||||
messages += [
|
||||
("Lane_Assist_Data3_FD1", 33),
|
||||
]
|
||||
else:
|
||||
messages += [
|
||||
("INSTRUMENT_PANEL", 1),
|
||||
]
|
||||
|
||||
if CP.transmissionType == TransmissionType.automatic:
|
||||
messages += [
|
||||
|
||||
@@ -1 +1 @@
|
||||
4e5e37be9d70450154f8b100ed88151bb3612331
|
||||
f77699bfd783ab0c9a419f2af883b36aed20cc68
|
||||
Reference in New Issue
Block a user