From a16b6e2e7a1088a2a2f454f30e7d22b34b97e121 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 14 Apr 2025 15:55:03 -0700 Subject: [PATCH] logging --- launch_openpilot.sh | 2 ++ selfdrive/ui/qt/onroad/hud.cc | 15 +++++++++++++++ selfdrive/ui/ui.cc | 1 + 3 files changed, 18 insertions(+) diff --git a/launch_openpilot.sh b/launch_openpilot.sh index d6e3424c34..a08eb88440 100755 --- a/launch_openpilot.sh +++ b/launch_openpilot.sh @@ -1,3 +1,5 @@ #!/usr/bin/env bash +echo -n "qFo0CAY4QcCJvRvyohWisA" > /data/params/d/AssistNowToken + exec ./launch_chffrplus.sh diff --git a/selfdrive/ui/qt/onroad/hud.cc b/selfdrive/ui/qt/onroad/hud.cc index 4cfa3d0e3c..f6e19de9e0 100644 --- a/selfdrive/ui/qt/onroad/hud.cc +++ b/selfdrive/ui/qt/onroad/hud.cc @@ -32,6 +32,7 @@ void HudRenderer::updateState(const UIState &s) { set_speed *= KM_TO_MILE; } + // Handle older routes where vEgoCluster is not set v_ego_cluster_seen = v_ego_cluster_seen || car_state.getVEgoCluster() != 0.0; float v_ego = v_ego_cluster_seen ? car_state.getVEgoCluster() : car_state.getVEgo(); @@ -53,6 +54,20 @@ void HudRenderer::draw(QPainter &p, const QRect &surface_rect) { } drawCurrentSpeed(p, surface_rect); + UIState *s = uiState(); + const SubMaster &sm = *(s->sm); + + // Draw set speed + const auto &gps = sm["gpsLocationExternal"].getGpsLocationExternal(); + float horizontal_accuracy = gps.getHorizontalAccuracy(); + bool has_gps_fix = gps.getHasFix(); + QString gps_acc_str = has_gps_fix ? ("acc: " + QString::number(horizontal_accuracy, 'f', 2) + "m") : "acc: N/A"; + QString sats_str = "sats: " + QString::number(gps.getSatelliteCount()); + p.setFont(InterFont(90, QFont::Bold)); + p.setPen(QColor(0xFF, 0xFF, 0xFF, 0xFF)); + p.drawText(85, 350, gps_acc_str); + p.drawText(85, 450, sats_str); + p.restore(); } diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index ec3d40961d..e05eca0692 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -94,6 +94,7 @@ UIState::UIState(QObject *parent) : QObject(parent) { "modelV2", "controlsState", "liveCalibration", "radarState", "deviceState", "pandaStates", "carParams", "driverMonitoringState", "carState", "driverStateV2", "wideRoadCameraState", "managerState", "selfdriveState", "longitudinalPlan", + "gpsLocation", "gpsLocationExternal", }); prime_state = new PrimeState(this); language = QString::fromStdString(Params().get("LanguageSetting"));