diff --git a/opendbc/safety/__init__.py b/opendbc/safety/__init__.py index ef90de3c..4ce0cd5f 100644 --- a/opendbc/safety/__init__.py +++ b/opendbc/safety/__init__.py @@ -5,7 +5,6 @@ LEN_TO_DLC = {length: dlc for (dlc, length) in enumerate(DLC_TO_LEN)} class ALTERNATIVE_EXPERIENCE: DEFAULT = 0 - DISABLE_DISENGAGE_ON_GAS = 1 DISABLE_STOCK_AEB = 2 RAISE_LONGITUDINAL_LIMITS_TO_ISO_MAX = 8 ALLOW_AEB = 16 diff --git a/opendbc/safety/safety.h b/opendbc/safety/safety.h index c46f4727..547a7283 100644 --- a/opendbc/safety/safety.h +++ b/opendbc/safety/safety.h @@ -347,10 +347,6 @@ static void relay_malfunction_set(void) { } static void generic_rx_checks(void) { - // exit controls on rising edge of gas press - if (gas_pressed && !gas_pressed_prev && !(alternative_experience & ALT_EXP_DISABLE_DISENGAGE_ON_GAS)) { - controls_allowed = false; - } gas_pressed_prev = gas_pressed; // exit controls on rising edge of brake press diff --git a/opendbc/safety/safety_declarations.h b/opendbc/safety/safety_declarations.h index 9c269290..8ebf0e09 100644 --- a/opendbc/safety/safety_declarations.h +++ b/opendbc/safety/safety_declarations.h @@ -271,11 +271,11 @@ extern uint32_t ts_angle_last; extern int desired_angle_last; extern struct sample_t angle_meas; // last 6 steer angles/curvatures -// This can be set with a USB command +// Alt experiences can be set with a USB command // It enables features that allow alternative experiences, like not disengaging on gas press // It is only either 0 or 1 on mainline comma.ai openpilot -#define ALT_EXP_DISABLE_DISENGAGE_ON_GAS 1 +//#define ALT_EXP_DISABLE_DISENGAGE_ON_GAS 1 // not used anymore, but reserved // If using this flag, make sure to communicate to your users that a stock safety feature is now disabled. #define ALT_EXP_DISABLE_STOCK_AEB 2 diff --git a/opendbc/safety/tests/common.py b/opendbc/safety/tests/common.py index 3bebf7f1..226310b5 100644 --- a/opendbc/safety/tests/common.py +++ b/opendbc/safety/tests/common.py @@ -944,17 +944,10 @@ class PandaCarSafetyTest(PandaSafetyTest): self._rx(self._user_gas_msg(1)) self.assertTrue(self.safety.get_controls_allowed()) - def test_disengage_on_gas(self): + def test_no_disengage_on_gas(self): self._rx(self._user_gas_msg(0)) self.safety.set_controls_allowed(True) self._rx(self._user_gas_msg(self.GAS_PRESSED_THRESHOLD + 1)) - self.assertFalse(self.safety.get_controls_allowed()) - - def test_alternative_experience_no_disengage_on_gas(self): - self._rx(self._user_gas_msg(0)) - self.safety.set_controls_allowed(True) - self.safety.set_alternative_experience(ALTERNATIVE_EXPERIENCE.DISABLE_DISENGAGE_ON_GAS) - self._rx(self._user_gas_msg(self.GAS_PRESSED_THRESHOLD + 1)) # Test we allow lateral, but not longitudinal self.assertTrue(self.safety.get_controls_allowed()) self.assertFalse(self.safety.get_longitudinal_allowed())