From 4af9ea276b44b92c7d8471d190d3e370b4ae33d6 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 20 Oct 2020 14:04:18 -0700 Subject: [PATCH] prevent snapshot while onroad (#2366) * prevent snapshot while onroad * fix offroad check old-commit-hash: 4c4b53bedafb966e813b98ab6522726204e213e7 --- selfdrive/camerad/snapshot/snapshot.py | 2 +- selfdrive/thermald/thermald.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/camerad/snapshot/snapshot.py b/selfdrive/camerad/snapshot/snapshot.py index 317618c0b2..addf293cc0 100755 --- a/selfdrive/camerad/snapshot/snapshot.py +++ b/selfdrive/camerad/snapshot/snapshot.py @@ -19,7 +19,7 @@ def snapshot(): params = Params() front_camera_allowed = int(params.get("RecordFront")) - if params.get("IsTakingSnapshot") == b"1": + if params.get("IsOffroad") != b"1" or params.get("IsTakingSnapshot") == b"1": return None params.put("IsTakingSnapshot", "1") diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 196e4fce9f..96bebdea8e 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -13,7 +13,7 @@ from cereal import log from common.filter_simple import FirstOrderFilter from common.hardware import EON, HARDWARE, TICI from common.numpy_fast import clip, interp -from common.params import Params, put_nonblocking +from common.params import Params from common.realtime import DT_TRML, sec_since_boot from selfdrive.controls.lib.alertmanager import set_offroad_alert from selfdrive.loggerd.config import get_available_percent @@ -379,7 +379,7 @@ def thermald_thread(): if startup_conditions["ignition"]: cloudlog.event("Startup blocked", startup_conditions=startup_conditions) if should_start_prev or (count == 0): - put_nonblocking("IsOffroad", "1") + params.put("IsOffroad", "1") started_ts = None if off_ts is None: