long manuevers
This commit is contained in:
@@ -156,13 +156,41 @@ export function LongitudinalManeuvers() {
|
||||
<p><strong>Popup Text:</strong> ${state.data.uiText1 || ""} ${state.data.uiText2 ? `| ${state.data.uiText2}` : ""}</p>
|
||||
</div>
|
||||
|
||||
<div class="longManeuverStatusGrid">
|
||||
${statusLine("openpilot Long", state.data.support?.openpilotLongitudinalControl ? "Yes" : "No")}
|
||||
${statusLine("Full Stop + Go", state.data.support?.fullStopAndGo ? "Yes" : "No")}
|
||||
${statusLine("Auto Resume", state.data.support?.autoResumeFromStop ? "Yes" : "No")}
|
||||
${statusLine("Resume Assist", state.data.support?.requiresResumeAssist ? "Yes" : "No")}
|
||||
${statusLine("Expected Zero", state.data.support?.expectedToReachZero ? "Yes" : "No")}
|
||||
${statusLine("Min Enable", Number.isFinite(Number(state.data.support?.minEnableSpeed)) ? `${Number(state.data.support.minEnableSpeed).toFixed(2)} m/s` : "n/a")}
|
||||
${statusLine("Stop Accel", Number.isFinite(Number(state.data.support?.stopAccel)) ? `${Number(state.data.support.stopAccel).toFixed(2)} m/s²` : "n/a")}
|
||||
</div>
|
||||
|
||||
${(state.data.caveats || []).length ? html`
|
||||
<div class="longManeuverInstructions">
|
||||
<h3>Platform Caveats</h3>
|
||||
<ul>
|
||||
${(state.data.caveats || []).map((line) => html`<li>${line}</li>`)}
|
||||
</ul>
|
||||
</div>
|
||||
` : ""}
|
||||
|
||||
${(state.data.skippedManeuvers || []).length ? html`
|
||||
<div class="longManeuverInstructions">
|
||||
<h3>Expected Skips</h3>
|
||||
<ul>
|
||||
${(state.data.skippedManeuvers || []).map((line) => html`<li>${line}</li>`)}
|
||||
</ul>
|
||||
</div>
|
||||
` : ""}
|
||||
|
||||
<div class="longManeuverInstructions">
|
||||
<h3>Quick Guide</h3>
|
||||
<ol>
|
||||
<li>Find a large, empty, straight road or lot with no traffic.</li>
|
||||
<li>Press <strong>Start / Arm</strong> here, then engage openpilot with SET.</li>
|
||||
<li>Keep full supervision and be ready to disengage at all times.</li>
|
||||
<li>For GM pedal-long cars, the suite runs both pedal-only and pedal+paddle phases automatically.</li>
|
||||
<li>Review the platform caveats before starting. Low-speed maneuvers can be skipped automatically on cars that do not fully stop.</li>
|
||||
<li>When the status says complete, collect logs and generate your HTML report.</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
@@ -40,6 +40,7 @@ from openpilot.system.hardware import HARDWARE, PC
|
||||
from openpilot.system.hardware.hw import Paths
|
||||
from openpilot.system.loggerd.deleter import PRESERVE_ATTR_NAME, PRESERVE_ATTR_VALUE, PRESERVE_COUNT
|
||||
from openpilot.system.version import get_build_metadata
|
||||
from openpilot.tools.longitudinal_maneuvers.capabilities import get_longitudinal_maneuver_support
|
||||
from panda import Panda
|
||||
|
||||
from openpilot.starpilot.assets.theme_manager import HOLIDAY_THEME_PATH, THEME_COMPONENT_PARAMS
|
||||
@@ -2824,6 +2825,9 @@ def _default_longitudinal_maneuver_status():
|
||||
"uiText1": "Long Maneuvers",
|
||||
"uiText2": "",
|
||||
"updatedAtSec": 0.0,
|
||||
"support": {},
|
||||
"caveats": [],
|
||||
"skippedManeuvers": [],
|
||||
"history": [],
|
||||
}
|
||||
|
||||
@@ -2868,15 +2872,32 @@ def _append_longitudinal_maneuver_history(status, line):
|
||||
status["history"] = history[-120:]
|
||||
return status
|
||||
|
||||
def _get_longitudinal_maneuver_support_snapshot():
|
||||
cp_bytes = _safe_params_get_live_raw("CarParamsPersistent")
|
||||
if not cp_bytes:
|
||||
return None
|
||||
|
||||
try:
|
||||
with car.CarParams.from_bytes(cp_bytes) as cp:
|
||||
return get_longitudinal_maneuver_support(cp).to_dict()
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
def _serialize_longitudinal_maneuver_status(status):
|
||||
updated_at = _safe_float(status.get("updatedAtSec"), 0.0)
|
||||
age_seconds = max(0.0, time.time() - updated_at) if updated_at > 0 else None
|
||||
mode_enabled = params.get_bool("LongitudinalManeuverMode")
|
||||
paddle_mode = params.get("LongitudinalManeuverPaddleMode", encoding="utf-8") or str(status.get("paddleMode") or "auto")
|
||||
support = _get_longitudinal_maneuver_support_snapshot() or status.get("support") or {}
|
||||
caveats = support.get("caveats", status.get("caveats") or [])
|
||||
skipped_maneuvers = support.get("skippedManeuvers", status.get("skippedManeuvers") or [])
|
||||
return {
|
||||
**status,
|
||||
"modeEnabled": mode_enabled,
|
||||
"paddleMode": paddle_mode,
|
||||
"support": support,
|
||||
"caveats": list(caveats),
|
||||
"skippedManeuvers": list(skipped_maneuvers),
|
||||
"isOnroad": params.get_bool("IsOnroad"),
|
||||
"isEngaged": params.get_bool("IsEngaged"),
|
||||
"updatedAgeSec": age_seconds,
|
||||
|
||||
Reference in New Issue
Block a user