Skip to content

Commit

Permalink
Ford: use more reliable gear message (#32886)
Browse files Browse the repository at this point in the history
* todo

* nope

* not this one

* yep

* passes

* clean up

* not used!

* oop

* update refs
  • Loading branch information
sshane authored Jul 3, 2024
1 parent c95b584 commit 7de2aac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions selfdrive/car/ford/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, CP):
super().__init__(CP)
can_define = CANDefine(DBC[CP.carFingerprint]["pt"])
if CP.transmissionType == TransmissionType.automatic:
self.shifter_values = can_define.dv["Gear_Shift_by_Wire_FD1"]["TrnRng_D_RqGsm"]
self.shifter_values = can_define.dv["PowertrainData_10"]["TrnRng_D_Rq"]

self.vehicle_sensors_valid = False

Expand Down Expand Up @@ -69,7 +69,7 @@ def update(self, cp, cp_cam):

# gear
if self.CP.transmissionType == TransmissionType.automatic:
gear = self.shifter_values.get(cp.vl["Gear_Shift_by_Wire_FD1"]["TrnRng_D_RqGsm"])
gear = self.shifter_values.get(cp.vl["PowertrainData_10"]["TrnRng_D_Rq"])
ret.gearShifter = self.parse_gear_shifter(gear)
elif self.CP.transmissionType == TransmissionType.manual:
ret.clutchPressed = cp.vl["Engine_Clutch_Data"]["CluPdlPos_Pc_Meas"] > 0
Expand Down Expand Up @@ -139,7 +139,7 @@ def get_can_parser(CP):

if CP.transmissionType == TransmissionType.automatic:
messages += [
("Gear_Shift_by_Wire_FD1", 10),
("PowertrainData_10", 10),
]
elif CP.transmissionType == TransmissionType.manual:
messages += [
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/test/process_replay/ref_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8737e368e17f859291164286feb4246e00c0b4a5
f6ff3601bd0496e78d8bc3b019d58bb7739f096b

0 comments on commit 7de2aac

Please sign in to comment.