thermald: remove panda disconnect logic (#23526)
* thermald: remove panda disconnect logic * keep thatpull/23529/head
parent
e72eb1d472
commit
ed23177898
|
@ -8,7 +8,6 @@ cdef extern from "selfdrive/common/params.h":
|
|||
cpdef enum ParamKeyType:
|
||||
PERSISTENT
|
||||
CLEAR_ON_MANAGER_START
|
||||
CLEAR_ON_PANDA_DISCONNECT
|
||||
CLEAR_ON_IGNITION_ON
|
||||
CLEAR_ON_IGNITION_OFF
|
||||
ALL
|
||||
|
|
|
@ -24,14 +24,6 @@ class TestParams(unittest.TestCase):
|
|||
self.params.put("CarParams", st)
|
||||
assert self.params.get("CarParams") == st
|
||||
|
||||
def test_params_get_cleared_panda_disconnect(self):
|
||||
self.params.put("CarParams", "test")
|
||||
self.params.put("DongleId", "cb38263377b873ee")
|
||||
assert self.params.get("CarParams") == b"test"
|
||||
self.params.clear_all(ParamKeyType.CLEAR_ON_PANDA_DISCONNECT)
|
||||
assert self.params.get("CarParams") is None
|
||||
assert self.params.get("DongleId") is not None
|
||||
|
||||
def test_params_get_cleared_manager_start(self):
|
||||
self.params.put("CarParams", "test")
|
||||
self.params.put("DongleId", "cb38263377b873ee")
|
||||
|
|
|
@ -88,12 +88,12 @@ std::unordered_map<std::string, uint32_t> keys = {
|
|||
{"AthenadUploadQueue", PERSISTENT},
|
||||
{"CalibrationParams", PERSISTENT},
|
||||
{"CarBatteryCapacity", PERSISTENT},
|
||||
{"CarParams", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT | CLEAR_ON_IGNITION_ON},
|
||||
{"CarParamsCache", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT},
|
||||
{"CarVin", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT | CLEAR_ON_IGNITION_ON},
|
||||
{"CarParams", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON},
|
||||
{"CarParamsCache", CLEAR_ON_MANAGER_START},
|
||||
{"CarVin", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON},
|
||||
{"CommunityFeaturesToggle", PERSISTENT},
|
||||
{"CompletedTrainingVersion", PERSISTENT},
|
||||
{"ControlsReady", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT | CLEAR_ON_IGNITION_ON},
|
||||
{"ControlsReady", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON},
|
||||
{"CurrentRoute", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON},
|
||||
{"DisablePowerDown", PERSISTENT},
|
||||
{"DisableRadar_Allow", PERSISTENT},
|
||||
|
@ -163,7 +163,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
|||
{"ApiCache_NavDestinations", PERSISTENT},
|
||||
{"ApiCache_Owner", PERSISTENT},
|
||||
{"Offroad_CarUnrecognized", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON},
|
||||
{"Offroad_ChargeDisabled", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT},
|
||||
{"Offroad_ChargeDisabled", CLEAR_ON_MANAGER_START },
|
||||
{"Offroad_ConnectivityNeeded", CLEAR_ON_MANAGER_START},
|
||||
{"Offroad_ConnectivityNeededPrompt", CLEAR_ON_MANAGER_START},
|
||||
{"Offroad_InvalidTime", CLEAR_ON_MANAGER_START},
|
||||
|
|
|
@ -6,10 +6,9 @@
|
|||
enum ParamKeyType {
|
||||
PERSISTENT = 0x02,
|
||||
CLEAR_ON_MANAGER_START = 0x04,
|
||||
CLEAR_ON_PANDA_DISCONNECT = 0x08,
|
||||
CLEAR_ON_IGNITION_ON = 0x10,
|
||||
CLEAR_ON_IGNITION_OFF = 0x20,
|
||||
DONT_LOG = 0x40,
|
||||
CLEAR_ON_IGNITION_ON = 0x08,
|
||||
CLEAR_ON_IGNITION_OFF = 0x10,
|
||||
DONT_LOG = 0x20,
|
||||
ALL = 0xFFFFFFFF
|
||||
};
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import cereal.messaging as messaging
|
|||
from cereal import log
|
||||
from common.filter_simple import FirstOrderFilter
|
||||
from common.numpy_fast import interp
|
||||
from common.params import Params, ParamKeyType
|
||||
from common.params import Params
|
||||
from common.realtime import DT_TRML, sec_since_boot
|
||||
from common.dict_helpers import strip_deprecated_keys
|
||||
from selfdrive.controls.lib.alertmanager import set_offroad_alert
|
||||
|
@ -185,7 +185,6 @@ def thermald_thread() -> NoReturn:
|
|||
|
||||
current_filter = FirstOrderFilter(0., CURRENT_TAU, DT_TRML)
|
||||
temp_filter = FirstOrderFilter(0., TEMP_TAU, DT_TRML)
|
||||
pandaState_prev = None
|
||||
should_start_prev = False
|
||||
in_car = False
|
||||
handle_fan = None
|
||||
|
@ -194,7 +193,6 @@ def thermald_thread() -> NoReturn:
|
|||
|
||||
params = Params()
|
||||
power_monitor = PowerMonitoring()
|
||||
no_panda_cnt = 0
|
||||
|
||||
HARDWARE.initialize_hardware()
|
||||
thermal_config = HARDWARE.get_thermal_config()
|
||||
|
@ -213,15 +211,7 @@ def thermald_thread() -> NoReturn:
|
|||
if pandaStates is not None and len(pandaStates.pandaStates) > 0:
|
||||
pandaState = pandaStates.pandaStates[0]
|
||||
|
||||
# If we lose connection to the panda, wait 5 seconds before going offroad
|
||||
if pandaState.pandaType == log.PandaState.PandaType.unknown:
|
||||
no_panda_cnt += 1
|
||||
if no_panda_cnt > DISCONNECT_TIMEOUT / DT_TRML:
|
||||
if onroad_conditions["ignition"]:
|
||||
cloudlog.error("Lost panda connection while onroad")
|
||||
onroad_conditions["ignition"] = False
|
||||
else:
|
||||
no_panda_cnt = 0
|
||||
if pandaState.pandaType != log.PandaState.PandaType.unknown:
|
||||
onroad_conditions["ignition"] = pandaState.ignitionLine or pandaState.ignitionCan
|
||||
|
||||
in_car = pandaState.harnessStatus != log.PandaState.HarnessStatus.notConnected
|
||||
|
@ -242,13 +232,6 @@ def thermald_thread() -> NoReturn:
|
|||
setup_eon_fan()
|
||||
handle_fan = handle_fan_eon
|
||||
|
||||
# Handle disconnect
|
||||
if pandaState_prev is not None:
|
||||
if pandaState.pandaType == log.PandaState.PandaType.unknown and \
|
||||
pandaState_prev.pandaType != log.PandaState.PandaType.unknown:
|
||||
params.clear_all(ParamKeyType.CLEAR_ON_PANDA_DISCONNECT)
|
||||
pandaState_prev = pandaState
|
||||
|
||||
# these are expensive calls. update every 10s
|
||||
if (count % int(10. / DT_TRML)) == 0:
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue