From 56742acbd4dc8f68f7e7562f8c203f373be372dc Mon Sep 17 00:00:00 2001 From: dragonpilot Date: Mon, 21 Oct 2019 11:18:17 +1000 Subject: [PATCH] remove gas/brake value modification when allow_gas is enabled --- selfdrive/car/honda/carcontroller.py | 22 +++++++++++----------- selfdrive/car/toyota/carcontroller.py | 20 ++++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py index 59ae644ce..ed68fa7ce 100644 --- a/selfdrive/car/honda/carcontroller.py +++ b/selfdrive/car/honda/carcontroller.py @@ -88,7 +88,7 @@ class CarController(): # dragonpilot self.turning_signal_timer = 0 self.dragon_enable_steering_on_signal = False - self.dragon_allow_gas = False + # self.dragon_allow_gas = False self.dragon_lat_ctrl = True def update(self, enabled, CS, frame, actuators, \ @@ -97,7 +97,7 @@ class CarController(): # dragonpilot, don't check for param too often as it's a kernel call if frame % 500 == 0: self.dragon_enable_steering_on_signal = True if params.get("DragonEnableSteeringOnSignal", encoding='utf8') == "1" else False - self.dragon_allow_gas = True if params.get("DragonAllowGas", encoding='utf8') == "1" else False + # self.dragon_allow_gas = True if params.get("DragonAllowGas", encoding='utf8') == "1" else False self.dragon_lat_ctrl = False if params.get("DragonLatCtrl", encoding='utf8') == "0" else True # *** apply brake hysteresis *** @@ -190,15 +190,15 @@ class CarController(): # DragonAllowGas # if we detect gas pedal pressed, we do not want OP to apply gas or brake # gasPressed code from interface.py - if not CS.CP.enableGasInterceptor: - gasPressed = CS.pedal_gas > 0 - else: - gasPressed = CS.user_gas_pressed - dragon_apply_brake = apply_brake - if self.dragon_allow_gas and gasPressed: - dragon_apply_brake = 0 - apply_gas = 0 - can_sends.append(hondacan.create_brake_command(self.packer, dragon_apply_brake, pump_on, + # if not CS.CP.enableGasInterceptor: + # gasPressed = CS.pedal_gas > 0 + # else: + # gasPressed = CS.user_gas_pressed + # dragon_apply_brake = apply_brake + # if self.dragon_allow_gas and gasPressed: + # dragon_apply_brake = 0 + # apply_gas = 0 + can_sends.append(hondacan.create_brake_command(self.packer, apply_brake, pump_on, pcm_override, pcm_cancel_cmd, hud.fcw, idx, CS.CP.carFingerprint, CS.CP.isPandaBlack)) self.apply_brake_last = apply_brake diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index b11b719db..8a09cbbcc 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -120,7 +120,7 @@ class CarController(): # dragonpilot self.turning_signal_timer = 0 self.dragon_enable_steering_on_signal = False - self.dragon_allow_gas = False + # self.dragon_allow_gas = False self.dragon_lat_ctrl = True self.dragon_lane_departure_warning = True @@ -130,7 +130,7 @@ class CarController(): # dragonpilot, don't check for param too often as it's a kernel call if frame % 500 == 0: self.dragon_enable_steering_on_signal = True if params.get("DragonEnableSteeringOnSignal", encoding='utf8') == "1" else False - self.dragon_allow_gas = True if params.get("DragonAllowGas", encoding='utf8') == "1" else False + # self.dragon_allow_gas = True if params.get("DragonAllowGas", encoding='utf8') == "1" else False self.dragon_lat_ctrl = False if params.get("DragonLatCtrl", encoding='utf8') == "0" else True self.dragon_lane_departure_warning = False if params.get("DragonToyotaLaneDepartureWarning", encoding='utf8') == "0" else True @@ -247,15 +247,15 @@ class CarController(): # DragonAllowGas # if we detect gas pedal pressed, we do not want OP to apply gas or brake # gasPressed code from interface.py - if CS.CP.enableGasInterceptor: - # use interceptor values to disengage on pedal press - gasPressed = CS.pedal_gas > 15 - else: - gasPressed = CS.pedal_gas > 0 + # if CS.CP.enableGasInterceptor: + # # use interceptor values to disengage on pedal press + # gasPressed = CS.pedal_gas > 15 + # else: + # gasPressed = CS.pedal_gas > 0 - if self.dragon_allow_gas and gasPressed: - apply_accel = 0 - apply_gas = 0 + # if self.dragon_allow_gas and gasPressed: + # 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):