diff --git a/selfdrive/car/chrysler/interface.py b/selfdrive/car/chrysler/interface.py index ec041f2f3a..ab5bf50f46 100755 --- a/selfdrive/car/chrysler/interface.py +++ b/selfdrive/car/chrysler/interface.py @@ -93,6 +93,7 @@ class CarInterface(CarInterfaceBase): def _update(self, c): ret = self.CS.update(self.cp, self.cp_cam) + self.sp_update_params() buttonEvents = [] diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 869ab3b0a7..1f82c63587 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -251,6 +251,7 @@ class CarInterface(CarInterfaceBase): # returns a car.CarState def _update(self, c): ret = self.CS.update(self.cp, self.cp_cam, self.cp_loopback) + self.sp_update_params() buttonEvents = [] diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index bc8e7be4a4..629514628a 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -311,6 +311,7 @@ class CarInterface(CarInterfaceBase): # returns a car.CarState def _update(self, c): ret = self.CS.update(self.cp, self.cp_cam, self.cp_body) + self.sp_update_params() buttonEvents = [] diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index bc7600dd77..646f9dc12d 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -323,6 +323,7 @@ class CarInterface(CarInterfaceBase): def _update(self, c): ret = self.CS.update(self.cp, self.cp_cam) + self.sp_update_params() buttonEvents = [] diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index b9bc662ebb..e6c37c9124 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -98,6 +98,8 @@ class CarInterfaceBase(ABC): self.mads_event_lock = True self.gap_button_counter = 0 self.experimental_mode_hold = False + self.experimental_mode = self.param_s.get_bool("ExperimentalMode") + self._frame = 0 @staticmethod def get_pid_accel_limits(CP, current_speed, cruise_speed): @@ -419,14 +421,14 @@ class CarInterfaceBase(ABC): def toggle_exp_mode(self, gap_pressed): if not self.CP.openpilotLongitudinalControl: return None - experimental_mode = self.param_s.get_bool("ExperimentalMode") if gap_pressed: if not self.experimental_mode_hold: self.gap_button_counter += 1 if self.gap_button_counter > 50: self.gap_button_counter = 0 self.experimental_mode_hold = True - self.param_s.put_bool("ExperimentalMode", not experimental_mode) + self.experimental_mode = self.param_s.get_bool("ExperimentalMode") + self.param_s.put_bool("ExperimentalMode", not self.experimental_mode) else: self.gap_button_counter = 0 self.experimental_mode_hold = False @@ -494,6 +496,12 @@ class CarInterfaceBase(ABC): return events, cs_out + def sp_update_params(self): + self._frame += 1 + if self._frame % 300 == 0: + self._frame = 0 + self.experimental_mode = self.param_s.get_bool("ExperimentalMode") + class RadarInterfaceBase(ABC): def __init__(self, CP): self.rcp = None diff --git a/selfdrive/car/mazda/interface.py b/selfdrive/car/mazda/interface.py index 07fe8b7ebc..3d1e24ebac 100755 --- a/selfdrive/car/mazda/interface.py +++ b/selfdrive/car/mazda/interface.py @@ -57,6 +57,7 @@ class CarInterface(CarInterfaceBase): # returns a car.CarState def _update(self, c): ret = self.CS.update(self.cp, self.cp_cam) + self.sp_update_params() buttonEvents = [] diff --git a/selfdrive/car/nissan/interface.py b/selfdrive/car/nissan/interface.py index 580b34c842..dbead09803 100644 --- a/selfdrive/car/nissan/interface.py +++ b/selfdrive/car/nissan/interface.py @@ -44,6 +44,7 @@ class CarInterface(CarInterfaceBase): # returns a car.CarState def _update(self, c): ret = self.CS.update(self.cp, self.cp_adas, self.cp_cam) + self.sp_update_params() buttonEvents = [] #be = car.CarState.ButtonEvent.new_message() diff --git a/selfdrive/car/subaru/interface.py b/selfdrive/car/subaru/interface.py index 7dfd9c367e..f756bf3b4d 100644 --- a/selfdrive/car/subaru/interface.py +++ b/selfdrive/car/subaru/interface.py @@ -111,6 +111,7 @@ class CarInterface(CarInterfaceBase): def _update(self, c): ret = self.CS.update(self.cp, self.cp_cam, self.cp_body) + self.sp_update_params() buttonEvents = [] diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 9b888d9326..c42e352117 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -244,6 +244,7 @@ class CarInterface(CarInterfaceBase): # returns a car.CarState def _update(self, c): ret = self.CS.update(self.cp, self.cp_cam) + self.sp_update_params() buttonEvents = [] diff --git a/selfdrive/car/volkswagen/interface.py b/selfdrive/car/volkswagen/interface.py index e6347bc5b0..f8a83aafb3 100644 --- a/selfdrive/car/volkswagen/interface.py +++ b/selfdrive/car/volkswagen/interface.py @@ -223,6 +223,7 @@ class CarInterface(CarInterfaceBase): # returns a car.CarState def _update(self, c): ret = self.CS.update(self.cp, self.cp_cam, self.cp_ext, self.CP.transmissionType) + self.sp_update_params() buttonEvents = []