移除油門不取消 OP 選項

This commit is contained in:
Rick Lan
2019-07-02 11:04:36 +10:00
parent d8665f682b
commit d55c7ef173
5 changed files with 7 additions and 17 deletions
-3
View File
@@ -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
+3 -5
View File
@@ -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
-3
View File
@@ -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
+4 -5
View File
@@ -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
@@ -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):