Skip to content

Commit

Permalink
Fix pre-enable engagement on GM (commaai#348)
Browse files Browse the repository at this point in the history
In 2017 Volts, PCM fault occurs for a few seconds if ACC gas
is commanded while user presses gas pedal. PID winds up,
and when PCM fault clears, car gets a "max gas" jolt.

In 2018 Volts, PCM fault doesn't time out, which means pre-enable
doesn't work at all, and car would slowly decelerate, while openpilot
thinks it's engaged.
  • Loading branch information
vntarasov authored and klaus385 committed Dec 25, 2018
1 parent 5a04893 commit 5fcfc29
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion selfdrive/car/gm/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,11 @@ def apply(self, c, perception_state=log.Live20Data.new_message()):
"chimeRepeated": (CM.LOW_CHIME, -1),
"chimeContinuous": (CM.LOW_CHIME, -1)}[str(c.hudControl.audibleAlert)]

self.CC.update(self.sendcan, c.enabled, self.CS, self.frame, \
# For Openpilot, "enabled" includes pre-enable.
# In GM, PCM faults out if ACC command overlaps user gas.
enabled = c.enabled and not self.CS.user_gas_pressed

self.CC.update(self.sendcan, enabled, self.CS, self.frame, \
c.actuators,
hud_v_cruise, c.hudControl.lanesVisible, \
c.hudControl.leadVisible, \
Expand Down

0 comments on commit 5fcfc29

Please sign in to comment.