Galaxy radar gate fix

Previously showed radartakeoffs and Human like lane changes to
non-radar cars.
This commit is contained in:
whoisdomi
2026-07-21 15:52:41 -05:00
parent 28fcba8471
commit 894eae7090
2 changed files with 15 additions and 0 deletions
@@ -42,6 +42,7 @@ const VEHICLE_SETTING_MAKES = {
SNGHack: ["Lexus", "Toyota"],
ToyotaAutoHold: ["Lexus", "Toyota"],
}
const RADAR_REQUIRED_KEYS = new Set(["HumanLaneChanges", "RadarTakeoffs"])
// Plain variables — scheduling/routing flags that must NOT be reactive
let syncScheduled = false
@@ -103,6 +104,7 @@ function isVehicleSettingVisible(section, param) {
function isSettingVisible(section, param) {
// This policy controls Galaxy rendering only; hidden params retain their stored values.
if (HIDDEN_SETTING_KEYS.has(param.key) || !isVehicleSettingVisible(section, param)) return false
if (RADAR_REQUIRED_KEYS.has(param.key) && !state.values.HasRadar) return false
if (state.values[GALAXY_DEVELOPER_MODE_KEY]) return true
return section.name === "Favorites" || param.settings_tier === "simple"
}
+13
View File
@@ -3075,6 +3075,17 @@ def _get_starpilot_toggles_snapshot():
except Exception:
return {}
def _get_has_radar():
cp_bytes = _safe_params_get_live_raw("CarParamsPersistent")
if not cp_bytes:
return False
try:
with car.CarParams.from_bytes(cp_bytes) as cp:
return not bool(getattr(cp, "radarUnavailable", False))
except Exception:
return False
def _get_hardware_snapshot_items():
starpilot_toggles = _get_starpilot_toggles_snapshot()
@@ -4697,6 +4708,8 @@ def setup(app):
except Exception:
result[key] = None
result["HasRadar"] = _get_has_radar()
return jsonify(_sanitize_json_value(result)), 200
@app.route("/api/params/defaults", methods=["GET"])