From cadba6f36ceeef03b7aa4dd7ae653daa9e59e224 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 22 Sep 2021 22:25:08 -0700 Subject: [PATCH] add booted onroad flag (#22318) old-commit-hash: e9e490a72933e81a190d7d7bbb94661864270885 --- selfdrive/common/params.cc | 1 + selfdrive/thermald/thermald.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/selfdrive/common/params.cc b/selfdrive/common/params.cc index c7ef3c0fcb..22a1bf922e 100644 --- a/selfdrive/common/params.cc +++ b/selfdrive/common/params.cc @@ -128,6 +128,7 @@ std::unordered_map keys = { {"ApiCache_Owner", PERSISTENT}, {"ApiCache_NavDestinations", PERSISTENT}, {"AthenadPid", PERSISTENT}, + {"BootedOnroad", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_OFF}, {"CalibrationParams", PERSISTENT}, {"CarBatteryCapacity", PERSISTENT}, {"CarParams", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT | CLEAR_ON_IGNITION_ON}, diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 06eeecd7da..9668a96b68 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -198,8 +198,9 @@ def thermald_thread(): # TODO: use PI controller for UNO controller = PIController(k_p=0, k_i=2e-3, neg_limit=-80, pos_limit=0, rate=(1 / DT_TRML)) + # Leave flag for loggerd to indicate device was left onroad if params.get_bool("IsOnroad"): - cloudlog.event("onroad flag not cleared") + params.put_bool("BootedOnroad", True) # CPR3 logging if EON: