Skip to content

Ford: detect reverse gear for manual transmissions #24234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions selfdrive/car/ford/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ def update(self, cp, cp_cam):
ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(gear, None))
elif self.CP.transmissionType == TransmissionType.manual:
ret.clutchPressed = cp.vl["Engine_Clutch_Data"]["CluPdlPos_Pc_Meas"] > 0
# TODO: find reverse light signal
ret.gearShifter = GearShifter.drive
if bool(cp.vl["BCM_Lamp_Stat_FD1"]["RvrseLghtOn_B_Stat"]):
ret.gearShifter = GearShifter.reverse
else:
ret.gearShifter = GearShifter.drive

# safety
ret.stockFcw = bool(cp_cam.vl["ACCDATA_3"]["FcwVisblWarn_B_Rq"])
Expand Down Expand Up @@ -148,9 +150,11 @@ def get_can_parser(CP):
elif CP.transmissionType == TransmissionType.manual:
signals += [
("CluPdlPos_Pc_Meas", "Engine_Clutch_Data"), # PCM clutch (pct)
("RvrseLghtOn_B_Stat", "BCM_Lamp_Stat_FD1"), # BCM reverse light
]
checks += [
("Engine_Clutch_Data", 33),
("BCM_Lamp_Stat_FD1", 1),
]

if CP.enableBsm:
Expand Down