From 9653f9d6a6b84d5d0c9ba920a44e407828700213 Mon Sep 17 00:00:00 2001 From: Vasily Tarasov Date: Tue, 4 Sep 2018 00:16:09 -0700 Subject: [PATCH] Fix pre-enable engagement on GM (#348) 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. --- selfdrive/car/gm/interface.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index bf39272fc4c65f..ec531d3db85e08 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -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, \