from cereal import log from common.basedir import BASEDIR from common.params import Params from common.realtime import sec_since_boot, DT_TRML from common.numpy_fast import clip, interp from common.filter_simple import FirstOrderFilter from selfdrive.version import terms_version, training_version from selfdrive.swaglog import cloudlog import selfdrive.messaging as messaging from selfdrive.loggerd.config import get_available_percent from selfdrive.kegman_conf import kegman_conf kegman = kegman_conf() from selfdrive.pandad import get_expected_version FW_VERSION = get_expected_version() ThermalStatus = log.ThermalData.ThermalStatus CURRENT_TAU = 15. # 15s time constant DAYS_NO_CONNECTIVITY_MAX = 7 # do not allow to engage after a week without internet DAYS_NO_CONNECTIVITY_PROMPT = 4 # send an offroad prompt after 4 days with no internet with open(BASEDIR + "/selfdrive/controls/lib/alerts_offroad.json") as json_file: OFFROAD_ALERTS = json.load(json_file) def read_tz(x): with open("/sys/devices/virtual/thermal/thermal_zone%d/temp" % x) as f: ret = max(0, int(f.read())) return ret
from cereal import log from common.android import ANDROID, get_network_type, get_network_strength from common.basedir import BASEDIR from common.params import Params, put_nonblocking from common.realtime import sec_since_boot, DT_TRML from common.numpy_fast import clip, interp from common.filter_simple import FirstOrderFilter from selfdrive.version import terms_version, training_version from selfdrive.swaglog import cloudlog import cereal.messaging as messaging import cereal.messaging_arne as messaging_arne from selfdrive.loggerd.config import get_available_percent from selfdrive.pandad import get_expected_version from selfdrive.thermald.power_monitoring import PowerMonitoring, get_battery_capacity, get_battery_status, get_battery_current, get_battery_voltage, get_usb_present FW_SIGNATURE = get_expected_version() ThermalStatus = log.ThermalData.ThermalStatus NetworkType = log.ThermalData.NetworkType NetworkStrength = log.ThermalData.NetworkStrength CURRENT_TAU = 15. # 15s time constant CPU_TEMP_TAU = 5. # 5s time constant DAYS_NO_CONNECTIVITY_MAX = 14 # do not allow to engage after a week without internet DAYS_NO_CONNECTIVITY_PROMPT = 8 # send an offroad prompt after 4 days with no internet DISCONNECT_TIMEOUT = 5. # wait 5 seconds before going offroad after disconnect so you get an alert LEON = False last_eon_fan_val = None with open(BASEDIR + "/selfdrive/controls/lib/alerts_offroad.json") as json_file: