From d55c7ef173ccf422b3594726f6472fff6d9aa8ce Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Tue, 2 Jul 2019 11:04:36 +1000 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=B2=B9=E9=96=80=E4=B8=8D?= =?UTF-8?q?=E5=8F=96=E6=B6=88=20OP=20=E9=81=B8=E9=A0=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- selfdrive/car/honda/carcontroller.py | 3 --- selfdrive/car/honda/interface.py | 8 +++----- selfdrive/car/toyota/carcontroller.py | 3 --- selfdrive/car/toyota/interface.py | 9 ++++----- selfdrive/dragonpilot/dragonconf/__init__.py | 1 - 5 files changed, 7 insertions(+), 17 deletions(-) diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py index f93460422..8fc9db7af 100644 --- a/selfdrive/car/honda/carcontroller.py +++ b/selfdrive/car/honda/carcontroller.py @@ -168,9 +168,6 @@ class CarController(object): can_sends.append(hondacan.spam_buttons_command(self.packer, CruiseButtons.RES_ACCEL, idx)) else: - if CS.car_gas > 0 and params.get("d_allowGasOnOP") == "1": - apply_brake = 0 - apply_gas = 0 # Send gas and brake commands. if (frame % 2) == 0: idx = frame // 2 diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index cbe4a8105..c91ba37a6 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -519,13 +519,11 @@ class CarInterface(object): events.append(create_event('speedTooLow', [ET.NO_ENTRY])) # disable on pedals rising edge or when brake is pressed and speed isn't zero - if ret.gasPressed and not self.gas_pressed_prev and params.get("d_allowGasOnOP") == "0": + if (ret.gasPressed and not self.gas_pressed_prev) or \ + (ret.brakePressed and (not self.brake_pressed_prev or ret.vEgo > 0.001)): events.append(create_event('pedalPressed', [ET.NO_ENTRY, ET.USER_DISABLE])) - if ret.brakePressed and (not self.brake_pressed_prev or ret.vEgo > 0.001): - events.append(create_event('pedalPressed', [ET.NO_ENTRY, ET.USER_DISABLE])) - - if ret.gasPressed and params.get("d_allowGasOnOP") == "0": + if ret.gasPressed: events.append(create_event('pedalPressed', [ET.PRE_ENABLE])) # it can happen that car cruise disables while comma system is enabled: need to diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index 4b28fe252..8b6a5f810 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -221,9 +221,6 @@ class CarController(object): elif ECU.APGS in self.fake_ecus: can_sends.append(create_ipas_steer_command(self.packer, 0, 0, True)) - if CS.gas_pressed and params.get("d_allowGasOnOP") == "1": - apply_accel = 0 - apply_gas = 0 # accel cmd comes from DSU, but we can spam can to cancel the system even if we are using lat only control if (frame % 3 == 0 and ECU.DSU in self.fake_ecus) or (pcm_cancel_cmd and ECU.CAM in self.fake_ecus): lead = lead or CS.v_ego < 12. # at low speed we always assume the lead is present do ACC can be engaged diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 854fc6d99..ffccd88bb 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -376,13 +376,12 @@ class CarInterface(object): elif not ret.cruiseState.enabled: events.append(create_event('pcmDisable', [ET.USER_DISABLE])) - if ret.gasPressed and not self.gas_pressed_prev and params.get("d_allowGasOnOP") == "0": + # disable on pedals rising edge or when brake is pressed and speed isn't zero + if (ret.gasPressed and not self.gas_pressed_prev) or \ + (ret.brakePressed and (not self.brake_pressed_prev or ret.vEgo > 0.001)): events.append(create_event('pedalPressed', [ET.NO_ENTRY, ET.USER_DISABLE])) - if ret.brakePressed and (not self.brake_pressed_prev or ret.vEgo > 0.001): - events.append(create_event('pedalPressed', [ET.NO_ENTRY, ET.USER_DISABLE])) - - if ret.gasPressed and params.get("d_allowGasOnOP") == "0": + if ret.gasPressed: events.append(create_event('pedalPressed', [ET.PRE_ENABLE])) ret.events = events diff --git a/selfdrive/dragonpilot/dragonconf/__init__.py b/selfdrive/dragonpilot/dragonconf/__init__.py index bc1696496..330979ef2 100644 --- a/selfdrive/dragonpilot/dragonconf/__init__.py +++ b/selfdrive/dragonpilot/dragonconf/__init__.py @@ -10,7 +10,6 @@ default_conf = { 'd_enableDriverMonitor': '1', 'd_autoShutdownAt': '1800', # shutdown after 30 mins 'd_tempDisableSteerOnSignal': '0', - 'd_allowGasOnOP': '0', } def write_json_config(config):