diff --git a/Dockerfile.openpilot_base b/Dockerfile.openpilot_base index bca2ac4c66..b05b180bd1 100644 --- a/Dockerfile.openpilot_base +++ b/Dockerfile.openpilot_base @@ -28,6 +28,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ liblzma-dev \ libomp-dev \ libopencv-dev \ + libqt5sql5-sqlite \ + libqt5svg5-dev \ libsqlite3-dev \ libssl-dev \ libsystemd-dev \ @@ -40,7 +42,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ python-dev \ qml-module-qtquick2 \ qt5-default \ + qtlocation5-dev \ qtmultimedia5-dev \ + qtpositioning5-dev \ qtwebengine5-dev \ sudo \ valgrind \ diff --git a/SConstruct b/SConstruct index 138c6ab3f5..2e38e8bb44 100644 --- a/SConstruct +++ b/SConstruct @@ -128,6 +128,7 @@ else: libpath = [ "#phonelibs/snpe/x86_64-linux-clang", "#phonelibs/libyuv/x64/lib", + "#phonelibs/mapbox-gl-native-qt/x86_64", "#cereal", "#selfdrive/common", "/usr/lib", @@ -190,6 +191,7 @@ env = Environment( "#phonelibs/android_system_core/include", "#phonelibs/linux/include", "#phonelibs/snpe/include", + "#phonelibs/mapbox-gl-native-qt/include", "#phonelibs/nanovg", "#phonelibs/qrcode", "#phonelibs", @@ -272,7 +274,7 @@ Export('envCython') # Qt build environment qt_env = env.Clone() -qt_modules = ["Widgets", "Gui", "Core", "Network", "Concurrent", "Multimedia", "Quick", "Qml", "QuickWidgets"] +qt_modules = ["Widgets", "Gui", "Core", "Network", "Concurrent", "Multimedia", "Quick", "Qml", "QuickWidgets", "Location", "Positioning"] if arch != "aarch64": qt_modules += ["DBus"] diff --git a/phonelibs/mapbox-gl-native-qt/.gitattributes b/phonelibs/mapbox-gl-native-qt/.gitattributes new file mode 100644 index 0000000000..323c737ba1 --- /dev/null +++ b/phonelibs/mapbox-gl-native-qt/.gitattributes @@ -0,0 +1,2 @@ +x86_64 filter=lfs diff=lfs merge=lfs -text +larch64 filter=lfs diff=lfs merge=lfs -text diff --git a/phonelibs/mapbox-gl-native-qt/build.sh b/phonelibs/mapbox-gl-native-qt/build.sh new file mode 100755 index 0000000000..a0ba3b741b --- /dev/null +++ b/phonelibs/mapbox-gl-native-qt/build.sh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fedf4467798fe51266ed754f3da7420ebd13c1b67d9c7528743ec323fcea2b77 +size 191 diff --git a/phonelibs/mapbox-gl-native-qt/include/QMapbox b/phonelibs/mapbox-gl-native-qt/include/QMapbox new file mode 100644 index 0000000000..00d7d3b825 --- /dev/null +++ b/phonelibs/mapbox-gl-native-qt/include/QMapbox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f967d81c93b1e5495180c1a2c9da9649863744f5815decf613b2286cf334aae +size 23 diff --git a/phonelibs/mapbox-gl-native-qt/include/QMapboxGL b/phonelibs/mapbox-gl-native-qt/include/QMapboxGL new file mode 100644 index 0000000000..c8514c3fed --- /dev/null +++ b/phonelibs/mapbox-gl-native-qt/include/QMapboxGL @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:220807f0445a1de75f0bc0cb558aeb0f610bc2099b31614c03e54b448cf29ddc +size 25 diff --git a/phonelibs/mapbox-gl-native-qt/include/qmapbox.hpp b/phonelibs/mapbox-gl-native-qt/include/qmapbox.hpp new file mode 100644 index 0000000000..f536e64f00 --- /dev/null +++ b/phonelibs/mapbox-gl-native-qt/include/qmapbox.hpp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:922c5af1a229514ec0bb264226d974c539eea34f0e28e7cb261df16c3964fa35 +size 4299 diff --git a/phonelibs/mapbox-gl-native-qt/include/qmapboxgl.hpp b/phonelibs/mapbox-gl-native-qt/include/qmapboxgl.hpp new file mode 100644 index 0000000000..44d32a8324 --- /dev/null +++ b/phonelibs/mapbox-gl-native-qt/include/qmapboxgl.hpp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec1afdc07127362f66466cfd5cc9125150ab88a4b179d57ce8e80d4653c97080 +size 8511 diff --git a/phonelibs/mapbox-gl-native-qt/x86_64/libqmapboxgl.so b/phonelibs/mapbox-gl-native-qt/x86_64/libqmapboxgl.so new file mode 100755 index 0000000000..102dfb5d7a --- /dev/null +++ b/phonelibs/mapbox-gl-native-qt/x86_64/libqmapboxgl.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be9380835de2c7f9e5437d3bcd31d64f7d43e669516e43846bb701c5c31c89b7 +size 10215888 diff --git a/phonelibs/qt-plugins/.gitattributes b/phonelibs/qt-plugins/.gitattributes new file mode 100644 index 0000000000..e74eb23bf4 --- /dev/null +++ b/phonelibs/qt-plugins/.gitattributes @@ -0,0 +1 @@ +x86_64 filter=lfs diff=lfs merge=lfs -text diff --git a/phonelibs/qt-plugins/build_qtlocation.sh b/phonelibs/qt-plugins/build_qtlocation.sh new file mode 100755 index 0000000000..9a1a1d817a --- /dev/null +++ b/phonelibs/qt-plugins/build_qtlocation.sh @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8921fc959cd4e4820f0a779b1f51e61d0e40c3bea07b3ef2439ee85181f7de0d +size 178 diff --git a/phonelibs/qt-plugins/x86_64/geoservices/libqtgeoservices_mapbox.so b/phonelibs/qt-plugins/x86_64/geoservices/libqtgeoservices_mapbox.so new file mode 100755 index 0000000000..3fed7acdf5 --- /dev/null +++ b/phonelibs/qt-plugins/x86_64/geoservices/libqtgeoservices_mapbox.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d00791691ec3d2a3e0ed99c9b65ef5b3df21cdd6c3df3b1274ed5e5ea49bbe8 +size 12163664 diff --git a/selfdrive/assets/images/triangle.svg b/selfdrive/assets/images/triangle.svg new file mode 100644 index 0000000000..f3a8db44b7 --- /dev/null +++ b/selfdrive/assets/images/triangle.svg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aaf9a1967365f2c641bf7b54a409e32842cee0bfded7ebb01b1a95c4ac9f0154 +size 2163 diff --git a/selfdrive/assets/navigation/direction_arrive.png b/selfdrive/assets/navigation/direction_arrive.png new file mode 100644 index 0000000000..f8c5bdc2d8 --- /dev/null +++ b/selfdrive/assets/navigation/direction_arrive.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae17f4c1896c88a6d520f1acdca99ab23d4ce1140a500b64bea3185041f8ecd9 +size 1246 diff --git a/selfdrive/assets/navigation/direction_arrive_left.png b/selfdrive/assets/navigation/direction_arrive_left.png new file mode 100644 index 0000000000..6f59ab3711 --- /dev/null +++ b/selfdrive/assets/navigation/direction_arrive_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:86a2eaf6070d6b93df385945bd7f4a6e9bb78b7cc42eb5b7ef9a9b6c075c80ce +size 1581 diff --git a/selfdrive/assets/navigation/direction_arrive_right.png b/selfdrive/assets/navigation/direction_arrive_right.png new file mode 100644 index 0000000000..318e041339 --- /dev/null +++ b/selfdrive/assets/navigation/direction_arrive_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:398f30c89e396bb4bdbac1ba6dfe292f6e3278923e14113e705f4d0591671f32 +size 1528 diff --git a/selfdrive/assets/navigation/direction_arrive_straight.png b/selfdrive/assets/navigation/direction_arrive_straight.png new file mode 100644 index 0000000000..f8c5bdc2d8 --- /dev/null +++ b/selfdrive/assets/navigation/direction_arrive_straight.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae17f4c1896c88a6d520f1acdca99ab23d4ce1140a500b64bea3185041f8ecd9 +size 1246 diff --git a/selfdrive/assets/navigation/direction_close.png b/selfdrive/assets/navigation/direction_close.png new file mode 100644 index 0000000000..0e9e478d45 --- /dev/null +++ b/selfdrive/assets/navigation/direction_close.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e23cac9bec0de20f9632d19618be9b05eedb010c6e23b0ba7a8e3cc8225f64e +size 865 diff --git a/selfdrive/assets/navigation/direction_continue.png b/selfdrive/assets/navigation/direction_continue.png new file mode 100644 index 0000000000..ce2c42c43d --- /dev/null +++ b/selfdrive/assets/navigation/direction_continue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:008cf037b8713c710eacd1129973119faa2527ab1c19aee5340a16dc0659df8a +size 1063 diff --git a/selfdrive/assets/navigation/direction_continue_left.png b/selfdrive/assets/navigation/direction_continue_left.png new file mode 100644 index 0000000000..438532ee29 --- /dev/null +++ b/selfdrive/assets/navigation/direction_continue_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:579d6a27e062779d41beb9320abf5797bc8ec81de1f355a4197c3b3ee0766f28 +size 1400 diff --git a/selfdrive/assets/navigation/direction_continue_right.png b/selfdrive/assets/navigation/direction_continue_right.png new file mode 100644 index 0000000000..4ee7ebc3b4 --- /dev/null +++ b/selfdrive/assets/navigation/direction_continue_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4010c8122af918dbdb50e88629adbf79f7733f022bba263e6f44f6ffae3e7a5 +size 1371 diff --git a/selfdrive/assets/navigation/direction_continue_slight_left.png b/selfdrive/assets/navigation/direction_continue_slight_left.png new file mode 100644 index 0000000000..29f4440460 --- /dev/null +++ b/selfdrive/assets/navigation/direction_continue_slight_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89041889817454869d98adfb5a16fae33596c038d5484ec734fe3a5cc532c45c +size 1334 diff --git a/selfdrive/assets/navigation/direction_continue_slight_right.png b/selfdrive/assets/navigation/direction_continue_slight_right.png new file mode 100644 index 0000000000..755935b84c --- /dev/null +++ b/selfdrive/assets/navigation/direction_continue_slight_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e691dd43947c9430fcd73e6bede94aa5fd8995e9303eba53cc0ac589a7c9f106 +size 1347 diff --git a/selfdrive/assets/navigation/direction_continue_straight.png b/selfdrive/assets/navigation/direction_continue_straight.png new file mode 100644 index 0000000000..ce2c42c43d --- /dev/null +++ b/selfdrive/assets/navigation/direction_continue_straight.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:008cf037b8713c710eacd1129973119faa2527ab1c19aee5340a16dc0659df8a +size 1063 diff --git a/selfdrive/assets/navigation/direction_continue_uturn.png b/selfdrive/assets/navigation/direction_continue_uturn.png new file mode 100644 index 0000000000..ff9d97893f --- /dev/null +++ b/selfdrive/assets/navigation/direction_continue_uturn.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e02ac2720f12f9373ae2d86d91fffb6203e18aba04b493bd6f41d2953a11cbc9 +size 1780 diff --git a/selfdrive/assets/navigation/direction_depart.png b/selfdrive/assets/navigation/direction_depart.png new file mode 100644 index 0000000000..aa4e4f7115 --- /dev/null +++ b/selfdrive/assets/navigation/direction_depart.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f83214c1fa6aba33ca3e1fe29db09733a275efe19864866b9edecbb59abb171 +size 1234 diff --git a/selfdrive/assets/navigation/direction_depart_left.png b/selfdrive/assets/navigation/direction_depart_left.png new file mode 100644 index 0000000000..76937eb5d3 --- /dev/null +++ b/selfdrive/assets/navigation/direction_depart_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:459fe6410e061542876fa7de93efaf901d15937f891e801e1b93f8270e750130 +size 1613 diff --git a/selfdrive/assets/navigation/direction_depart_right.png b/selfdrive/assets/navigation/direction_depart_right.png new file mode 100644 index 0000000000..149626b171 --- /dev/null +++ b/selfdrive/assets/navigation/direction_depart_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3f5fb80d62c92876a5e490917f549e2a443dfc683a6787506747bbbeb75d33b +size 1538 diff --git a/selfdrive/assets/navigation/direction_depart_straight.png b/selfdrive/assets/navigation/direction_depart_straight.png new file mode 100644 index 0000000000..aa4e4f7115 --- /dev/null +++ b/selfdrive/assets/navigation/direction_depart_straight.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f83214c1fa6aba33ca3e1fe29db09733a275efe19864866b9edecbb59abb171 +size 1234 diff --git a/selfdrive/assets/navigation/direction_end_of_road_left.png b/selfdrive/assets/navigation/direction_end_of_road_left.png new file mode 100644 index 0000000000..32a602bdef --- /dev/null +++ b/selfdrive/assets/navigation/direction_end_of_road_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9c86ddd75ea1ed2c49c1bdc2e7f98ed15d12226938073688dda1b0bbdf62308 +size 1439 diff --git a/selfdrive/assets/navigation/direction_end_of_road_right.png b/selfdrive/assets/navigation/direction_end_of_road_right.png new file mode 100644 index 0000000000..68915cee25 --- /dev/null +++ b/selfdrive/assets/navigation/direction_end_of_road_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc7248e62d11cf36f9a13d408a0954a51ff0eee9b8e03d8910a2eb2cb6a09ffd +size 1456 diff --git a/selfdrive/assets/navigation/direction_flag.png b/selfdrive/assets/navigation/direction_flag.png new file mode 100644 index 0000000000..26e8a220f2 --- /dev/null +++ b/selfdrive/assets/navigation/direction_flag.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8509bd5dbf96e44f73421dc09ca8f7c1dddf2dc21f3b4b15650472b3e06b3470 +size 658 diff --git a/selfdrive/assets/navigation/direction_fork.png b/selfdrive/assets/navigation/direction_fork.png new file mode 100644 index 0000000000..c3019a5991 --- /dev/null +++ b/selfdrive/assets/navigation/direction_fork.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5198a3fdb610001358501ca76ab52fe0979b9254ed85cbbb2ce1fab1cb77929a +size 2015 diff --git a/selfdrive/assets/navigation/direction_fork_left.png b/selfdrive/assets/navigation/direction_fork_left.png new file mode 100644 index 0000000000..a847257e9b --- /dev/null +++ b/selfdrive/assets/navigation/direction_fork_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:752424da0ad8430c619045455a86c640b576f8bbe6d3d8b5b6a599b1c61ef489 +size 1863 diff --git a/selfdrive/assets/navigation/direction_fork_right.png b/selfdrive/assets/navigation/direction_fork_right.png new file mode 100644 index 0000000000..102ddf753c --- /dev/null +++ b/selfdrive/assets/navigation/direction_fork_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6590df8da1f30ec61b3bdf729fda1956d340c5abab448ea0062105500cc5da5 +size 1841 diff --git a/selfdrive/assets/navigation/direction_fork_slight_left.png b/selfdrive/assets/navigation/direction_fork_slight_left.png new file mode 100644 index 0000000000..945ef744e0 --- /dev/null +++ b/selfdrive/assets/navigation/direction_fork_slight_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4fbd63acf8f5e7f734b332a96e9ad138ad22ee07000ad425712e71b77ce0728 +size 1800 diff --git a/selfdrive/assets/navigation/direction_fork_slight_right.png b/selfdrive/assets/navigation/direction_fork_slight_right.png new file mode 100644 index 0000000000..65db839df9 --- /dev/null +++ b/selfdrive/assets/navigation/direction_fork_slight_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7a7f5bcab30ce961ff7e345c460cfbd133e45c66da1fe1f0e7bc7c826b05f30 +size 1805 diff --git a/selfdrive/assets/navigation/direction_fork_straight.png b/selfdrive/assets/navigation/direction_fork_straight.png new file mode 100644 index 0000000000..74528d230c --- /dev/null +++ b/selfdrive/assets/navigation/direction_fork_straight.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:676cbe95f9a663816dd77c55dbcf2c346bfae2454be7832914b5527219aba91f +size 2473 diff --git a/selfdrive/assets/navigation/direction_invalid.png b/selfdrive/assets/navigation/direction_invalid.png new file mode 100644 index 0000000000..ce2c42c43d --- /dev/null +++ b/selfdrive/assets/navigation/direction_invalid.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:008cf037b8713c710eacd1129973119faa2527ab1c19aee5340a16dc0659df8a +size 1063 diff --git a/selfdrive/assets/navigation/direction_invalid_left.png b/selfdrive/assets/navigation/direction_invalid_left.png new file mode 100644 index 0000000000..438532ee29 --- /dev/null +++ b/selfdrive/assets/navigation/direction_invalid_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:579d6a27e062779d41beb9320abf5797bc8ec81de1f355a4197c3b3ee0766f28 +size 1400 diff --git a/selfdrive/assets/navigation/direction_invalid_right.png b/selfdrive/assets/navigation/direction_invalid_right.png new file mode 100644 index 0000000000..4ee7ebc3b4 --- /dev/null +++ b/selfdrive/assets/navigation/direction_invalid_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4010c8122af918dbdb50e88629adbf79f7733f022bba263e6f44f6ffae3e7a5 +size 1371 diff --git a/selfdrive/assets/navigation/direction_invalid_slight_left.png b/selfdrive/assets/navigation/direction_invalid_slight_left.png new file mode 100644 index 0000000000..29f4440460 --- /dev/null +++ b/selfdrive/assets/navigation/direction_invalid_slight_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89041889817454869d98adfb5a16fae33596c038d5484ec734fe3a5cc532c45c +size 1334 diff --git a/selfdrive/assets/navigation/direction_invalid_slight_right.png b/selfdrive/assets/navigation/direction_invalid_slight_right.png new file mode 100644 index 0000000000..755935b84c --- /dev/null +++ b/selfdrive/assets/navigation/direction_invalid_slight_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e691dd43947c9430fcd73e6bede94aa5fd8995e9303eba53cc0ac589a7c9f106 +size 1347 diff --git a/selfdrive/assets/navigation/direction_invalid_straight.png b/selfdrive/assets/navigation/direction_invalid_straight.png new file mode 100644 index 0000000000..ce2c42c43d --- /dev/null +++ b/selfdrive/assets/navigation/direction_invalid_straight.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:008cf037b8713c710eacd1129973119faa2527ab1c19aee5340a16dc0659df8a +size 1063 diff --git a/selfdrive/assets/navigation/direction_invalid_uturn.png b/selfdrive/assets/navigation/direction_invalid_uturn.png new file mode 100644 index 0000000000..ff9d97893f --- /dev/null +++ b/selfdrive/assets/navigation/direction_invalid_uturn.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e02ac2720f12f9373ae2d86d91fffb6203e18aba04b493bd6f41d2953a11cbc9 +size 1780 diff --git a/selfdrive/assets/navigation/direction_merge_left.png b/selfdrive/assets/navigation/direction_merge_left.png new file mode 100644 index 0000000000..7812f9eb94 --- /dev/null +++ b/selfdrive/assets/navigation/direction_merge_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08245891301f814fc0245133e39df3fb14720025cc3e4bc7131f953ead47edc8 +size 1535 diff --git a/selfdrive/assets/navigation/direction_merge_right.png b/selfdrive/assets/navigation/direction_merge_right.png new file mode 100644 index 0000000000..3c44c8fc75 --- /dev/null +++ b/selfdrive/assets/navigation/direction_merge_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c629c7273fe2613538295aba807edfddbbae86ae77d6f9b0b60b0486e3f7ca9 +size 1484 diff --git a/selfdrive/assets/navigation/direction_merge_slight_left.png b/selfdrive/assets/navigation/direction_merge_slight_left.png new file mode 100644 index 0000000000..756fb01853 --- /dev/null +++ b/selfdrive/assets/navigation/direction_merge_slight_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72c1ef39486f3dc3f7a0a97777bce16c7c369cc85bf6c82629d6780803804967 +size 1765 diff --git a/selfdrive/assets/navigation/direction_merge_slight_right.png b/selfdrive/assets/navigation/direction_merge_slight_right.png new file mode 100644 index 0000000000..b8d42b741f --- /dev/null +++ b/selfdrive/assets/navigation/direction_merge_slight_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b8bfd8019320127ed0fe03d4a1bddab57d5c2345b6cdeab66558ea9b53c0266 +size 1699 diff --git a/selfdrive/assets/navigation/direction_merge_straight.png b/selfdrive/assets/navigation/direction_merge_straight.png new file mode 100644 index 0000000000..60035c1f01 --- /dev/null +++ b/selfdrive/assets/navigation/direction_merge_straight.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d10bdde82e7896de072de28da46412d5e2f6c902fd5643c6b48a8fc79ed4232f +size 113 diff --git a/selfdrive/assets/navigation/direction_new_name_left.png b/selfdrive/assets/navigation/direction_new_name_left.png new file mode 100644 index 0000000000..438532ee29 --- /dev/null +++ b/selfdrive/assets/navigation/direction_new_name_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:579d6a27e062779d41beb9320abf5797bc8ec81de1f355a4197c3b3ee0766f28 +size 1400 diff --git a/selfdrive/assets/navigation/direction_new_name_right.png b/selfdrive/assets/navigation/direction_new_name_right.png new file mode 100644 index 0000000000..4ee7ebc3b4 --- /dev/null +++ b/selfdrive/assets/navigation/direction_new_name_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4010c8122af918dbdb50e88629adbf79f7733f022bba263e6f44f6ffae3e7a5 +size 1371 diff --git a/selfdrive/assets/navigation/direction_new_name_sharp_left.png b/selfdrive/assets/navigation/direction_new_name_sharp_left.png new file mode 100644 index 0000000000..ae1f3741ef --- /dev/null +++ b/selfdrive/assets/navigation/direction_new_name_sharp_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0457b0597386d0b7d3cc06d961df5fb34211ee575da7fab2f81e424d9954bb42 +size 1549 diff --git a/selfdrive/assets/navigation/direction_new_name_sharp_right.png b/selfdrive/assets/navigation/direction_new_name_sharp_right.png new file mode 100644 index 0000000000..0d8cd3ed53 --- /dev/null +++ b/selfdrive/assets/navigation/direction_new_name_sharp_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f6e1556f0b888afb6856f8cf3e16632959190f88dd66c4d9db4832a8269cbc5 +size 1552 diff --git a/selfdrive/assets/navigation/direction_new_name_slight_left.png b/selfdrive/assets/navigation/direction_new_name_slight_left.png new file mode 100644 index 0000000000..29f4440460 --- /dev/null +++ b/selfdrive/assets/navigation/direction_new_name_slight_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89041889817454869d98adfb5a16fae33596c038d5484ec734fe3a5cc532c45c +size 1334 diff --git a/selfdrive/assets/navigation/direction_new_name_slight_right.png b/selfdrive/assets/navigation/direction_new_name_slight_right.png new file mode 100644 index 0000000000..755935b84c --- /dev/null +++ b/selfdrive/assets/navigation/direction_new_name_slight_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e691dd43947c9430fcd73e6bede94aa5fd8995e9303eba53cc0ac589a7c9f106 +size 1347 diff --git a/selfdrive/assets/navigation/direction_new_name_straight.png b/selfdrive/assets/navigation/direction_new_name_straight.png new file mode 100644 index 0000000000..ce2c42c43d --- /dev/null +++ b/selfdrive/assets/navigation/direction_new_name_straight.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:008cf037b8713c710eacd1129973119faa2527ab1c19aee5340a16dc0659df8a +size 1063 diff --git a/selfdrive/assets/navigation/direction_notificaiton_right.png b/selfdrive/assets/navigation/direction_notificaiton_right.png new file mode 100644 index 0000000000..4ee7ebc3b4 --- /dev/null +++ b/selfdrive/assets/navigation/direction_notificaiton_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4010c8122af918dbdb50e88629adbf79f7733f022bba263e6f44f6ffae3e7a5 +size 1371 diff --git a/selfdrive/assets/navigation/direction_notificaiton_sharp_right.png b/selfdrive/assets/navigation/direction_notificaiton_sharp_right.png new file mode 100644 index 0000000000..f338742e58 --- /dev/null +++ b/selfdrive/assets/navigation/direction_notificaiton_sharp_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57dbfdabe88f6abbb8993982eef72803ac504842e9a9d388e7dde1623f69f0d7 +size 1551 diff --git a/selfdrive/assets/navigation/direction_notification_left.png b/selfdrive/assets/navigation/direction_notification_left.png new file mode 100644 index 0000000000..438532ee29 --- /dev/null +++ b/selfdrive/assets/navigation/direction_notification_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:579d6a27e062779d41beb9320abf5797bc8ec81de1f355a4197c3b3ee0766f28 +size 1400 diff --git a/selfdrive/assets/navigation/direction_notification_sharp_left.png b/selfdrive/assets/navigation/direction_notification_sharp_left.png new file mode 100644 index 0000000000..d2f1d491a0 --- /dev/null +++ b/selfdrive/assets/navigation/direction_notification_sharp_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f2016b7bac3accf541f100a2c83871618214e1806e95e4d80867d30d1dfcf03 +size 1546 diff --git a/selfdrive/assets/navigation/direction_notification_slight_left.png b/selfdrive/assets/navigation/direction_notification_slight_left.png new file mode 100644 index 0000000000..29f4440460 --- /dev/null +++ b/selfdrive/assets/navigation/direction_notification_slight_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89041889817454869d98adfb5a16fae33596c038d5484ec734fe3a5cc532c45c +size 1334 diff --git a/selfdrive/assets/navigation/direction_notification_slight_right.png b/selfdrive/assets/navigation/direction_notification_slight_right.png new file mode 100644 index 0000000000..755935b84c --- /dev/null +++ b/selfdrive/assets/navigation/direction_notification_slight_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e691dd43947c9430fcd73e6bede94aa5fd8995e9303eba53cc0ac589a7c9f106 +size 1347 diff --git a/selfdrive/assets/navigation/direction_notification_straight.png b/selfdrive/assets/navigation/direction_notification_straight.png new file mode 100644 index 0000000000..ce2c42c43d --- /dev/null +++ b/selfdrive/assets/navigation/direction_notification_straight.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:008cf037b8713c710eacd1129973119faa2527ab1c19aee5340a16dc0659df8a +size 1063 diff --git a/selfdrive/assets/navigation/direction_off_ramp_left.png b/selfdrive/assets/navigation/direction_off_ramp_left.png new file mode 100644 index 0000000000..d01bb4fce3 --- /dev/null +++ b/selfdrive/assets/navigation/direction_off_ramp_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6736b6c2123cbaf90d2c8e4da79a4089ba42c0e7a220a596e45afd511166da9b +size 1524 diff --git a/selfdrive/assets/navigation/direction_off_ramp_right.png b/selfdrive/assets/navigation/direction_off_ramp_right.png new file mode 100644 index 0000000000..013ec5a4c9 --- /dev/null +++ b/selfdrive/assets/navigation/direction_off_ramp_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a636d33568c658b05e460e05a1eac5c4e1cfced204044657a04191027c44c4c +size 1580 diff --git a/selfdrive/assets/navigation/direction_off_ramp_slight_left.png b/selfdrive/assets/navigation/direction_off_ramp_slight_left.png new file mode 100644 index 0000000000..39497c8d41 --- /dev/null +++ b/selfdrive/assets/navigation/direction_off_ramp_slight_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a27d55d704f77bca4beaac30a2c5b5abee304986627d09f971b2a2e0367e8477 +size 1478 diff --git a/selfdrive/assets/navigation/direction_off_ramp_slight_right.png b/selfdrive/assets/navigation/direction_off_ramp_slight_right.png new file mode 100644 index 0000000000..a68d28d674 --- /dev/null +++ b/selfdrive/assets/navigation/direction_off_ramp_slight_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e711c8e2184440f4ddead06897c90758470e7475fa7e0cf8b2db567e491c8e57 +size 1519 diff --git a/selfdrive/assets/navigation/direction_on_ramp_left.png b/selfdrive/assets/navigation/direction_on_ramp_left.png new file mode 100644 index 0000000000..438532ee29 --- /dev/null +++ b/selfdrive/assets/navigation/direction_on_ramp_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:579d6a27e062779d41beb9320abf5797bc8ec81de1f355a4197c3b3ee0766f28 +size 1400 diff --git a/selfdrive/assets/navigation/direction_on_ramp_right.png b/selfdrive/assets/navigation/direction_on_ramp_right.png new file mode 100644 index 0000000000..4ee7ebc3b4 --- /dev/null +++ b/selfdrive/assets/navigation/direction_on_ramp_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4010c8122af918dbdb50e88629adbf79f7733f022bba263e6f44f6ffae3e7a5 +size 1371 diff --git a/selfdrive/assets/navigation/direction_on_ramp_sharp_left.png b/selfdrive/assets/navigation/direction_on_ramp_sharp_left.png new file mode 100644 index 0000000000..ae1f3741ef --- /dev/null +++ b/selfdrive/assets/navigation/direction_on_ramp_sharp_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0457b0597386d0b7d3cc06d961df5fb34211ee575da7fab2f81e424d9954bb42 +size 1549 diff --git a/selfdrive/assets/navigation/direction_on_ramp_sharp_right.png b/selfdrive/assets/navigation/direction_on_ramp_sharp_right.png new file mode 100644 index 0000000000..f338742e58 --- /dev/null +++ b/selfdrive/assets/navigation/direction_on_ramp_sharp_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57dbfdabe88f6abbb8993982eef72803ac504842e9a9d388e7dde1623f69f0d7 +size 1551 diff --git a/selfdrive/assets/navigation/direction_on_ramp_slight_left.png b/selfdrive/assets/navigation/direction_on_ramp_slight_left.png new file mode 100644 index 0000000000..e640fe3404 --- /dev/null +++ b/selfdrive/assets/navigation/direction_on_ramp_slight_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b2f19864347794510da5e13ebaed40cc01d45bbd649c3e5097052607af52fa7 +size 1334 diff --git a/selfdrive/assets/navigation/direction_on_ramp_slight_right.png b/selfdrive/assets/navigation/direction_on_ramp_slight_right.png new file mode 100644 index 0000000000..d309f2d14e --- /dev/null +++ b/selfdrive/assets/navigation/direction_on_ramp_slight_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d2704d4d480568deb63598a48b741b024f4e55f5936e3eeb9cdc3daf6618837 +size 1346 diff --git a/selfdrive/assets/navigation/direction_on_ramp_straight.png b/selfdrive/assets/navigation/direction_on_ramp_straight.png new file mode 100644 index 0000000000..ce2c42c43d --- /dev/null +++ b/selfdrive/assets/navigation/direction_on_ramp_straight.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:008cf037b8713c710eacd1129973119faa2527ab1c19aee5340a16dc0659df8a +size 1063 diff --git a/selfdrive/assets/navigation/direction_rotary.png b/selfdrive/assets/navigation/direction_rotary.png new file mode 100644 index 0000000000..20b4052015 --- /dev/null +++ b/selfdrive/assets/navigation/direction_rotary.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1868ec727cd761aad76fb6cb7705360ed9f70a92aea97f4c3b945b043996d1e2 +size 1906 diff --git a/selfdrive/assets/navigation/direction_rotary_left.png b/selfdrive/assets/navigation/direction_rotary_left.png new file mode 100644 index 0000000000..f610501286 --- /dev/null +++ b/selfdrive/assets/navigation/direction_rotary_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2d41ab080452ce24ce27ed833f24790a6e6218dc4a5df4b35d23d6cfc425fbb +size 1543 diff --git a/selfdrive/assets/navigation/direction_rotary_right.png b/selfdrive/assets/navigation/direction_rotary_right.png new file mode 100644 index 0000000000..9b8ea37ddf --- /dev/null +++ b/selfdrive/assets/navigation/direction_rotary_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94251b2485f1f8bd0b22eb32fd59459626229c38e4de9aa538ff249b3cc16505 +size 1743 diff --git a/selfdrive/assets/navigation/direction_rotary_sharp_left.png b/selfdrive/assets/navigation/direction_rotary_sharp_left.png new file mode 100644 index 0000000000..cbc0882791 --- /dev/null +++ b/selfdrive/assets/navigation/direction_rotary_sharp_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fbc14fb3720b7452c34c64af8c9b6ce4c953a5e65f3b28ad1ed17b5b2bc47f0 +size 1532 diff --git a/selfdrive/assets/navigation/direction_rotary_sharp_right.png b/selfdrive/assets/navigation/direction_rotary_sharp_right.png new file mode 100644 index 0000000000..c7d4ba3175 --- /dev/null +++ b/selfdrive/assets/navigation/direction_rotary_sharp_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fe99a15432706ac8bdd5766d3ed4869042b50e0d3c54665b63ba8eb2aaaef20 +size 1855 diff --git a/selfdrive/assets/navigation/direction_rotary_slight_left.png b/selfdrive/assets/navigation/direction_rotary_slight_left.png new file mode 100644 index 0000000000..9b5912030b --- /dev/null +++ b/selfdrive/assets/navigation/direction_rotary_slight_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45115d7c0d4a6285406777787b19b5f6f9c8231ba773aaaa86ab62b7f94b1c51 +size 1699 diff --git a/selfdrive/assets/navigation/direction_rotary_slight_right.png b/selfdrive/assets/navigation/direction_rotary_slight_right.png new file mode 100644 index 0000000000..bc5e6b0d2e --- /dev/null +++ b/selfdrive/assets/navigation/direction_rotary_slight_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ea0a56d30f763f69ba1c5051f05eac13e61a715ae4d80412b1e0570f3263e27 +size 1821 diff --git a/selfdrive/assets/navigation/direction_rotary_straight.png b/selfdrive/assets/navigation/direction_rotary_straight.png new file mode 100644 index 0000000000..ac4eec685e --- /dev/null +++ b/selfdrive/assets/navigation/direction_rotary_straight.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77c42dadeda4d9fdc5b8e7915319880908dd61acb46e289e88f8e067b8e57410 +size 1736 diff --git a/selfdrive/assets/navigation/direction_roundabout.png b/selfdrive/assets/navigation/direction_roundabout.png new file mode 100644 index 0000000000..20b4052015 --- /dev/null +++ b/selfdrive/assets/navigation/direction_roundabout.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1868ec727cd761aad76fb6cb7705360ed9f70a92aea97f4c3b945b043996d1e2 +size 1906 diff --git a/selfdrive/assets/navigation/direction_roundabout_left.png b/selfdrive/assets/navigation/direction_roundabout_left.png new file mode 100644 index 0000000000..f610501286 --- /dev/null +++ b/selfdrive/assets/navigation/direction_roundabout_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2d41ab080452ce24ce27ed833f24790a6e6218dc4a5df4b35d23d6cfc425fbb +size 1543 diff --git a/selfdrive/assets/navigation/direction_roundabout_right.png b/selfdrive/assets/navigation/direction_roundabout_right.png new file mode 100644 index 0000000000..9b8ea37ddf --- /dev/null +++ b/selfdrive/assets/navigation/direction_roundabout_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94251b2485f1f8bd0b22eb32fd59459626229c38e4de9aa538ff249b3cc16505 +size 1743 diff --git a/selfdrive/assets/navigation/direction_roundabout_sharp_left.png b/selfdrive/assets/navigation/direction_roundabout_sharp_left.png new file mode 100644 index 0000000000..204586589d --- /dev/null +++ b/selfdrive/assets/navigation/direction_roundabout_sharp_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7423462cc52bf5d97b6d2e05626f8066a6580b03922bc35589690b15d04a222 +size 1532 diff --git a/selfdrive/assets/navigation/direction_roundabout_sharp_right.png b/selfdrive/assets/navigation/direction_roundabout_sharp_right.png new file mode 100644 index 0000000000..c7d4ba3175 --- /dev/null +++ b/selfdrive/assets/navigation/direction_roundabout_sharp_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fe99a15432706ac8bdd5766d3ed4869042b50e0d3c54665b63ba8eb2aaaef20 +size 1855 diff --git a/selfdrive/assets/navigation/direction_roundabout_slight_left.png b/selfdrive/assets/navigation/direction_roundabout_slight_left.png new file mode 100644 index 0000000000..d8b806137c --- /dev/null +++ b/selfdrive/assets/navigation/direction_roundabout_slight_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b6cdda3bc23add330fa03095fc46251dbe2516f974d4ae44c321d87dc662d54 +size 1702 diff --git a/selfdrive/assets/navigation/direction_roundabout_slight_right.png b/selfdrive/assets/navigation/direction_roundabout_slight_right.png new file mode 100644 index 0000000000..bc5e6b0d2e --- /dev/null +++ b/selfdrive/assets/navigation/direction_roundabout_slight_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9ea0a56d30f763f69ba1c5051f05eac13e61a715ae4d80412b1e0570f3263e27 +size 1821 diff --git a/selfdrive/assets/navigation/direction_roundabout_straight.png b/selfdrive/assets/navigation/direction_roundabout_straight.png new file mode 100644 index 0000000000..ac4eec685e --- /dev/null +++ b/selfdrive/assets/navigation/direction_roundabout_straight.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77c42dadeda4d9fdc5b8e7915319880908dd61acb46e289e88f8e067b8e57410 +size 1736 diff --git a/selfdrive/assets/navigation/direction_turn_left.png b/selfdrive/assets/navigation/direction_turn_left.png new file mode 100644 index 0000000000..438532ee29 --- /dev/null +++ b/selfdrive/assets/navigation/direction_turn_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:579d6a27e062779d41beb9320abf5797bc8ec81de1f355a4197c3b3ee0766f28 +size 1400 diff --git a/selfdrive/assets/navigation/direction_turn_right.png b/selfdrive/assets/navigation/direction_turn_right.png new file mode 100644 index 0000000000..4ee7ebc3b4 --- /dev/null +++ b/selfdrive/assets/navigation/direction_turn_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4010c8122af918dbdb50e88629adbf79f7733f022bba263e6f44f6ffae3e7a5 +size 1371 diff --git a/selfdrive/assets/navigation/direction_turn_sharp_left.png b/selfdrive/assets/navigation/direction_turn_sharp_left.png new file mode 100644 index 0000000000..d2f1d491a0 --- /dev/null +++ b/selfdrive/assets/navigation/direction_turn_sharp_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f2016b7bac3accf541f100a2c83871618214e1806e95e4d80867d30d1dfcf03 +size 1546 diff --git a/selfdrive/assets/navigation/direction_turn_sharp_right.png b/selfdrive/assets/navigation/direction_turn_sharp_right.png new file mode 100644 index 0000000000..f338742e58 --- /dev/null +++ b/selfdrive/assets/navigation/direction_turn_sharp_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57dbfdabe88f6abbb8993982eef72803ac504842e9a9d388e7dde1623f69f0d7 +size 1551 diff --git a/selfdrive/assets/navigation/direction_turn_slight_left.png b/selfdrive/assets/navigation/direction_turn_slight_left.png new file mode 100644 index 0000000000..29f4440460 --- /dev/null +++ b/selfdrive/assets/navigation/direction_turn_slight_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89041889817454869d98adfb5a16fae33596c038d5484ec734fe3a5cc532c45c +size 1334 diff --git a/selfdrive/assets/navigation/direction_turn_slight_right.png b/selfdrive/assets/navigation/direction_turn_slight_right.png new file mode 100644 index 0000000000..755935b84c --- /dev/null +++ b/selfdrive/assets/navigation/direction_turn_slight_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e691dd43947c9430fcd73e6bede94aa5fd8995e9303eba53cc0ac589a7c9f106 +size 1347 diff --git a/selfdrive/assets/navigation/direction_turn_straight.png b/selfdrive/assets/navigation/direction_turn_straight.png new file mode 100644 index 0000000000..ce2c42c43d --- /dev/null +++ b/selfdrive/assets/navigation/direction_turn_straight.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:008cf037b8713c710eacd1129973119faa2527ab1c19aee5340a16dc0659df8a +size 1063 diff --git a/selfdrive/assets/navigation/direction_updown.png b/selfdrive/assets/navigation/direction_updown.png new file mode 100644 index 0000000000..3c9e3fe22e --- /dev/null +++ b/selfdrive/assets/navigation/direction_updown.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41adb4c64ca3cecf2f6de7dcca8826980369995959ad0eb3d7ec584bbac9b4a6 +size 1327 diff --git a/selfdrive/assets/navigation/direction_uturn.png b/selfdrive/assets/navigation/direction_uturn.png new file mode 100644 index 0000000000..ff9d97893f --- /dev/null +++ b/selfdrive/assets/navigation/direction_uturn.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e02ac2720f12f9373ae2d86d91fffb6203e18aba04b493bd6f41d2953a11cbc9 +size 1780 diff --git a/selfdrive/athena/athenad.py b/selfdrive/athena/athenad.py index e71b5b80e6..5a299e475d 100755 --- a/selfdrive/athena/athenad.py +++ b/selfdrive/athena/athenad.py @@ -131,6 +131,17 @@ def getMessage(service=None, timeout=1000): return ret.to_dict() +@dispatcher.add_method +def setNavDestination(latitude=0, longitude=0): + destination = { + "latitude": latitude, + "longitude": longitude, + } + Params().put("NavDestination", json.dumps(destination)) + + return {"success": 1} + + @dispatcher.add_method def listDataDirectory(): files = [os.path.relpath(os.path.join(dp, f), ROOT) for dp, dn, fn in os.walk(ROOT) for f in fn] diff --git a/selfdrive/common/params.cc b/selfdrive/common/params.cc index 87d338ed70..fc5fd38061 100644 --- a/selfdrive/common/params.cc +++ b/selfdrive/common/params.cc @@ -183,6 +183,8 @@ std::unordered_map keys = { {"LastUpdateException", PERSISTENT}, {"LastUpdateTime", PERSISTENT}, {"LiveParameters", PERSISTENT}, + {"MapboxToken", PERSISTENT}, + {"NavDestination", PERSISTENT}, // TODO: CLEAR_ON_MANAGER_START {"OpenpilotEnabledToggle", PERSISTENT}, {"PandaFirmware", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT}, {"PandaFirmwareHex", CLEAR_ON_MANAGER_START | CLEAR_ON_PANDA_DISCONNECT}, diff --git a/selfdrive/ui/SConscript b/selfdrive/ui/SConscript index 5be9e43328..c9fe988ca9 100644 --- a/selfdrive/ui/SConscript +++ b/selfdrive/ui/SConscript @@ -4,9 +4,17 @@ Import('qt_env', 'arch', 'common', 'messaging', 'gpucommon', 'visionipc', base_libs = [gpucommon, common, messaging, cereal, visionipc, transformations, 'zmq', 'capnp', 'kj', 'm', 'OpenCL', 'ssl', 'crypto', 'pthread'] + qt_env["LIBS"] + +maps = arch in ['larch64', 'x86_64'] and \ + os.path.exists(File("qt/maps/map.cc").srcnode().abspath) + if arch == 'aarch64': base_libs += ['log', 'utils', 'gui', 'ui', 'CB', 'gsl', 'adreno_utils', 'cutils', 'uuid'] +if maps and arch in ['x86_64']: + rpath = [Dir(f"#phonelibs/mapbox-gl-native-qt/{arch}").srcnode().abspath] + qt_env["RPATH"] += rpath + if arch == "Darwin": del base_libs[base_libs.index('OpenCL')] qt_env['FRAMEWORKS'] += ['OpenCL'] @@ -16,9 +24,15 @@ widgets_src = ["qt/widgets/input.cc", "qt/widgets/drive_stats.cc", "qt/widgets/offroad_alerts.cc", "qt/widgets/setup.cc", "qt/widgets/keyboard.cc", "qt/widgets/scrollview.cc", "#phonelibs/qrcode/QrCode.cc", "qt/api.cc", "qt/request_repeater.cc"] + if arch != 'aarch64': widgets_src += ["qt/offroad/networking.cc", "qt/offroad/wifiManager.cc"] +if maps: + base_libs += ['qmapboxgl'] + widgets_src += ["qt/maps/map_helpers.cc", "qt/maps/map.cc"] + qt_env['CPPDEFINES'] = ["ENABLE_MAPS"] + widgets = qt_env.Library("qt_widgets", widgets_src, LIBS=base_libs) qt_libs = [widgets] + base_libs diff --git a/selfdrive/ui/paint.cc b/selfdrive/ui/paint.cc index ab46cff65a..854533fc3c 100644 --- a/selfdrive/ui/paint.cc +++ b/selfdrive/ui/paint.cc @@ -442,7 +442,7 @@ static mat4 get_driver_view_transform() { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, }}; - + } else { // frame from 4/3 to 16/9 display transform = (mat4){{ @@ -534,6 +534,14 @@ void ui_nvg_init(UIState *s) { glBindVertexArray(0); } + ui_resize(s, s->fb_w, s->fb_h); +} + + +void ui_resize(UIState *s, int width, int height){ + s->fb_w = width; + s->fb_h = height; + auto intrinsic_matrix = s->wide_camera ? ecam_intrinsic_matrix : fcam_intrinsic_matrix; s->zoom = zoom / intrinsic_matrix.v[0]; diff --git a/selfdrive/ui/paint.h b/selfdrive/ui/paint.h index b955a61630..55fe9c1d08 100644 --- a/selfdrive/ui/paint.h +++ b/selfdrive/ui/paint.h @@ -8,3 +8,4 @@ void ui_draw_rect(NVGcontext *vg, const Rect &r, NVGcolor color, int width, floa void ui_fill_rect(NVGcontext *vg, const Rect &r, const NVGpaint &paint, float radius = 0); void ui_fill_rect(NVGcontext *vg, const Rect &r, const NVGcolor &color, float radius = 0); void ui_nvg_init(UIState *s); +void ui_resize(UIState *s, int width, int height); diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index 18070e4e60..4b9f050da3 100644 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -29,6 +29,7 @@ HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) { onroad = new OnroadWindow(this); slayout->addWidget(onroad); + QObject::connect(this, &HomeWindow::update, onroad, &OnroadWindow::update); QObject::connect(this, &HomeWindow::offroadTransitionSignal, onroad, &OnroadWindow::offroadTransition); @@ -59,7 +60,16 @@ void HomeWindow::mousePressEvent(QMouseEvent* e) { // Handle sidebar collapsing if (onroad->isVisible() && (!sidebar->isVisible() || e->x() > sidebar->width())) { - sidebar->setVisible(!sidebar->isVisible()); + // Hide map first if visible, then hide sidebar + if (onroad->map != nullptr && onroad->map->isVisible()){ + onroad->map->setVisible(false); + } else if (!sidebar->isVisible()) { + sidebar->setVisible(true); + } else { + sidebar->setVisible(false); + + if (onroad->map != nullptr) onroad->map->setVisible(true); + } } } diff --git a/selfdrive/ui/qt/maps/map.cc b/selfdrive/ui/qt/maps/map.cc new file mode 100644 index 0000000000..9620a18de1 --- /dev/null +++ b/selfdrive/ui/qt/maps/map.cc @@ -0,0 +1,489 @@ +#include + +#include +#include +#include + +#include "selfdrive/common/util.h" +#include "selfdrive/common/swaglog.h" +#include "selfdrive/common/params.h" +#include "selfdrive/ui/qt/util.h" +#include "selfdrive/ui/qt/maps/map_helpers.h" +#include "selfdrive/ui/qt/maps/map.h" + + +const int PAN_TIMEOUT = 100; +const bool DRAW_MODEL_PATH = false; +const qreal REROUTE_DISTANCE = 25; +const float MAX_ZOOM = 17; +const float MIN_ZOOM = 14; +const float MAX_PITCH = 50; +const float MIN_PITCH = 0; +const float MAP_SCALE = 2; + + +MapWindow::MapWindow(const QMapboxGLSettings &settings) : m_settings(settings) { + if (DRAW_MODEL_PATH){ + sm = new SubMaster({"liveLocationKalman", "modelV2"}); + } else { + sm = new SubMaster({"liveLocationKalman"}); + } + + timer = new QTimer(this); + QObject::connect(timer, SIGNAL(timeout()), this, SLOT(timerUpdate())); + + // Instructions + map_instructions = new MapInstructions(this); + connect(this, SIGNAL(instructionsChanged(QMap)), + map_instructions, SLOT(updateInstructions(QMap))); + connect(this, SIGNAL(distanceChanged(float)), + map_instructions, SLOT(updateDistance(float))); + map_instructions->setFixedWidth(width()); + + // Routing + QVariantMap parameters; + parameters["mapbox.access_token"] = m_settings.accessToken(); + + geoservice_provider = new QGeoServiceProvider("mapbox", parameters); + routing_manager = geoservice_provider->routingManager(); + if (routing_manager == nullptr){ + qDebug() << geoservice_provider->errorString(); + assert(routing_manager); + } + connect(routing_manager, SIGNAL(finished(QGeoRouteReply*)), this, SLOT(routeCalculated(QGeoRouteReply*))); + + grabGesture(Qt::GestureType::PinchGesture); +} + +MapWindow::~MapWindow() { + makeCurrent(); +} + +void MapWindow::initLayers() { + // This doesn't work from initializeGL + if (!m_map->layerExists("modelPathLayer")){ + QVariantMap modelPath; + modelPath["id"] = "modelPathLayer"; + modelPath["type"] = "line"; + modelPath["source"] = "modelPathSource"; + m_map->addLayer(modelPath); + m_map->setPaintProperty("modelPathLayer", "line-color", QColor("red")); + m_map->setPaintProperty("modelPathLayer", "line-width", 5.0); + m_map->setLayoutProperty("modelPathLayer", "line-cap", "round"); + } + if (!m_map->layerExists("navLayer")){ + QVariantMap nav; + nav["id"] = "navLayer"; + nav["type"] = "line"; + nav["source"] = "navSource"; + m_map->addLayer(nav, "road-intersection"); + m_map->setPaintProperty("navLayer", "line-color", QColor("#8cb3d1")); + m_map->setPaintProperty("navLayer", "line-width", 7.5); + m_map->setLayoutProperty("navLayer", "line-cap", "round"); + } + if (!m_map->layerExists("carPosLayer")){ + m_map->addImage("label-arrow", QImage("../assets/images/triangle.svg")); + + QVariantMap carPos; + carPos["id"] = "carPosLayer"; + carPos["type"] = "symbol"; + carPos["source"] = "carPosSource"; + m_map->addLayer(carPos); + m_map->setLayoutProperty("carPosLayer", "icon-pitch-alignment", "map"); + m_map->setLayoutProperty("carPosLayer", "icon-image", "label-arrow"); + m_map->setLayoutProperty("carPosLayer", "icon-size", 0.5); + m_map->setLayoutProperty("carPosLayer", "icon-ignore-placement", true); + m_map->setLayoutProperty("carPosLayer", "icon-allow-overlap", true); + m_map->setLayoutProperty("carPosLayer", "symbol-sort-key", 0); + } +} + +void MapWindow::timerUpdate() { + if (!isVisible()) return; + + initLayers(); + + sm->update(0); + if (sm->updated("liveLocationKalman")) { + auto location = (*sm)["liveLocationKalman"].getLiveLocationKalman(); + auto pos = location.getPositionGeodetic(); + auto orientation = location.getOrientationNED(); + + float velocity = location.getVelocityCalibrated().getValue()[0]; + static FirstOrderFilter velocity_filter(velocity, 10, 0.1); + + auto coordinate = QMapbox::Coordinate(pos.getValue()[0], pos.getValue()[1]); + + if (location.getStatus() == cereal::LiveLocationKalman::Status::VALID){ + last_position = coordinate; + gps_ok = location.getGpsOK(); + + if (sm->frame % 10 == 0 && shouldRecompute()){ + calculateRoute(nav_destination); + } + + if (segment.isValid()) { + auto cur_maneuver = segment.maneuver(); + auto attrs = cur_maneuver.extendedAttributes(); + if (cur_maneuver.isValid() && attrs.contains("mapbox.banner_instructions")){ + + auto banner = attrs["mapbox.banner_instructions"].toList(); + if (banner.size()){ + // TOOD: Only show when traveled distanceAlongGeometry since the start + map_instructions->setVisible(true); + emit instructionsChanged(banner[0].toMap()); + } + + } + + auto next_segment = segment.nextRouteSegment(); + if (next_segment.isValid()){ + auto next_maneuver = next_segment.maneuver(); + if (next_maneuver.isValid()){ + float next_maneuver_distance = next_maneuver.position().distanceTo(to_QGeoCoordinate(last_position)); + emit distanceChanged(next_maneuver_distance); + m_map->setPitch(MAX_PITCH); // TODO: smooth pitching based on maneuver distance + + if (next_maneuver_distance < REROUTE_DISTANCE && next_maneuver_distance > last_maneuver_distance){ + segment = next_segment; + } + last_maneuver_distance = next_maneuver_distance; + } + } + } + + if (pan_counter == 0){ + m_map->setCoordinate(coordinate); + m_map->setBearing(RAD2DEG(orientation.getValue()[2])); + } else { + pan_counter--; + } + + if (zoom_counter == 0){ + m_map->setZoom(util::map_val(velocity_filter.update(velocity), 0, 30, MAX_ZOOM, MIN_ZOOM)); + } else { + zoom_counter--; + } + + // Update current location marker + auto point = coordinate_to_collection(coordinate); + QMapbox::Feature feature1(QMapbox::Feature::PointType, point, {}, {}); + QVariantMap carPosSource; + carPosSource["type"] = "geojson"; + carPosSource["data"] = QVariant::fromValue(feature1); + m_map->updateSource("carPosSource", carPosSource); + + // Update model path + if (DRAW_MODEL_PATH) { + auto model = (*sm)["modelV2"].getModelV2(); + auto path_points = model_to_collection(location.getCalibratedOrientationECEF(), location.getPositionECEF(), model.getPosition()); + QMapbox::Feature feature2(QMapbox::Feature::LineStringType, path_points, {}, {}); + QVariantMap modelPathSource; + modelPathSource["type"] = "geojson"; + modelPathSource["data"] = QVariant::fromValue(feature2); + m_map->updateSource("modelPathSource", modelPathSource); + } + } + update(); + } + if (!segment.isValid()){ + map_instructions->setVisible(false); + } + +} + +void MapWindow::resizeGL(int w, int h) { + map_instructions->setFixedWidth(width()); +} + +void MapWindow::initializeGL() { + m_map.reset(new QMapboxGL(nullptr, m_settings, size(), 1)); + + // TODO: Get from last gps position param + m_map->setCoordinateZoom(last_position, MAX_ZOOM); + m_map->setMargins({0, 350, 0, 0}); + m_map->setPitch(MIN_PITCH); + m_map->setStyleUrl("mapbox://styles/pd0wm/cknuhcgvr0vs817o1akcx6pek"); // Larger fonts + + connect(m_map.data(), SIGNAL(needsRendering()), this, SLOT(update())); + timer->start(100); +} + +void MapWindow::paintGL() { + m_map->resize(size() / MAP_SCALE); + m_map->setFramebufferObject(defaultFramebufferObject(), size()); + m_map->render(); +} + + +void MapWindow::calculateRoute(QMapbox::Coordinate destination) { + QGeoRouteRequest request(to_QGeoCoordinate(last_position), to_QGeoCoordinate(destination)); + routing_manager->calculateRoute(request); +} + +void MapWindow::routeCalculated(QGeoRouteReply *reply) { + LOGW("new route calculated"); + if (reply->routes().size() != 0) { + route = reply->routes().at(0); + segment = route.firstRouteSegment(); + + auto route_points = coordinate_list_to_collection(route.path()); + QMapbox::Feature feature(QMapbox::Feature::LineStringType, route_points, {}, {}); + QVariantMap navSource; + navSource["type"] = "geojson"; + navSource["data"] = QVariant::fromValue(feature); + m_map->updateSource("navSource", navSource); + has_route = true; + } + + reply->deleteLater(); +} + + +bool MapWindow::shouldRecompute(){ + if (!gps_ok) return false; // Don't recompute when gps drifts in tunnels + + QString nav_destination_json = QString::fromStdString(Params().get("NavDestination")); + if (nav_destination_json.isEmpty()) return false; + + QJsonDocument doc = QJsonDocument::fromJson(nav_destination_json.toUtf8()); + if (doc.isNull()) return false; + + QJsonObject json = doc.object(); + if (json["latitude"].isDouble() && json["longitude"].isDouble()){ + QMapbox::Coordinate new_destination(json["latitude"].toDouble(), json["longitude"].toDouble()); + if (new_destination != nav_destination){ + nav_destination = new_destination; + return true; + } + } + + if (!segment.isValid()){ + return true; + } + + // Compute closest distance to all line segments in the current path + float min_d = REROUTE_DISTANCE + 1; + auto path = segment.path(); + auto cur = to_QGeoCoordinate(last_position); + for (size_t i = 0; i < path.size() - 1; i++){ + auto a = path[i]; + auto b = path[i+1]; + min_d = std::min(min_d, minimum_distance(a, b, cur)); + } + return min_d > REROUTE_DISTANCE; + + // TODO: Check for going wrong way in segment +} + +void MapWindow::mousePressEvent(QMouseEvent *ev) { + m_lastPos = ev->localPos(); + ev->accept(); +} + +void MapWindow::mouseMoveEvent(QMouseEvent *ev){ + QPointF delta = ev->localPos() - m_lastPos; + + if (!delta.isNull()) { + pan_counter = PAN_TIMEOUT; + m_map->moveBy(delta); + } + + m_lastPos = ev->localPos(); + ev->accept(); +} + +void MapWindow::wheelEvent(QWheelEvent *ev) { + if (ev->orientation() == Qt::Horizontal) { + return; + } + + float factor = ev->delta() / 1200.; + if (ev->delta() < 0) { + factor = factor > -1 ? factor : 1 / factor; + } + + m_map->scaleBy(1 + factor, ev->pos() / MAP_SCALE); + zoom_counter = PAN_TIMEOUT; + ev->accept(); +} + +bool MapWindow::event(QEvent *event) { + if (event->type() == QEvent::Gesture){ + return gestureEvent(static_cast(event)); + } + + return QWidget::event(event); +} + +bool MapWindow::gestureEvent(QGestureEvent *event) { + if (QGesture *pinch = event->gesture(Qt::PinchGesture)){ + pinchTriggered(static_cast(pinch)); + } + return true; +} + +void MapWindow::pinchTriggered(QPinchGesture *gesture) { + QPinchGesture::ChangeFlags changeFlags = gesture->changeFlags(); + if (changeFlags & QPinchGesture::ScaleFactorChanged) { + // TODO: figure out why gesture centerPoint doesn't work + m_map->scaleBy(gesture->scaleFactor(), {width() / 2.0 / MAP_SCALE, height() / 2.0 / MAP_SCALE}); + zoom_counter = PAN_TIMEOUT; + } +} + +MapInstructions::MapInstructions(QWidget * parent) : QWidget(parent){ + QHBoxLayout *layout_outer = new QHBoxLayout; + layout_outer->setContentsMargins(11, 50, 11, 11); + { + QVBoxLayout *layout = new QVBoxLayout; + icon_01 = new QLabel; + layout->addWidget(icon_01); + layout->addStretch(); + layout_outer->addLayout(layout); + } + + { + QVBoxLayout *layout = new QVBoxLayout; + + distance = new QLabel; + distance->setStyleSheet(R"(font-size: 75px; )"); + layout->addWidget(distance); + + primary = new QLabel; + primary->setStyleSheet(R"(font-size: 50px;)"); + primary->setWordWrap(true); + layout->addWidget(primary); + + secondary = new QLabel; + secondary->setStyleSheet(R"(font-size: 40px;)"); + secondary->setWordWrap(true); + layout->addWidget(secondary); + + lane_layout = new QHBoxLayout; + layout->addLayout(lane_layout); + + QWidget * w = new QWidget; + w->setLayout(layout); + layout_outer->addWidget(w); + } + + setLayout(layout_outer); + setStyleSheet(R"( + * { + color: white; + font-family: "Inter"; + } + )"); + + QPalette pal = palette(); + pal.setColor(QPalette::Background, QColor(0, 0, 0, 150)); + setAutoFillBackground(true); + setPalette(pal); +} + +void MapInstructions::updateDistance(float d){ + QString distance_str; + + float miles = d * METER_2_MILE; + float feet = d * METER_2_FOOT; + + if (feet > 500){ + distance_str.setNum(miles, 'f', 1); + distance_str += " miles"; + } else { + distance_str.setNum(50 * int(feet / 50)); + distance_str += " feet"; + } + distance->setText(distance_str); +} + +void MapInstructions::updateInstructions(QMap banner){ + // Need multiple calls to adjustSize for it to properly resize + // seems like it takes a little bit of time for the images to change and + // the size can only be changed afterwards + adjustSize(); + + if (banner == last_banner) return; + QString primary_str, secondary_str; + + auto p = banner["primary"].toMap(); + primary_str += p["text"].toString(); + + // Show arrow with direction + if (p.contains("type")){ + QString fn = "../assets/navigation/direction_" + p["type"].toString(); + if (p.contains("modifier")){ + fn += "_" + p["modifier"].toString(); + } + fn += + ".png"; + fn = fn.replace(' ', '_'); + + QPixmap pix(fn); + icon_01->setPixmap(pix.scaledToWidth(200, Qt::SmoothTransformation)); + icon_01->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + } + + // Parse components (e.g. lanes, exit number) + auto components = p["components"].toList(); + QString icon_fn; + for (auto &c : components) { + auto cc = c.toMap(); + if (cc["type"].toString() == "icon"){ + icon_fn = cc["imageBaseURL"].toString() + "@3x.png"; + } + } + + if (banner.contains("secondary")){ + auto s = banner["secondary"].toMap(); + secondary_str += s["text"].toString(); + } + + clearLayout(lane_layout); + bool has_lanes = false; + + if (banner.contains("sub")){ + auto s = banner["sub"].toMap(); + auto components = s["components"].toList(); + for (auto &c : components) { + auto cc = c.toMap(); + if (cc["type"].toString() == "lane"){ + has_lanes = true; + + bool left = false; + bool straight = false; + bool right = false; + bool active = cc["active"].toBool(); + + for (auto &dir : cc["directions"].toList()){ + auto d = dir.toString(); + left |= d.contains("left"); + straight |= d.contains("straight"); + right |= d.contains("right"); + } + + // TODO: Make more images based on active direction and combined directions + QString fn = "../assets/navigation/direction_"; + if (left) { + fn += "turn_left"; + } else if (right){ + fn += "turn_right"; + } else if (straight) { + fn += "turn_straight"; + } + + QPixmap pix(fn + ".png"); + auto icon = new QLabel; + icon->setPixmap(pix.scaledToWidth(active ? 125 : 75, Qt::SmoothTransformation)); + icon->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + lane_layout->addWidget(icon); + } + } + } + + primary->setText(primary_str); + secondary->setVisible(secondary_str.length() > 0); + secondary->setText(secondary_str); + adjustSize(); + last_banner = banner; +} diff --git a/selfdrive/ui/qt/maps/map.h b/selfdrive/ui/qt/maps/map.h new file mode 100644 index 0000000000..e282859c36 --- /dev/null +++ b/selfdrive/ui/qt/maps/map.h @@ -0,0 +1,99 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cereal/messaging/messaging.h" + +class MapWindow : public QOpenGLWidget { + Q_OBJECT + +public: + MapWindow(const QMapboxGLSettings &); + ~MapWindow(); + +private: + void initializeGL() final; + void paintGL() final; + void resizeGL(int w, int h) override; + + QMapboxGLSettings m_settings; + QScopedPointer m_map; + + void initLayers(); + + void mousePressEvent(QMouseEvent *ev) final; + void mouseMoveEvent(QMouseEvent *ev) final; + void wheelEvent(QWheelEvent *ev) final; + bool event(QEvent *event) final; + bool gestureEvent(QGestureEvent *event); + void pinchTriggered(QPinchGesture *gesture); + + bool m_sourceAdded = false; + SubMaster *sm; + QTimer* timer; + + // Panning + QPointF m_lastPos; + int pan_counter = 0; + int zoom_counter = 0; + + // Route + bool gps_ok = false; + bool has_route = false; + QGeoServiceProvider *geoservice_provider; + QGeoRoutingManager *routing_manager; + QGeoRoute route; + QGeoRouteSegment segment; + QWidget* map_instructions; + QMapbox::Coordinate last_position = QMapbox::Coordinate(37.7393118509158, -122.46471285025565); + QMapbox::Coordinate nav_destination; + double last_maneuver_distance = 1000; + void calculateRoute(QMapbox::Coordinate destination); + bool shouldRecompute(); + +private slots: + void timerUpdate(); + void routeCalculated(QGeoRouteReply *reply); + +signals: + void distanceChanged(float distance); + void instructionsChanged(QMap banner); +}; + +class MapInstructions : public QWidget { + Q_OBJECT + +private: + QLabel *distance; + QLabel *primary; + QLabel *secondary; + QLabel *icon_01; + QHBoxLayout *lane_layout; + QMap last_banner; + +public: + MapInstructions(QWidget * parent=nullptr); + +public slots: + void updateDistance(float d); + void updateInstructions(QMap banner); +}; diff --git a/selfdrive/ui/qt/maps/map_helpers.cc b/selfdrive/ui/qt/maps/map_helpers.cc new file mode 100644 index 0000000000..d5c0e405d4 --- /dev/null +++ b/selfdrive/ui/qt/maps/map_helpers.cc @@ -0,0 +1,86 @@ +#include "selfdrive/ui/qt/maps/map_helpers.h" + + +QGeoCoordinate to_QGeoCoordinate(const QMapbox::Coordinate &in) { + return QGeoCoordinate(in.first, in.second); +} + +QMapbox::CoordinatesCollections model_to_collection( + const cereal::LiveLocationKalman::Measurement::Reader &calibratedOrientationECEF, + const cereal::LiveLocationKalman::Measurement::Reader &positionECEF, + const cereal::ModelDataV2::XYZTData::Reader &line){ + + Eigen::Vector3d ecef(positionECEF.getValue()[0], positionECEF.getValue()[1], positionECEF.getValue()[2]); + Eigen::Vector3d orient(calibratedOrientationECEF.getValue()[0], calibratedOrientationECEF.getValue()[1], calibratedOrientationECEF.getValue()[2]); + Eigen::Matrix3d ecef_from_local = euler2rot(orient).transpose(); + + QMapbox::Coordinates coordinates; + auto x = line.getX(); + auto y = line.getY(); + auto z = line.getZ(); + for (int i = 0; i < x.size(); i++){ + Eigen::Vector3d point_ecef = ecef_from_local * Eigen::Vector3d(x[i], y[i], z[i]) + ecef; + Geodetic point_geodetic = ecef2geodetic((ECEF){.x = point_ecef[0], .y = point_ecef[1], .z = point_ecef[2]}); + QMapbox::Coordinate coordinate(point_geodetic.lat, point_geodetic.lon); + coordinates.push_back(coordinate); + } + + QMapbox::CoordinatesCollection collection; + collection.push_back(coordinates); + + QMapbox::CoordinatesCollections collections; + collections.push_back(collection); + return collections; +} + +QMapbox::CoordinatesCollections coordinate_to_collection(QMapbox::Coordinate c){ + QMapbox::Coordinates coordinates; + coordinates.push_back(c); + + QMapbox::CoordinatesCollection collection; + collection.push_back(coordinates); + + QMapbox::CoordinatesCollections collections; + collections.push_back(collection); + return collections; +} + +QMapbox::CoordinatesCollections coordinate_list_to_collection(QList coordinate_list) { + QMapbox::Coordinates coordinates; + + for (auto &c : coordinate_list){ + QMapbox::Coordinate coordinate(c.latitude(), c.longitude()); + coordinates.push_back(coordinate); + } + + QMapbox::CoordinatesCollection collection; + collection.push_back(coordinates); + + QMapbox::CoordinatesCollections collections; + collections.push_back(collection); + return collections; +} + +static QGeoCoordinate sub(QGeoCoordinate v, QGeoCoordinate w){ + return QGeoCoordinate(v.latitude() - w.latitude(), v.longitude() - w.longitude()); +} + +static QGeoCoordinate add(QGeoCoordinate v, QGeoCoordinate w){ + return QGeoCoordinate(v.latitude() + w.latitude(), v.longitude() + w.longitude()); +} + +static QGeoCoordinate mul(QGeoCoordinate v, float c){ + return QGeoCoordinate(c * v.latitude(), c * v.longitude()); +} + +static float dot(QGeoCoordinate v, QGeoCoordinate w){ + return v.latitude() * w.latitude() + v.longitude() * w.longitude(); +} + +float minimum_distance(QGeoCoordinate a, QGeoCoordinate b, QGeoCoordinate p) { + const QGeoCoordinate ap = sub(p, a); + const QGeoCoordinate ab = sub(b, a); + const float t = std::clamp(dot(ap, ab) / dot(ab, ab), 0.0f, 1.0f); + const QGeoCoordinate projection = add(a, mul(ab, t)); + return projection.distanceTo(p); +} diff --git a/selfdrive/ui/qt/maps/map_helpers.h b/selfdrive/ui/qt/maps/map_helpers.h new file mode 100644 index 0000000000..acf42d8b6c --- /dev/null +++ b/selfdrive/ui/qt/maps/map_helpers.h @@ -0,0 +1,23 @@ +#pragma once + +#include +#include +#include + +#include "common/transformations/coordinates.hpp" +#include "common/transformations/orientation.hpp" +#include "cereal/messaging/messaging.h" + +const float METER_2_MILE = 0.000621371; +const float METER_2_FOOT = 3.28084; +#define RAD2DEG(x) ((x) * 180.0 / M_PI) + +QGeoCoordinate to_QGeoCoordinate(const QMapbox::Coordinate &in); +QMapbox::CoordinatesCollections model_to_collection( + const cereal::LiveLocationKalman::Measurement::Reader &calibratedOrientationECEF, + const cereal::LiveLocationKalman::Measurement::Reader &positionECEF, + const cereal::ModelDataV2::XYZTData::Reader &line); +QMapbox::CoordinatesCollections coordinate_to_collection(QMapbox::Coordinate c); +QMapbox::CoordinatesCollections coordinate_list_to_collection(QList coordinate_list); + +float minimum_distance(QGeoCoordinate a, QGeoCoordinate b, QGeoCoordinate p); diff --git a/selfdrive/ui/qt/offroad/networking.cc b/selfdrive/ui/qt/offroad/networking.cc index dd3cd5ba53..901315ac52 100644 --- a/selfdrive/ui/qt/offroad/networking.cc +++ b/selfdrive/ui/qt/offroad/networking.cc @@ -6,18 +6,7 @@ #include #include "selfdrive/ui/qt/widgets/scrollview.h" - -void clearLayout(QLayout* layout) { - while (QLayoutItem* item = layout->takeAt(0)) { - if (QWidget* widget = item->widget()) { - widget->deleteLater(); - } - if (QLayout* childLayout = item->layout()) { - clearLayout(childLayout); - } - delete item; - } -} +#include "selfdrive/ui/qt/util.h" // Networking functions diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index 7458780edc..ecbe57926b 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -7,15 +7,39 @@ #include "selfdrive/ui/paint.h" #include "selfdrive/ui/qt/util.h" +#ifdef ENABLE_MAPS +#include "selfdrive/ui/qt/maps/map.h" +#endif + OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent) { - layout = new QStackedLayout(); + layout = new QStackedLayout(this); layout->setStackingMode(QStackedLayout::StackAll); // old UI on bottom nvg = new NvgWindow(this); - layout->addWidget(nvg); QObject::connect(this, &OnroadWindow::update, nvg, &NvgWindow::update); + QHBoxLayout* split = new QHBoxLayout(); + split->setContentsMargins(0, 0, 0, 0); + split->setSpacing(0); + split->addWidget(nvg); + +#ifdef ENABLE_MAPS + QString token = QString::fromStdString(Params().get("MapboxToken")); + if (!token.isEmpty()){ + QMapboxGLSettings settings; + settings.setCacheDatabasePath("/tmp/mbgl-cache.db"); + settings.setCacheDatabaseMaximumSize(20 * 1024 * 1024); + settings.setAccessToken(token); + map = new MapWindow(settings); + split->addWidget(map); + } +#endif + + QWidget * split_wrapper = new QWidget; + split_wrapper->setLayout(split); + layout->addWidget(split_wrapper); + alerts = new OnroadAlerts(this); QObject::connect(this, &OnroadWindow::update, alerts, &OnroadAlerts::updateState); QObject::connect(this, &OnroadWindow::offroadTransition, alerts, &OnroadAlerts::offroadTransition); @@ -193,6 +217,10 @@ void NvgWindow::update(const UIState &s) { repaint(); } +void NvgWindow::resizeGL(int w, int h) { + ui_resize(&QUIState::ui_state, w, h); +} + void NvgWindow::paintGL() { ui_draw(&QUIState::ui_state, width(), height()); diff --git a/selfdrive/ui/qt/onroad.h b/selfdrive/ui/qt/onroad.h index 9e93164e5a..776030a61a 100644 --- a/selfdrive/ui/qt/onroad.h +++ b/selfdrive/ui/qt/onroad.h @@ -66,6 +66,7 @@ public: protected: void paintGL() override; void initializeGL() override; + void resizeGL(int w, int h) override; private: double prev_draw_t = 0; @@ -80,6 +81,7 @@ class OnroadWindow : public QWidget { public: OnroadWindow(QWidget* parent = 0); + QWidget *map = nullptr; private: OnroadAlerts *alerts; diff --git a/selfdrive/ui/qt/util.h b/selfdrive/ui/qt/util.h index 0ba42d3d85..f6eca88abd 100644 --- a/selfdrive/ui/qt/util.h +++ b/selfdrive/ui/qt/util.h @@ -8,3 +8,15 @@ inline void configFont(QPainter &p, QString family, int size, const QString &sty f.setStyleName(style); p.setFont(f); } + +inline void clearLayout(QLayout* layout) { + while (QLayoutItem* item = layout->takeAt(0)) { + if (QWidget* widget = item->widget()) { + widget->deleteLater(); + } + if (QLayout* childLayout = item->layout()) { + clearLayout(childLayout); + } + delete item; + } +} diff --git a/selfdrive/ui/ui b/selfdrive/ui/ui index e1c1748e30..0645287490 100755 --- a/selfdrive/ui/ui +++ b/selfdrive/ui/ui @@ -1,3 +1,4 @@ #!/bin/sh export LD_LIBRARY_PATH="/system/lib64:$LD_LIBRARY_PATH" +export QT_PLUGIN_PATH="../../phonelibs/qt-plugins/$(uname -m)" exec ./_ui diff --git a/tools/ubuntu_setup.sh b/tools/ubuntu_setup.sh index 1ac31bcc3a..16893f6a20 100755 --- a/tools/ubuntu_setup.sh +++ b/tools/ubuntu_setup.sh @@ -45,12 +45,15 @@ sudo apt-get update && sudo apt-get install -y --no-install-recommends \ qt5-default \ qtmultimedia5-dev \ qtwebengine5-dev \ + qtlocation5-dev \ + qtpositioning5-dev \ + libqt5sql5-sqlite \ + libqt5svg5-dev \ screen \ sudo \ vim \ wget \ gcc-arm-none-eabi \ - libqt5svg5-dev \ libqt5x11extras5-dev \ libreadline-dev