diff --git a/common/params.py b/common/params.py index ad4b1ac62..3747b6e35 100755 --- a/common/params.py +++ b/common/params.py @@ -79,7 +79,7 @@ keys = { "Version": [TxType.PERSISTENT], #dragonpilot config "DragonEnableDashcam": [TxType.PERSISTENT], - "DragonEnableDriverMonitor": [TxType.PERSISTENT], + "DragonDisableDriverSafetyCheck": [TxType.PERSISTENT], "DragonAutoShutdownAt": [TxType.PERSISTENT], "DragonTempDisableSteerOnSignal": [TxType.PERSISTENT], } diff --git a/selfdrive/controls/lib/driver_monitor.py b/selfdrive/controls/lib/driver_monitor.py index 3c036cf9f..3de48036d 100644 --- a/selfdrive/controls/lib/driver_monitor.py +++ b/selfdrive/controls/lib/driver_monitor.py @@ -145,7 +145,7 @@ class DriverStatus(): not (standstill and self.awareness - self.step_change <= self.threshold_prompt): self.awareness = max(self.awareness - self.step_change, -0.1) - if params.get("DragonEnableDriverMonitor") == "1": + if params.get("DragonDisableDriverSafetyCheck") == "1": alert = None if self.awareness <= 0.: # terminal red alert: disengagement required diff --git a/selfdrive/dragonpilot/dragonconf/__init__.py b/selfdrive/dragonpilot/dragonconf/__init__.py index cbc39390b..c9429015b 100644 --- a/selfdrive/dragonpilot/dragonconf/__init__.py +++ b/selfdrive/dragonpilot/dragonconf/__init__.py @@ -7,8 +7,8 @@ file = '/data/dragonpilot.json' default_conf = { 'DragonEnableDashcam': '1', - 'DragonEnableDriverMonitor': '1', - 'DragonAutoShutdownAt': '1800', # shutdown after 30 mins + 'DragonDisableDriverSafetyCheck': '1', + 'DragonAutoShutdownAt': '30', # in minute 'DragonTempDisableSteerOnSignal': '0', } @@ -40,10 +40,11 @@ def dragonpilot_set_params(params): json_update_needed = True config.pop(key, None) - # write to json if it's been updated + # write to json if update needed if json_update_needed: write_json_config(config) # set params for key, val in config.items(): - params.put(key, str(val)) + if params.get(key) is None: + params.put(key, str(val)) diff --git a/selfdrive/dragonpilot/shutdownd/shutdownd.py b/selfdrive/dragonpilot/shutdownd/shutdownd.py index 13eb20183..b99b1b287 100644 --- a/selfdrive/dragonpilot/shutdownd/shutdownd.py +++ b/selfdrive/dragonpilot/shutdownd/shutdownd.py @@ -32,7 +32,7 @@ def get_shutdown_val(): if val is None: return None else: - return int(val) + return int(val)*60 # convert to seconds if __name__ == "__main__":