nav: show warning for routing problems (#29055)

* all my debugging stuff

* this works

* add comment

* bb navd

* navInstruction is valid when we get a non-empty route response

* now don't need this

* stash

* big cleanup

* clean up

* clean up

* debug

* final clean up

* one line

* flip order

* update translations

* is this simpler?
old-commit-hash: 5b368a67ea
beeps
Shane Smiskol 2 years ago committed by GitHub
parent 3a41e53b08
commit a7b32acd4b
  1. 16
      selfdrive/ui/qt/maps/map.cc
  2. 1
      selfdrive/ui/qt/maps/map.h
  3. 4
      selfdrive/ui/translations/main_de.ts
  4. 4
      selfdrive/ui/translations/main_ja.ts
  5. 4
      selfdrive/ui/translations/main_ko.ts
  6. 4
      selfdrive/ui/translations/main_pt-BR.ts
  7. 4
      selfdrive/ui/translations/main_zh-CHS.ts
  8. 4
      selfdrive/ui/translations/main_zh-CHT.ts

@ -211,7 +211,14 @@ void MapWindow::updateState(const UIState &s) {
}
initLayers();
setError(locationd_valid ? "" : tr("Waiting for GPS"));
if (!locationd_valid) {
setError(tr("Waiting for GPS"));
} else if (routing_problem) {
setError(tr("Waiting for internet"));
} else {
setError("");
}
if (locationd_valid) {
// Update current location marker
auto point = coordinate_to_collection(*last_position);
@ -236,6 +243,12 @@ void MapWindow::updateState(const UIState &s) {
}
if (sm.updated("navInstruction")) {
// an invalid navInstruction packet with a nav destination is only possible if:
// - API exception/no internet
// - route response is empty
auto dest = coordinate_from_param("NavDestination");
routing_problem = !sm.valid("navInstruction") && dest.has_value();
if (sm.valid("navInstruction")) {
auto i = sm["navInstruction"].getNavInstruction();
map_eta->updateETA(i.getTimeRemaining(), i.getTimeRemainingTypical(), i.getDistanceRemaining());
@ -393,6 +406,7 @@ void MapWindow::offroadTransition(bool offroad) {
if (offroad) {
clearRoute();
uiState()->scene.navigate_on_openpilot = false;
routing_problem = false;
} else {
auto dest = coordinate_from_param("NavDestination");
emit requestVisible(dest.has_value());

@ -101,6 +101,7 @@ private:
std::optional<float> last_bearing;
FirstOrderFilter velocity_filter;
bool locationd_valid = false;
bool routing_problem = false;
QWidget *map_overlay;
QLabel *error;

@ -403,6 +403,10 @@
<source>Waiting for GPS</source>
<translation>Warten auf GPS</translation>
</message>
<message>
<source>Waiting for internet</source>
<translation type="unfinished">Auf Internet warten</translation>
</message>
</context>
<context>
<name>MultiOptionDialog</name>

@ -402,6 +402,10 @@
<source>Waiting for GPS</source>
<translation>GPS信号を探しています</translation>
</message>
<message>
<source>Waiting for internet</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MultiOptionDialog</name>

@ -402,6 +402,10 @@
<source>Waiting for GPS</source>
<translation>GPS </translation>
</message>
<message>
<source>Waiting for internet</source>
<translation type="unfinished"> </translation>
</message>
</context>
<context>
<name>MultiOptionDialog</name>

@ -403,6 +403,10 @@
<source>Waiting for GPS</source>
<translation>Esperando por GPS</translation>
</message>
<message>
<source>Waiting for internet</source>
<translation type="unfinished">Esperando pela internet</translation>
</message>
</context>
<context>
<name>MultiOptionDialog</name>

@ -402,6 +402,10 @@
<source>Waiting for GPS</source>
<translation> GPS</translation>
</message>
<message>
<source>Waiting for internet</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MultiOptionDialog</name>

@ -402,6 +402,10 @@
<source>Waiting for GPS</source>
<translation> GPS</translation>
</message>
<message>
<source>Waiting for internet</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MultiOptionDialog</name>

Loading…
Cancel
Save