diff --git a/common/libcommon.a b/common/libcommon.a index 64e32724f..b9a6e64ec 100644 Binary files a/common/libcommon.a and b/common/libcommon.a differ diff --git a/common/params_keys.h b/common/params_keys.h index c9b685562..a95750b46 100644 --- a/common/params_keys.h +++ b/common/params_keys.h @@ -144,9 +144,9 @@ inline static std::unordered_map keys = { {"AdjacentPathMetrics", {PERSISTENT, BOOL, "0", "0", 3}}, {"AdvancedCustomUI", {PERSISTENT, BOOL, "0", "0", 2}}, {"AdvancedLateralTune", {PERSISTENT, BOOL, "1", "0", 2}}, - {"AdvancedLongitudinalTune", {PERSISTENT, BOOL, "0", "0", 3}}, + {"AdvancedLongitudinalTune", {PERSISTENT, BOOL, "1", "0", 3}}, {"AggressiveFollow", {PERSISTENT, FLOAT, "1.25", "1.25", 2}}, - {"AggressiveFollowHigh", {PERSISTENT, FLOAT, "1.25", "1.25", 2}}, + {"AggressiveFollowHigh", {PERSISTENT, FLOAT, "1.0", "1.0", 2}}, {"AggressiveJerkAcceleration", {PERSISTENT, FLOAT, "50.0", "50.0", 3}}, {"AggressiveJerkDanger", {PERSISTENT, FLOAT, "100.0", "100.0", 3}}, {"AggressiveJerkDeceleration", {PERSISTENT, FLOAT, "50.0", "50.0", 3}}, @@ -182,7 +182,7 @@ inline static std::unordered_map keys = { {"CELead", {PERSISTENT, BOOL, "0", "0", 1}}, {"CEModelStopTime", {PERSISTENT, FLOAT, "7.0", "0.0", 2}}, {"CESignalLaneDetection", {PERSISTENT, BOOL, "1", "0", 2}}, - {"CESignalSpeed", {PERSISTENT, FLOAT, "55.0", "0.0", 2}}, + {"CESignalSpeed", {PERSISTENT, FLOAT, "0.0", "0.0", 2}}, {"CESlowerLead", {PERSISTENT, BOOL, "0", "0", 1}}, {"CESpeed", {PERSISTENT, FLOAT, "0.0", "0.0", 1}}, {"CESpeedLead", {PERSISTENT, FLOAT, "0.0", "0.0", 1}}, @@ -389,7 +389,7 @@ inline static std::unordered_map keys = { {"ReduceLateralAccelerationSnow", {PERSISTENT, INT, "0", "0", 2}}, {"RefuseVolume", {PERSISTENT, INT, "101", "101", 2}}, {"RelaxedFollow", {PERSISTENT, FLOAT, "1.75", "1.75", 2}}, - {"RelaxedFollowHigh", {PERSISTENT, FLOAT, "1.75", "1.75", 2}}, + {"RelaxedFollowHigh", {PERSISTENT, FLOAT, "1.4", "1.4", 2}}, {"RelaxedJerkAcceleration", {PERSISTENT, FLOAT, "50.0", "50.0", 3}}, {"RelaxedJerkDanger", {PERSISTENT, FLOAT, "100.0", "100.0", 3}}, {"RelaxedJerkDeceleration", {PERSISTENT, FLOAT, "50.0", "50.0", 3}}, @@ -450,7 +450,7 @@ inline static std::unordered_map keys = { {"SpeedLimitsFiltered", {PERSISTENT | DONT_LOG, JSON, "[]", "[]"}}, {"SpeedLimitSources", {PERSISTENT, BOOL, "0", "0", 3}}, {"StandardFollow", {PERSISTENT, FLOAT, "1.45", "1.45", 2}}, - {"StandardFollowHigh", {PERSISTENT, FLOAT, "1.45", "1.45", 2}}, + {"StandardFollowHigh", {PERSISTENT, FLOAT, "1.2", "1.2", 2}}, {"StandardJerkAcceleration", {PERSISTENT, FLOAT, "50.0", "50.0", 3}}, {"StandardJerkDanger", {PERSISTENT, FLOAT, "100.0", "100.0", 3}}, {"StandardJerkDeceleration", {PERSISTENT, FLOAT, "50.0", "50.0", 3}}, diff --git a/common/params_pyx.so b/common/params_pyx.so index 69c1fd0d6..0ca74f24b 100755 Binary files a/common/params_pyx.so and b/common/params_pyx.so differ diff --git a/panda/board/obj/body_h7.bin.signed b/panda/board/obj/body_h7.bin.signed index bee3f771e..dc9b2dc8f 100644 Binary files a/panda/board/obj/body_h7.bin.signed and b/panda/board/obj/body_h7.bin.signed differ diff --git a/panda/board/obj/body_h7/bootstub.elf b/panda/board/obj/body_h7/bootstub.elf index 86fca1358..8bbe69656 100755 Binary files a/panda/board/obj/body_h7/bootstub.elf and b/panda/board/obj/body_h7/bootstub.elf differ diff --git a/panda/board/obj/body_h7/main.bin b/panda/board/obj/body_h7/main.bin index a56c9564f..57b59fccd 100755 Binary files a/panda/board/obj/body_h7/main.bin and b/panda/board/obj/body_h7/main.bin differ diff --git a/panda/board/obj/body_h7/main.elf b/panda/board/obj/body_h7/main.elf index 7dfa39ee9..5c1d76f86 100755 Binary files a/panda/board/obj/body_h7/main.elf and b/panda/board/obj/body_h7/main.elf differ diff --git a/panda/board/obj/bootstub.body_h7.bin b/panda/board/obj/bootstub.body_h7.bin index 79946cc7b..9b656dba4 100755 Binary files a/panda/board/obj/bootstub.body_h7.bin and b/panda/board/obj/bootstub.body_h7.bin differ diff --git a/panda/board/obj/bootstub.panda.bin b/panda/board/obj/bootstub.panda.bin index 0501ae3b9..e0b06791a 100755 Binary files a/panda/board/obj/bootstub.panda.bin and b/panda/board/obj/bootstub.panda.bin differ diff --git a/panda/board/obj/bootstub.panda_h7.bin b/panda/board/obj/bootstub.panda_h7.bin index 7a5c7390a..901c15d75 100755 Binary files a/panda/board/obj/bootstub.panda_h7.bin and b/panda/board/obj/bootstub.panda_h7.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_remote.bin b/panda/board/obj/bootstub.panda_h7_remote.bin index 7a5c7390a..901c15d75 100755 Binary files a/panda/board/obj/bootstub.panda_h7_remote.bin and b/panda/board/obj/bootstub.panda_h7_remote.bin differ diff --git a/panda/board/obj/bootstub.panda_jungle_h7.bin b/panda/board/obj/bootstub.panda_jungle_h7.bin index ebea708ec..e00cf59a5 100755 Binary files a/panda/board/obj/bootstub.panda_jungle_h7.bin and b/panda/board/obj/bootstub.panda_jungle_h7.bin differ diff --git a/panda/board/obj/bootstub.panda_remote.bin b/panda/board/obj/bootstub.panda_remote.bin index 0501ae3b9..e0b06791a 100755 Binary files a/panda/board/obj/bootstub.panda_remote.bin and b/panda/board/obj/bootstub.panda_remote.bin differ diff --git a/panda/board/obj/gitversion.h b/panda/board/obj/gitversion.h index 8ff2431d5..c913f7043 100644 --- a/panda/board/obj/gitversion.h +++ b/panda/board/obj/gitversion.h @@ -1,2 +1,2 @@ extern const uint8_t gitversion[19]; -const uint8_t gitversion[19] = "DEV-58504c5a-DEBUG"; +const uint8_t gitversion[19] = "DEV-2dd436c4-DEBUG"; diff --git a/panda/board/obj/panda.bin.signed b/panda/board/obj/panda.bin.signed index 866f92da5..d220ebb77 100644 Binary files a/panda/board/obj/panda.bin.signed and b/panda/board/obj/panda.bin.signed differ diff --git a/panda/board/obj/panda/bootstub.elf b/panda/board/obj/panda/bootstub.elf index 5175fe188..0487e7f82 100755 Binary files a/panda/board/obj/panda/bootstub.elf and b/panda/board/obj/panda/bootstub.elf differ diff --git a/panda/board/obj/panda/main.bin b/panda/board/obj/panda/main.bin index a59feb7a0..95f4c823a 100755 Binary files a/panda/board/obj/panda/main.bin and b/panda/board/obj/panda/main.bin differ diff --git a/panda/board/obj/panda/main.elf b/panda/board/obj/panda/main.elf index 3eef13a51..f54fe970a 100755 Binary files a/panda/board/obj/panda/main.elf and b/panda/board/obj/panda/main.elf differ diff --git a/panda/board/obj/panda_h7.bin.signed b/panda/board/obj/panda_h7.bin.signed index 765eee17b..96acccc9c 100644 Binary files a/panda/board/obj/panda_h7.bin.signed and b/panda/board/obj/panda_h7.bin.signed differ diff --git a/panda/board/obj/panda_h7/bootstub.elf b/panda/board/obj/panda_h7/bootstub.elf index f3b15eaee..5ef758fb9 100755 Binary files a/panda/board/obj/panda_h7/bootstub.elf and b/panda/board/obj/panda_h7/bootstub.elf differ diff --git a/panda/board/obj/panda_h7/main.bin b/panda/board/obj/panda_h7/main.bin index bc6228475..c12fec4a0 100755 Binary files a/panda/board/obj/panda_h7/main.bin and b/panda/board/obj/panda_h7/main.bin differ diff --git a/panda/board/obj/panda_h7/main.elf b/panda/board/obj/panda_h7/main.elf index aa294e33e..a2668cce0 100755 Binary files a/panda/board/obj/panda_h7/main.elf and b/panda/board/obj/panda_h7/main.elf differ diff --git a/panda/board/obj/panda_h7_remote.bin.signed b/panda/board/obj/panda_h7_remote.bin.signed index e6657c8f1..5ca7accbf 100644 Binary files a/panda/board/obj/panda_h7_remote.bin.signed and b/panda/board/obj/panda_h7_remote.bin.signed differ diff --git a/panda/board/obj/panda_h7_remote/bootstub.elf b/panda/board/obj/panda_h7_remote/bootstub.elf index fc09614d1..002b546cd 100755 Binary files a/panda/board/obj/panda_h7_remote/bootstub.elf and b/panda/board/obj/panda_h7_remote/bootstub.elf differ diff --git a/panda/board/obj/panda_h7_remote/main.bin b/panda/board/obj/panda_h7_remote/main.bin index dff36afb8..63d5f911a 100755 Binary files a/panda/board/obj/panda_h7_remote/main.bin and b/panda/board/obj/panda_h7_remote/main.bin differ diff --git a/panda/board/obj/panda_h7_remote/main.elf b/panda/board/obj/panda_h7_remote/main.elf index cfa59b2c1..7a12e01d3 100755 Binary files a/panda/board/obj/panda_h7_remote/main.elf and b/panda/board/obj/panda_h7_remote/main.elf differ diff --git a/panda/board/obj/panda_jungle_h7.bin.signed b/panda/board/obj/panda_jungle_h7.bin.signed index e2ddcc050..2cb1ae0dd 100644 Binary files a/panda/board/obj/panda_jungle_h7.bin.signed and b/panda/board/obj/panda_jungle_h7.bin.signed differ diff --git a/panda/board/obj/panda_jungle_h7/bootstub.elf b/panda/board/obj/panda_jungle_h7/bootstub.elf index 7b3c32b48..22a6bffdf 100755 Binary files a/panda/board/obj/panda_jungle_h7/bootstub.elf and b/panda/board/obj/panda_jungle_h7/bootstub.elf differ diff --git a/panda/board/obj/panda_jungle_h7/main.bin b/panda/board/obj/panda_jungle_h7/main.bin index 6a141a5b9..4a879dd73 100755 Binary files a/panda/board/obj/panda_jungle_h7/main.bin and b/panda/board/obj/panda_jungle_h7/main.bin differ diff --git a/panda/board/obj/panda_jungle_h7/main.elf b/panda/board/obj/panda_jungle_h7/main.elf index 6f8af8f51..9006bed4d 100755 Binary files a/panda/board/obj/panda_jungle_h7/main.elf and b/panda/board/obj/panda_jungle_h7/main.elf differ diff --git a/panda/board/obj/panda_remote.bin.signed b/panda/board/obj/panda_remote.bin.signed index bfb044af5..486d5f8a9 100644 Binary files a/panda/board/obj/panda_remote.bin.signed and b/panda/board/obj/panda_remote.bin.signed differ diff --git a/panda/board/obj/panda_remote/bootstub.elf b/panda/board/obj/panda_remote/bootstub.elf index 3ec93878d..b620e6335 100755 Binary files a/panda/board/obj/panda_remote/bootstub.elf and b/panda/board/obj/panda_remote/bootstub.elf differ diff --git a/panda/board/obj/panda_remote/main.bin b/panda/board/obj/panda_remote/main.bin index 717e57bb3..3ffbf6018 100755 Binary files a/panda/board/obj/panda_remote/main.bin and b/panda/board/obj/panda_remote/main.bin differ diff --git a/panda/board/obj/panda_remote/main.elf b/panda/board/obj/panda_remote/main.elf index 07de0ca92..2d7508f23 100755 Binary files a/panda/board/obj/panda_remote/main.elf and b/panda/board/obj/panda_remote/main.elf differ diff --git a/panda/board/obj/version b/panda/board/obj/version index b10a71289..4547a0a2b 100644 --- a/panda/board/obj/version +++ b/panda/board/obj/version @@ -1 +1 @@ -DEV-58504c5a-DEBUG \ No newline at end of file +DEV-2dd436c4-DEBUG \ No newline at end of file diff --git a/selfdrive/pandad/pandad b/selfdrive/pandad/pandad index 6b7b87c8c..545fd74f2 100755 Binary files a/selfdrive/pandad/pandad and b/selfdrive/pandad/pandad differ diff --git a/selfdrive/ui/ui b/selfdrive/ui/ui index 080573835..c37cced8a 100755 Binary files a/selfdrive/ui/ui and b/selfdrive/ui/ui differ diff --git a/starpilot/common/starpilot_variables.py b/starpilot/common/starpilot_variables.py index bb5232fa9..6b75bad92 100644 --- a/starpilot/common/starpilot_variables.py +++ b/starpilot/common/starpilot_variables.py @@ -252,6 +252,18 @@ def normalize_legacy_car_model(car_model): normalized = LEGACY_CARMODEL_MIGRATIONS.get(car_model, car_model) return normalized +def default_ev_tuning_enabled(CP): + car_make = str(getattr(CP, "brand", "") or "") + car_model = normalize_legacy_car_model(getattr(CP, "carFingerprint", "")) or "" + + gm_ev_vehicle = car_make == "gm" and car_model in GM_EV_CAR + gm_ev_vehicle &= not (car_model.startswith("CHEVROLET_VOLT") and not car_model.endswith("_CC")) + gm_ev_vehicle &= car_model != "CHEVROLET_MALIBU_HYBRID_CC" + + ev_vehicle = gm_ev_vehicle or (car_make == "hyundai" and car_model in HYUNDAI_EV_CAR) + ev_vehicle |= getattr(CP, "transmissionType", None) == car.CarParams.TransmissionType.direct + return bool(ev_vehicle) + def get_starpilot_toggles(sm=messaging.SubMaster(["starpilotPlan"])): toggles = process_starpilot_toggles(sm["starpilotPlan"].starpilotToggles) @@ -515,11 +527,7 @@ class StarPilotVariables: toggle.use_custom_steerRatio = bool(round(toggle.steerRatio, 2) != round(steerRatio, 2)) and not toggle.force_auto_tune or toggle.force_auto_tune_off advanced_longitudinal_tuning = toggle.openpilot_longitudinal and self.get_value("AdvancedLongitudinalTune") - gm_ev_vehicle = toggle.car_make == "gm" and CP.carFingerprint in GM_EV_CAR - gm_ev_vehicle &= not (toggle.car_model.startswith("CHEVROLET_VOLT") and not toggle.car_model.endswith("_CC")) - gm_ev_vehicle &= toggle.car_model != "CHEVROLET_MALIBU_HYBRID_CC" - ev_vehicle = gm_ev_vehicle or (toggle.car_make == "hyundai" and CP.carFingerprint in HYUNDAI_EV_CAR) - ev_vehicle |= CP.transmissionType == car.CarParams.TransmissionType.direct + ev_vehicle = default_ev_tuning_enabled(CP) if self.params_raw.get("EVTuning") in (None, b""): self.params.put_bool("EVTuning", ev_vehicle) diff --git a/starpilot/system/the_pond/the_pond.py b/starpilot/system/the_pond/the_pond.py index 20e510e63..d1e72e4cf 100644 --- a/starpilot/system/the_pond/the_pond.py +++ b/starpilot/system/the_pond/the_pond.py @@ -41,7 +41,7 @@ from panda import Panda from openpilot.starpilot.assets.theme_manager import HOLIDAY_THEME_PATH, THEME_COMPONENT_PARAMS from openpilot.starpilot.common.starpilot_utilities import delete_file, get_lock_status, run_cmd from openpilot.starpilot.common.starpilot_variables import ACTIVE_THEME_PATH, ERROR_LOGS_PATH, EXCLUDED_KEYS, LEGACY_STARPILOT_PARAM_RENAMES, RESOURCES_REPO, SCREEN_RECORDINGS_PATH, THEME_SAVE_PATH,\ - update_starpilot_toggles + default_ev_tuning_enabled, update_starpilot_toggles from openpilot.starpilot.common.testing_grounds import ( DEFAULT_TESTING_GROUND_VARIANT as SHARED_DEFAULT_TESTING_GROUND_VARIANT, TESTING_GROUND_VARIANT_LABELS as SHARED_TESTING_GROUND_VARIANT_LABELS, @@ -351,6 +351,7 @@ class ParamsCompat: return getattr(self._params, attr) _params_raw = Params(return_defaults=True) +_params_live_raw = Params() _params_memory_raw = Params(memory=True) def _normalize_default_value(value): @@ -624,6 +625,25 @@ _TROUBLESHOOT_ADVANCED_LONGITUDINAL_KEYS = [ "VEgoStopping", ] +_RUNTIME_DEFAULT_STOCK_KEYS = { + "SteerDelay": "SteerDelayStock", + "SteerFriction": "SteerFrictionStock", + "SteerOffset": "SteerOffsetStock", + "SteerKP": "SteerKPStock", + "SteerLatAccel": "SteerLatAccelStock", + "SteerRatio": "SteerRatioStock", + "LongitudinalActuatorDelay": "LongitudinalActuatorDelayStock", + "StartAccel": "StartAccelStock", + "StopAccel": "StopAccelStock", + "StoppingDecelRate": "StoppingDecelRateStock", + "VEgoStarting": "VEgoStartingStock", + "VEgoStopping": "VEgoStoppingStock", +} + +_RUNTIME_DEFAULT_ZERO_OK_KEYS = { + "SteerOffset", +} + _TROUBLESHOOT_SECTION_DEFINITIONS = [ { "id": "personality_settings", @@ -1664,7 +1684,9 @@ def _get_default_param_values(): for key, default_val, _, _ in starpilot_default_params if key not in EXCLUDED_KEYS } - return _cached_default_values + default_values = dict(_cached_default_values) + default_values.update(_get_runtime_default_param_overrides()) + return default_values def _coerce_param_value(raw_value, value_type): safe_type = value_type or str @@ -1708,6 +1730,12 @@ def _safe_params_get(key, encoding=None, default=None): except Exception: return default +def _safe_params_get_live_raw(key, default=None, block=False): + try: + return _params_live_raw.get(key, block=block) + except Exception: + return default + def _safe_params_get_bool(key, default=False): try: return params.get_bool(key) @@ -1723,6 +1751,59 @@ def _is_blank_param_raw(raw_value): return len(raw_value.strip()) == 0 return False +def _has_runtime_default_value(key, raw_value): + if _is_blank_param_raw(raw_value): + return False + + if key in _RUNTIME_DEFAULT_ZERO_OK_KEYS: + return True + + try: + if isinstance(raw_value, bytes): + raw_value = raw_value.decode("utf-8", errors="replace") + return float(str(raw_value).strip()) != 0.0 + except Exception: + return True + +def _get_runtime_default_param_overrides(): + overrides = {} + + for key, stock_key in _RUNTIME_DEFAULT_STOCK_KEYS.items(): + stock_raw = _safe_params_get_live_raw(stock_key) + if _has_runtime_default_value(key, stock_raw): + overrides[key] = stock_raw + overrides[stock_key] = stock_raw + + cp_bytes = _safe_params_get_live_raw("CarParamsPersistent") + if not cp_bytes: + return overrides + + try: + with car.CarParams.from_bytes(cp_bytes) as cp: + overrides["EVTuning"] = default_ev_tuning_enabled(cp) + + car_param_defaults = { + "SteerDelay": getattr(cp, "steerActuatorDelay", None), + "SteerRatio": getattr(cp, "steerRatio", None), + "LongitudinalActuatorDelay": getattr(cp, "longitudinalActuatorDelay", None), + "StartAccel": getattr(cp, "startAccel", None), + "StopAccel": getattr(cp, "stopAccel", None), + "StoppingDecelRate": getattr(cp, "stoppingDecelRate", None), + "VEgoStarting": getattr(cp, "vEgoStarting", None), + "VEgoStopping": getattr(cp, "vEgoStopping", None), + } + + for key, value in car_param_defaults.items(): + if key in overrides or value is None: + continue + if key not in _RUNTIME_DEFAULT_ZERO_OK_KEYS and float(value) == 0.0: + continue + overrides[key] = value + except Exception: + pass + + return overrides + def _get_current_param_value(key, value_type): safe_type = value_type or str if safe_type == bool: @@ -1831,15 +1912,23 @@ def _resolve_troubleshoot_current_value(key, value_type, default_values): safe_type = value_type or str if safe_type == bool: + raw_value = _safe_params_get_live_raw(key) + if not _is_blank_param_raw(raw_value): + return _coerce_param_value(raw_value, safe_type) + + default_raw_value = default_values.get(key) + if not _is_blank_param_raw(default_raw_value): + return _coerce_param_value(default_raw_value, safe_type) + return _safe_params_get_bool(key) - raw_value = _safe_params_get(key) + raw_value = _safe_params_get_live_raw(key) if not _is_blank_param_raw(raw_value): return _coerce_param_value(raw_value, safe_type) stock_key = f"{key}Stock" if stock_key in default_values: - stock_raw_value = _safe_params_get(stock_key) + stock_raw_value = _safe_params_get_live_raw(stock_key) if not _is_blank_param_raw(stock_raw_value): return _coerce_param_value(stock_raw_value, safe_type) @@ -1857,7 +1946,7 @@ def _resolve_troubleshoot_default_value(key, value_type, default_values): stock_key = f"{key}Stock" if stock_key in default_values: - stock_current_raw = _safe_params_get(stock_key) + stock_current_raw = _safe_params_get_live_raw(stock_key) if not _is_blank_param_raw(stock_current_raw): return _coerce_param_value(stock_current_raw, safe_type) @@ -1911,6 +2000,109 @@ def _get_fingerprint_snapshot_text(): return cp_fingerprint return "Unknown" +def _snapshot_bool_text(value): + if value is True: + return "Yes" + if value is False: + return "No" + return "Unavailable" + +def _get_starpilot_toggles_snapshot(): + raw_toggles = _safe_params_get_live_raw("StarPilotToggles") + if not raw_toggles: + return {} + + try: + if isinstance(raw_toggles, bytes): + raw_toggles = raw_toggles.decode("utf-8", errors="replace") + parsed = json.loads(str(raw_toggles) or "{}") + return parsed if isinstance(parsed, dict) else {} + except Exception: + return {} + +def _get_hardware_snapshot_items(): + starpilot_toggles = _get_starpilot_toggles_snapshot() + + has_bsm = None + has_openpilot_longitudinal = None + has_pedal = False + has_radar = None + has_sdsu = bool(starpilot_toggles.get("has_sdsu", False)) + has_sng = None + has_zss = bool(starpilot_toggles.get("has_zss", False)) + can_use_pedal = None + can_use_sdsu = None + is_bolt = False + + cp_bytes = _safe_params_get_live_raw("CarParamsPersistent") + if cp_bytes: + try: + with car.CarParams.from_bytes(cp_bytes) as cp: + car_fingerprint = str(getattr(cp, "carFingerprint", "") or "") + car_make = str(getattr(cp, "brand", "") or getattr(cp, "carName", "") or "") + + has_bsm = bool(getattr(cp, "enableBsm", False)) + has_openpilot_longitudinal = bool(getattr(cp, "openpilotLongitudinalControl", False)) + has_pedal = bool(getattr(cp, "enableGasInterceptorDEPRECATED", False)) + has_radar = not bool(getattr(cp, "radarUnavailable", False)) + has_sdsu = bool(starpilot_toggles.get("has_sdsu", has_sdsu)) + has_sng = bool(getattr(cp, "autoResumeSng", False)) + has_zss = bool(starpilot_toggles.get("has_zss", has_zss)) + is_bolt = car_fingerprint.startswith("CHEVROLET_BOLT") + + if PC and (car_make == "mock" or car_fingerprint == "MOCK"): + fallback_make = str(starpilot_toggles.get("car_make", "") or "gm") + fallback_model = str(starpilot_toggles.get("car_model", "") or "CHEVROLET_BOLT_ACC_2022_2023") + has_pedal = bool(starpilot_toggles.get("has_pedal", True)) + has_sdsu = bool(starpilot_toggles.get("has_sdsu", has_sdsu)) + has_zss = bool(starpilot_toggles.get("has_zss", has_zss)) + is_bolt = fallback_model.startswith("CHEVROLET_BOLT") + if fallback_make == "gm" and has_openpilot_longitudinal is None: + has_openpilot_longitudinal = True + except Exception: + pass + elif PC: + fallback_model = str(starpilot_toggles.get("car_model", "") or "CHEVROLET_BOLT_ACC_2022_2023") + has_pedal = bool(starpilot_toggles.get("has_pedal", True)) + has_sdsu = bool(starpilot_toggles.get("has_sdsu", has_sdsu)) + has_zss = bool(starpilot_toggles.get("has_zss", has_zss)) + is_bolt = fallback_model.startswith("CHEVROLET_BOLT") + + if can_use_pedal is None: + can_use_pedal = has_pedal or is_bolt + if can_use_sdsu is None: + can_use_sdsu = has_sdsu + + fpcp_bytes = _safe_params_get_live_raw("StarPilotCarParamsPersistent") + if fpcp_bytes: + try: + fpcp = messaging.log_from_bytes(fpcp_bytes, custom.StarPilotCarParams) + can_use_pedal = bool(getattr(fpcp, "canUsePedal", can_use_pedal)) + can_use_sdsu = bool(getattr(fpcp, "canUseSDSU", can_use_sdsu)) + except Exception: + pass + + detected = [] + if has_pedal: + detected.append("comma Pedal") + if has_sdsu: + detected.append("SDSU") + if has_zss: + detected.append("ZSS") + + return [ + {"id": "hardware_detected", "label": "Hardware Detected", "value": ", ".join(detected) if detected else "None", "resettable": False}, + {"id": "pedal_detected", "label": "Pedal Detected", "value": _snapshot_bool_text(has_pedal), "resettable": False}, + {"id": "sdsu_detected", "label": "SDSU Detected", "value": _snapshot_bool_text(has_sdsu), "resettable": False}, + {"id": "zss_detected", "label": "ZSS Detected", "value": _snapshot_bool_text(has_zss), "resettable": False}, + {"id": "blind_spot_support", "label": "Blind Spot Support", "value": _snapshot_bool_text(has_bsm), "resettable": False}, + {"id": "openpilot_longitudinal_support", "label": "openpilot Longitudinal Support", "value": _snapshot_bool_text(has_openpilot_longitudinal), "resettable": False}, + {"id": "pedal_support", "label": "comma Pedal Support", "value": _snapshot_bool_text(can_use_pedal), "resettable": False}, + {"id": "radar_support", "label": "Radar Support", "value": _snapshot_bool_text(has_radar), "resettable": False}, + {"id": "sdsu_support", "label": "SDSU Support", "value": _snapshot_bool_text(can_use_sdsu), "resettable": False}, + {"id": "sng_support", "label": "Stop-and-Go Support", "value": _snapshot_bool_text(has_sng), "resettable": False}, + ] + def _build_troubleshoot_section_payload(section_definition, value_types, default_values, layout_metadata): section_keys = [str(key).strip() for key in section_definition.get("keys", []) if str(key).strip()] items = [] @@ -1967,6 +2159,7 @@ def _build_troubleshoot_payload(): "value": _get_fingerprint_snapshot_text(), "resettable": False, }, + *_get_hardware_snapshot_items(), { "id": "driving_model", "label": "Current Driving Model", @@ -2883,11 +3076,7 @@ def setup(app): @app.route("/api/params/defaults", methods=["GET"]) def get_default_params(): allowed_keys, types = _get_param_type_info() - defaults_lookup = { - key: default_val - for key, default_val, _, _ in starpilot_default_params - if key in allowed_keys - } + defaults_lookup = _get_default_param_values() result = {} for key in allowed_keys: diff --git a/system/camerad/camerad b/system/camerad/camerad index a76b26ff2..d8eb9e336 100755 Binary files a/system/camerad/camerad and b/system/camerad/camerad differ diff --git a/system/loggerd/bootlog b/system/loggerd/bootlog index 05f83baf4..575858e1b 100755 Binary files a/system/loggerd/bootlog and b/system/loggerd/bootlog differ diff --git a/system/loggerd/encoderd b/system/loggerd/encoderd index 23488e20a..78d3cec51 100755 Binary files a/system/loggerd/encoderd and b/system/loggerd/encoderd differ diff --git a/system/loggerd/loggerd b/system/loggerd/loggerd index ed3fa1b4c..0f3b34c04 100755 Binary files a/system/loggerd/loggerd and b/system/loggerd/loggerd differ