From 4b12aca9411d2edd178b5972cd0f10c0c02303e8 Mon Sep 17 00:00:00 2001 From: andrewcopenpilot <50561935+andrewcopenpilot@users.noreply.github.com> Date: Sat, 8 Feb 2020 13:32:01 -0800 Subject: [PATCH] GM: Resume Required Alert should be triggered off of ECM state (#1045) * Resume Required Alert should be triggered off of ECM state On GM cars the ECM goes into cruise state 4 (standstill) and in order for the ECM to accept cruise inputs, the resume button must be pressed to drive it to state 1 (active). Previously rather than testing for if the ECM was in state 4, the wheel speed sensors were checked that the vehicle was going less than 0.5 m/s. In some cases this could cause the resume required alert to be displayed before the car actually came to a stop as far as the ECM was concerned. If the alert is triggered before state 4 and OP demands acceleration, its possible for OP to acelerate while the Resume Required Alert is displayed created a very confusing UX. * After more review, the problem was actually with the 'if at_full_stop' check was inside an else statement preventing entering the stopped mode if braking is 0 --- selfdrive/car/gm/gmcan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/gm/gmcan.py b/selfdrive/car/gm/gmcan.py index 68b129e743..3db0f5b02c 100644 --- a/selfdrive/car/gm/gmcan.py +++ b/selfdrive/car/gm/gmcan.py @@ -67,8 +67,8 @@ def create_friction_brake_command(packer, bus, apply_brake, idx, near_stop, at_f else: mode = 0xa - if at_full_stop: - mode = 0xd + if at_full_stop: + mode = 0xd # TODO: this is to have GM bringing the car to complete stop, # but currently it conflicts with OP controls, so turned off. #elif near_stop: