pull/29076/head
Shane Smiskol 2 years ago
parent 0b8d35b132
commit 25abbbf176
  1. 14
      selfdrive/ui/qt/maps/map.cc

@ -237,13 +237,18 @@ void MapWindow::updateState(const UIState &s) {
// an invalid navInstruction packet with a nav destination is only possible if: // an invalid navInstruction packet with a nav destination is only possible if:
// - API exception/no internet // - API exception/no internet
// - route response is empty // - route response is empty
auto dest = coordinate_from_param("NavDestination");
routing_problem = !sm.valid("navInstruction") && dest.has_value(); //this kind of works, but we need an additional check somewhere to monitor the param
// auto dest = coordinate_from_param("NavDestination");
// routing_problem = !sm.valid("navInstruction") && dest.has_value();
if (sm.valid("navInstruction")) { if (sm.valid("navInstruction")) {
auto i = sm["navInstruction"].getNavInstruction(); auto i = sm["navInstruction"].getNavInstruction();
map_eta->updateETA(i.getTimeRemaining(), i.getTimeRemainingTypical(), i.getDistanceRemaining()); map_eta->updateETA(i.getTimeRemaining(), i.getTimeRemainingTypical(), i.getDistanceRemaining());
// auto dest = coordinate_from_param("NavDestination");
routing_problem = false;
if (locationd_valid) { if (locationd_valid) {
m_map->setPitch(MAX_PITCH); // TODO: smooth pitching based on maneuver distance m_map->setPitch(MAX_PITCH); // TODO: smooth pitching based on maneuver distance
map_instructions->updateInstructions(i); map_instructions->updateInstructions(i);
@ -260,6 +265,11 @@ void MapWindow::updateState(const UIState &s) {
if (sm.rcv_frame("navRoute") != route_rcv_frame) { if (sm.rcv_frame("navRoute") != route_rcv_frame) {
qWarning() << "Updating navLayer with new route"; qWarning() << "Updating navLayer with new route";
auto route = sm["navRoute"].getNavRoute(); auto route = sm["navRoute"].getNavRoute();
auto dest = coordinate_from_param("NavDestination");
if (route.getCoordinates().size() == 0 && dest.has_value()) {
routing_problem = true;
}
auto route_points = capnp_coordinate_list_to_collection(route.getCoordinates()); auto route_points = capnp_coordinate_list_to_collection(route.getCoordinates());
QMapbox::Feature feature(QMapbox::Feature::LineStringType, route_points, {}, {}); QMapbox::Feature feature(QMapbox::Feature::LineStringType, route_points, {}, {});
QVariantMap navSource; QVariantMap navSource;

Loading…
Cancel
Save