diff --git a/.vscode/launch.json b/.vscode/launch.json index 3b3953c3f4..a6b341d9ea 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,7 +7,6 @@ "description": "Select the process to debug", "options": [ "selfdrive/controls/controlsd.py", - "selfdrive/navd/navd.py", "system/timed/timed.py", "tools/sim/run_bridge.py" ] diff --git a/SConstruct b/SConstruct index f53d8fb7d0..0c4dbee18e 100644 --- a/SConstruct +++ b/SConstruct @@ -14,8 +14,6 @@ SCons.Warnings.warningAsException(True) TICI = os.path.isfile('/TICI') AGNOS = TICI -UBUNTU_FOCAL = int(subprocess.check_output('[ -f /etc/os-release ] && . /etc/os-release && [ "$ID" = "ubuntu" ] && [ "$VERSION_ID" = "20.04" ] && echo 1 || echo 0', shell=True, encoding='utf-8').rstrip()) -Export('UBUNTU_FOCAL') Decider('MD5-timestamp') @@ -213,8 +211,6 @@ env = Environment( "#cereal", "#msgq", "#opendbc/can", - "#third_party/maplibre-native-qt/include", - f"#third_party/maplibre-native-qt/{arch}/include" ], CC='clang', @@ -279,7 +275,7 @@ Export('envCython') # Qt build environment qt_env = env.Clone() -qt_modules = ["Widgets", "Gui", "Core", "Network", "Concurrent", "Multimedia", "Quick", "Qml", "QuickWidgets", "Location", "Positioning", "DBus", "Xml"] +qt_modules = ["Widgets", "Gui", "Core", "Network", "Concurrent", "Multimedia", "Quick", "Qml", "QuickWidgets", "DBus", "Xml"] qt_libs = [] if arch == "Darwin": @@ -332,8 +328,7 @@ qt_flags = [ "-DQT_MESSAGELOGCONTEXT", ] qt_env['CXXFLAGS'] += qt_flags -qt_env['LIBPATH'] += ['#selfdrive/ui', f"#third_party/maplibre-native-qt/{arch}/lib"] -qt_env['RPATH'] += [Dir(f"#third_party/maplibre-native-qt/{arch}/lib").srcnode().abspath] +qt_env['LIBPATH'] += ['#selfdrive/ui', ] qt_env['LIBS'] = qt_libs if GetOption("clazy"): diff --git a/common/params.cc b/common/params.cc index 2330160173..6e6bba8867 100644 --- a/common/params.cc +++ b/common/params.cc @@ -91,7 +91,6 @@ std::unordered_map keys = { {"AccessToken", CLEAR_ON_MANAGER_START | DONT_LOG}, {"AlwaysOnDM", PERSISTENT}, {"ApiCache_Device", PERSISTENT}, - {"ApiCache_NavDestinations", PERSISTENT}, {"AssistNowToken", PERSISTENT}, {"AthenadPid", PERSISTENT}, {"AthenadUploadQueue", PERSISTENT}, @@ -160,11 +159,6 @@ std::unordered_map keys = { {"LiveParameters", PERSISTENT}, {"LiveTorqueParameters", PERSISTENT | DONT_LOG}, {"LongitudinalPersonality", PERSISTENT}, - {"NavDestination", CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION}, - {"NavDestinationWaypoints", CLEAR_ON_MANAGER_START | CLEAR_ON_OFFROAD_TRANSITION}, - {"NavPastDestinations", PERSISTENT}, - {"NavSettingLeftSide", PERSISTENT}, - {"NavSettingTime24h", PERSISTENT}, {"NetworkMetered", PERSISTENT}, {"ObdMultiplexingChanged", CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION}, {"ObdMultiplexingEnabled", CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION}, diff --git a/docs/c_docs.rst b/docs/c_docs.rst index 3b89fe9874..0d65423c08 100644 --- a/docs/c_docs.rst +++ b/docs/c_docs.rst @@ -50,8 +50,6 @@ qt "" .. autodoxygenindex:: :project: selfdrive_ui_qt_offroad -.. autodoxygenindex:: - :project: selfdrive_ui_qt_maps proclogd ^^^^^^^^ diff --git a/poetry.lock b/poetry.lock index cc4680364e..2acd06bfcb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4bdc23d7e7357d3526ae6d3d51bae68dafdf9a1f27bc9e6514140eaa5756f457 -size 629333 +oid sha256:a1db5598e5df23f5e8a84123cf1e5ffc1c9d79673661d245ddfd88af15a0d2cd +size 628327 diff --git a/pyproject.toml b/pyproject.toml index 374b0f46ca..1aa20b5b8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,6 @@ testpaths = [ "selfdrive/controls", "selfdrive/locationd", "selfdrive/monitoring", - "selfdrive/navd/tests", "selfdrive/test/longitudinal_maneuvers", "selfdrive/test/process_replay/test_fuzzy.py", "system/updated", @@ -183,7 +182,6 @@ natsort = "*" opencv-python-headless = "*" parameterized = "^0.8" #pprofile = "*" -polyline = "*" pyautogui = "*" pygame = "*" pyopencl = { version = "*", markers = "platform_machine != 'aarch64'" } # broken on arm64 diff --git a/selfdrive/SConscript b/selfdrive/SConscript index 52898f758f..0b49e69116 100644 --- a/selfdrive/SConscript +++ b/selfdrive/SConscript @@ -2,6 +2,5 @@ SConscript(['pandad/SConscript']) SConscript(['controls/lib/lateral_mpc_lib/SConscript']) SConscript(['controls/lib/longitudinal_mpc_lib/SConscript']) SConscript(['locationd/SConscript']) -SConscript(['navd/SConscript']) SConscript(['modeld/SConscript']) SConscript(['ui/SConscript']) \ No newline at end of file diff --git a/selfdrive/assets/img_map.png b/selfdrive/assets/img_map.png deleted file mode 100644 index a8646491d7..0000000000 --- a/selfdrive/assets/img_map.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4a197665ae2a7fc05109903474d513379711f7b7f555c4148ca99d589c95baf7 -size 31990 diff --git a/selfdrive/assets/navigation/default_marker.svg b/selfdrive/assets/navigation/default_marker.svg deleted file mode 100644 index 4b11ee7623..0000000000 --- a/selfdrive/assets/navigation/default_marker.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a950b541c4e676475e3571aaa806060c3309c7f44b08a59f1ada19881b42493d -size 389 diff --git a/selfdrive/assets/navigation/direction_arrive.png b/selfdrive/assets/navigation/direction_arrive.png deleted file mode 100644 index f8c5bdc2d8..0000000000 --- a/selfdrive/assets/navigation/direction_arrive.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 6f59ab3711..0000000000 --- a/selfdrive/assets/navigation/direction_arrive_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 318e041339..0000000000 --- a/selfdrive/assets/navigation/direction_arrive_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index f8c5bdc2d8..0000000000 --- a/selfdrive/assets/navigation/direction_arrive_straight.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 0e9e478d45..0000000000 --- a/selfdrive/assets/navigation/direction_close.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ce2c42c43d..0000000000 --- a/selfdrive/assets/navigation/direction_continue.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 438532ee29..0000000000 --- a/selfdrive/assets/navigation/direction_continue_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 4ee7ebc3b4..0000000000 --- a/selfdrive/assets/navigation/direction_continue_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 29f4440460..0000000000 --- a/selfdrive/assets/navigation/direction_continue_slight_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 755935b84c..0000000000 --- a/selfdrive/assets/navigation/direction_continue_slight_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ce2c42c43d..0000000000 --- a/selfdrive/assets/navigation/direction_continue_straight.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ff9d97893f..0000000000 --- a/selfdrive/assets/navigation/direction_continue_uturn.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index aa4e4f7115..0000000000 --- a/selfdrive/assets/navigation/direction_depart.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 76937eb5d3..0000000000 --- a/selfdrive/assets/navigation/direction_depart_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 149626b171..0000000000 --- a/selfdrive/assets/navigation/direction_depart_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index aa4e4f7115..0000000000 --- a/selfdrive/assets/navigation/direction_depart_straight.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 32a602bdef..0000000000 --- a/selfdrive/assets/navigation/direction_end_of_road_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 68915cee25..0000000000 --- a/selfdrive/assets/navigation/direction_end_of_road_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 26e8a220f2..0000000000 --- a/selfdrive/assets/navigation/direction_flag.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index c3019a5991..0000000000 --- a/selfdrive/assets/navigation/direction_fork.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index a847257e9b..0000000000 --- a/selfdrive/assets/navigation/direction_fork_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 102ddf753c..0000000000 --- a/selfdrive/assets/navigation/direction_fork_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 945ef744e0..0000000000 --- a/selfdrive/assets/navigation/direction_fork_slight_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 65db839df9..0000000000 --- a/selfdrive/assets/navigation/direction_fork_slight_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 74528d230c..0000000000 --- a/selfdrive/assets/navigation/direction_fork_straight.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ce2c42c43d..0000000000 --- a/selfdrive/assets/navigation/direction_invalid.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 438532ee29..0000000000 --- a/selfdrive/assets/navigation/direction_invalid_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 4ee7ebc3b4..0000000000 --- a/selfdrive/assets/navigation/direction_invalid_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 29f4440460..0000000000 --- a/selfdrive/assets/navigation/direction_invalid_slight_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 755935b84c..0000000000 --- a/selfdrive/assets/navigation/direction_invalid_slight_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ce2c42c43d..0000000000 --- a/selfdrive/assets/navigation/direction_invalid_straight.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ff9d97893f..0000000000 --- a/selfdrive/assets/navigation/direction_invalid_uturn.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 7812f9eb94..0000000000 --- a/selfdrive/assets/navigation/direction_merge_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 3c44c8fc75..0000000000 --- a/selfdrive/assets/navigation/direction_merge_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 756fb01853..0000000000 --- a/selfdrive/assets/navigation/direction_merge_slight_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index b8d42b741f..0000000000 --- a/selfdrive/assets/navigation/direction_merge_slight_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 60035c1f01..0000000000 --- a/selfdrive/assets/navigation/direction_merge_straight.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 438532ee29..0000000000 --- a/selfdrive/assets/navigation/direction_new_name_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 4ee7ebc3b4..0000000000 --- a/selfdrive/assets/navigation/direction_new_name_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ae1f3741ef..0000000000 --- a/selfdrive/assets/navigation/direction_new_name_sharp_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 0d8cd3ed53..0000000000 --- a/selfdrive/assets/navigation/direction_new_name_sharp_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 29f4440460..0000000000 --- a/selfdrive/assets/navigation/direction_new_name_slight_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 755935b84c..0000000000 --- a/selfdrive/assets/navigation/direction_new_name_slight_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ce2c42c43d..0000000000 --- a/selfdrive/assets/navigation/direction_new_name_straight.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:008cf037b8713c710eacd1129973119faa2527ab1c19aee5340a16dc0659df8a -size 1063 diff --git a/selfdrive/assets/navigation/direction_notification_left.png b/selfdrive/assets/navigation/direction_notification_left.png deleted file mode 100644 index 438532ee29..0000000000 --- a/selfdrive/assets/navigation/direction_notification_left.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:579d6a27e062779d41beb9320abf5797bc8ec81de1f355a4197c3b3ee0766f28 -size 1400 diff --git a/selfdrive/assets/navigation/direction_notification_right.png b/selfdrive/assets/navigation/direction_notification_right.png deleted file mode 100644 index 4ee7ebc3b4..0000000000 --- a/selfdrive/assets/navigation/direction_notification_right.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a4010c8122af918dbdb50e88629adbf79f7733f022bba263e6f44f6ffae3e7a5 -size 1371 diff --git a/selfdrive/assets/navigation/direction_notification_sharp_left.png b/selfdrive/assets/navigation/direction_notification_sharp_left.png deleted file mode 100644 index d2f1d491a0..0000000000 --- a/selfdrive/assets/navigation/direction_notification_sharp_left.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4f2016b7bac3accf541f100a2c83871618214e1806e95e4d80867d30d1dfcf03 -size 1546 diff --git a/selfdrive/assets/navigation/direction_notification_sharp_right.png b/selfdrive/assets/navigation/direction_notification_sharp_right.png deleted file mode 100644 index f338742e58..0000000000 --- a/selfdrive/assets/navigation/direction_notification_sharp_right.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:57dbfdabe88f6abbb8993982eef72803ac504842e9a9d388e7dde1623f69f0d7 -size 1551 diff --git a/selfdrive/assets/navigation/direction_notification_slight_left.png b/selfdrive/assets/navigation/direction_notification_slight_left.png deleted file mode 100644 index 29f4440460..0000000000 --- a/selfdrive/assets/navigation/direction_notification_slight_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 755935b84c..0000000000 --- a/selfdrive/assets/navigation/direction_notification_slight_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ce2c42c43d..0000000000 --- a/selfdrive/assets/navigation/direction_notification_straight.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index d01bb4fce3..0000000000 --- a/selfdrive/assets/navigation/direction_off_ramp_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 013ec5a4c9..0000000000 --- a/selfdrive/assets/navigation/direction_off_ramp_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 39497c8d41..0000000000 --- a/selfdrive/assets/navigation/direction_off_ramp_slight_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index a68d28d674..0000000000 --- a/selfdrive/assets/navigation/direction_off_ramp_slight_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 438532ee29..0000000000 --- a/selfdrive/assets/navigation/direction_on_ramp_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 4ee7ebc3b4..0000000000 --- a/selfdrive/assets/navigation/direction_on_ramp_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ae1f3741ef..0000000000 --- a/selfdrive/assets/navigation/direction_on_ramp_sharp_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index f338742e58..0000000000 --- a/selfdrive/assets/navigation/direction_on_ramp_sharp_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index e640fe3404..0000000000 --- a/selfdrive/assets/navigation/direction_on_ramp_slight_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index d309f2d14e..0000000000 --- a/selfdrive/assets/navigation/direction_on_ramp_slight_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ce2c42c43d..0000000000 --- a/selfdrive/assets/navigation/direction_on_ramp_straight.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 20b4052015..0000000000 --- a/selfdrive/assets/navigation/direction_rotary.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index f610501286..0000000000 --- a/selfdrive/assets/navigation/direction_rotary_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 9b8ea37ddf..0000000000 --- a/selfdrive/assets/navigation/direction_rotary_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index cbc0882791..0000000000 --- a/selfdrive/assets/navigation/direction_rotary_sharp_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index c7d4ba3175..0000000000 --- a/selfdrive/assets/navigation/direction_rotary_sharp_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 9b5912030b..0000000000 --- a/selfdrive/assets/navigation/direction_rotary_slight_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index bc5e6b0d2e..0000000000 --- a/selfdrive/assets/navigation/direction_rotary_slight_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ac4eec685e..0000000000 --- a/selfdrive/assets/navigation/direction_rotary_straight.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 20b4052015..0000000000 --- a/selfdrive/assets/navigation/direction_roundabout.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index f610501286..0000000000 --- a/selfdrive/assets/navigation/direction_roundabout_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 9b8ea37ddf..0000000000 --- a/selfdrive/assets/navigation/direction_roundabout_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 204586589d..0000000000 --- a/selfdrive/assets/navigation/direction_roundabout_sharp_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index c7d4ba3175..0000000000 --- a/selfdrive/assets/navigation/direction_roundabout_sharp_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index d8b806137c..0000000000 --- a/selfdrive/assets/navigation/direction_roundabout_slight_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index bc5e6b0d2e..0000000000 --- a/selfdrive/assets/navigation/direction_roundabout_slight_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ac4eec685e..0000000000 --- a/selfdrive/assets/navigation/direction_roundabout_straight.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 438532ee29..0000000000 --- a/selfdrive/assets/navigation/direction_turn_left.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:579d6a27e062779d41beb9320abf5797bc8ec81de1f355a4197c3b3ee0766f28 -size 1400 diff --git a/selfdrive/assets/navigation/direction_turn_left_inactive.png b/selfdrive/assets/navigation/direction_turn_left_inactive.png deleted file mode 100644 index 7f461a1967..0000000000 --- a/selfdrive/assets/navigation/direction_turn_left_inactive.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5229d184ca31e027d8c8d493b7d02a34c8097348aab97e10adc7fd78acf6a7fc -size 7221 diff --git a/selfdrive/assets/navigation/direction_turn_right.png b/selfdrive/assets/navigation/direction_turn_right.png deleted file mode 100644 index 4ee7ebc3b4..0000000000 --- a/selfdrive/assets/navigation/direction_turn_right.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a4010c8122af918dbdb50e88629adbf79f7733f022bba263e6f44f6ffae3e7a5 -size 1371 diff --git a/selfdrive/assets/navigation/direction_turn_right_inactive.png b/selfdrive/assets/navigation/direction_turn_right_inactive.png deleted file mode 100644 index bc0a98dccf..0000000000 --- a/selfdrive/assets/navigation/direction_turn_right_inactive.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fc6c17196f0e345e7c79b60faadd931755b3d1572125557ff263247e7b3a0b4b -size 7239 diff --git a/selfdrive/assets/navigation/direction_turn_sharp_left.png b/selfdrive/assets/navigation/direction_turn_sharp_left.png deleted file mode 100644 index d2f1d491a0..0000000000 --- a/selfdrive/assets/navigation/direction_turn_sharp_left.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index f338742e58..0000000000 --- a/selfdrive/assets/navigation/direction_turn_sharp_right.png +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 29f4440460..0000000000 --- a/selfdrive/assets/navigation/direction_turn_slight_left.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:89041889817454869d98adfb5a16fae33596c038d5484ec734fe3a5cc532c45c -size 1334 diff --git a/selfdrive/assets/navigation/direction_turn_slight_left_inactive.png b/selfdrive/assets/navigation/direction_turn_slight_left_inactive.png deleted file mode 100644 index 7c970ebb81..0000000000 --- a/selfdrive/assets/navigation/direction_turn_slight_left_inactive.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5ce2ea01f9ed172048c86b93e0ebfa8f468473de49be92ad200fb54d688434cb -size 3696 diff --git a/selfdrive/assets/navigation/direction_turn_slight_right.png b/selfdrive/assets/navigation/direction_turn_slight_right.png deleted file mode 100644 index 755935b84c..0000000000 --- a/selfdrive/assets/navigation/direction_turn_slight_right.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e691dd43947c9430fcd73e6bede94aa5fd8995e9303eba53cc0ac589a7c9f106 -size 1347 diff --git a/selfdrive/assets/navigation/direction_turn_slight_right_inactive.png b/selfdrive/assets/navigation/direction_turn_slight_right_inactive.png deleted file mode 100644 index 15611decaa..0000000000 --- a/selfdrive/assets/navigation/direction_turn_slight_right_inactive.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6c1a3d5ee5f493093848b0b5f09e3572bf3cb8a6f79907fcb1b1bd4d690bc634 -size 3743 diff --git a/selfdrive/assets/navigation/direction_turn_straight.png b/selfdrive/assets/navigation/direction_turn_straight.png deleted file mode 100644 index ce2c42c43d..0000000000 --- a/selfdrive/assets/navigation/direction_turn_straight.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:008cf037b8713c710eacd1129973119faa2527ab1c19aee5340a16dc0659df8a -size 1063 diff --git a/selfdrive/assets/navigation/direction_turn_straight_inactive.png b/selfdrive/assets/navigation/direction_turn_straight_inactive.png deleted file mode 100644 index d864e58bd9..0000000000 --- a/selfdrive/assets/navigation/direction_turn_straight_inactive.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2cd32abafe04c8f79d3249a79a32473102ddab7770cb8be29d51b2743869fdaa -size 5452 diff --git a/selfdrive/assets/navigation/direction_turn_uturn.png b/selfdrive/assets/navigation/direction_turn_uturn.png deleted file mode 100644 index ff9d97893f..0000000000 --- a/selfdrive/assets/navigation/direction_turn_uturn.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e02ac2720f12f9373ae2d86d91fffb6203e18aba04b493bd6f41d2953a11cbc9 -size 1780 diff --git a/selfdrive/assets/navigation/direction_updown.png b/selfdrive/assets/navigation/direction_updown.png deleted file mode 100644 index 3c9e3fe22e..0000000000 --- a/selfdrive/assets/navigation/direction_updown.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:41adb4c64ca3cecf2f6de7dcca8826980369995959ad0eb3d7ec584bbac9b4a6 -size 1327 diff --git a/selfdrive/assets/navigation/home.png b/selfdrive/assets/navigation/home.png deleted file mode 100644 index 321cef4163..0000000000 --- a/selfdrive/assets/navigation/home.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6e2fcc5b07c69bb71506257a37d0fd6abe3bd53892f34d6600a3a09795174da5 -size 6128 diff --git a/selfdrive/assets/navigation/home.svg b/selfdrive/assets/navigation/home.svg deleted file mode 100644 index 9d9c60da39..0000000000 --- a/selfdrive/assets/navigation/home.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:62f1548c61503d8fdb03592413c38204834d52b30b6fb18d1a9982229616a97e -size 2713 diff --git a/selfdrive/assets/navigation/home_inactive.png b/selfdrive/assets/navigation/home_inactive.png deleted file mode 100644 index 9ffaf2b87b..0000000000 --- a/selfdrive/assets/navigation/home_inactive.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d5dc1f7709720d51911e1c2bd61a6bed9fe30c48807b9f26f542e280c54c1a74 -size 9165 diff --git a/selfdrive/assets/navigation/icon_directions.svg b/selfdrive/assets/navigation/icon_directions.svg deleted file mode 100644 index c36e27316e..0000000000 --- a/selfdrive/assets/navigation/icon_directions.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:935cd01600d56350cda1941cf382c7c86cd959fa7a0a574bdba8b3011a350578 -size 466 diff --git a/selfdrive/assets/navigation/icon_directions_outlined.svg b/selfdrive/assets/navigation/icon_directions_outlined.svg deleted file mode 100644 index 356a1e7456..0000000000 --- a/selfdrive/assets/navigation/icon_directions_outlined.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e5f0b26a56397872f8ac6085a18b666fba4cdf01299f73d704cb29b22c64606 -size 780 diff --git a/selfdrive/assets/navigation/icon_favorite.svg b/selfdrive/assets/navigation/icon_favorite.svg deleted file mode 100644 index 0eb0e43688..0000000000 --- a/selfdrive/assets/navigation/icon_favorite.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ff184bf0239c54060ffbaf465573f17cbc92bd8d3d38ce10e1bd02cdd2b21575 -size 315 diff --git a/selfdrive/assets/navigation/icon_home.svg b/selfdrive/assets/navigation/icon_home.svg deleted file mode 100644 index ca90cc7bf6..0000000000 --- a/selfdrive/assets/navigation/icon_home.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1673f8d46251a05787b60346193852991739345506dc7e9b106dfb370d3611ed -size 489 diff --git a/selfdrive/assets/navigation/icon_recent.svg b/selfdrive/assets/navigation/icon_recent.svg deleted file mode 100644 index 76b5a620b1..0000000000 --- a/selfdrive/assets/navigation/icon_recent.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5fbce167d2005d08e8bc2113e0a9d5d3e2ed113db8e2a020df1ee14633cd3eed -size 1279 diff --git a/selfdrive/assets/navigation/icon_settings.svg b/selfdrive/assets/navigation/icon_settings.svg deleted file mode 100644 index 3fd31459c3..0000000000 --- a/selfdrive/assets/navigation/icon_settings.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1fa72d94b5e05884129dd502babd5de78666c349bb5d12e19872fdbc9fe2100e -size 910 diff --git a/selfdrive/assets/navigation/icon_work.svg b/selfdrive/assets/navigation/icon_work.svg deleted file mode 100644 index dc18914a39..0000000000 --- a/selfdrive/assets/navigation/icon_work.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7ea949d3b66896ac3404d20aea9445a5cd00fefd18623f1c7160293a1de5f807 -size 364 diff --git a/selfdrive/assets/navigation/work.png b/selfdrive/assets/navigation/work.png deleted file mode 100644 index 589087a8aa..0000000000 --- a/selfdrive/assets/navigation/work.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:49aef21620a5d2666c87975b28c6eb1cc8e613c80e504d97f5278cde25872c9d -size 5570 diff --git a/selfdrive/assets/navigation/work.svg b/selfdrive/assets/navigation/work.svg deleted file mode 100644 index 0f6a9ba65b..0000000000 --- a/selfdrive/assets/navigation/work.svg +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d2495943fec4ab00b1df5e4e6227bbec45ec57b19b25be561d616292316212f8 -size 2188 diff --git a/selfdrive/assets/navigation/work_inactive.png b/selfdrive/assets/navigation/work_inactive.png deleted file mode 100644 index c1ce69b004..0000000000 --- a/selfdrive/assets/navigation/work_inactive.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:93e6a2b405bbbdf48d54fc7c37612430f6688cf8541ee59b984d6add3b8f02a7 -size 8446 diff --git a/selfdrive/assets/offroad/icon_map.png b/selfdrive/assets/offroad/icon_map.png deleted file mode 100644 index 82c0236a48..0000000000 --- a/selfdrive/assets/offroad/icon_map.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:57a92adcf88c7223b07697f8c2b315f4f4a34b32a866284610d5250144863c6f -size 28235 diff --git a/selfdrive/assets/offroad/icon_map_speed.png b/selfdrive/assets/offroad/icon_map_speed.png deleted file mode 100644 index 4ed1de314b..0000000000 --- a/selfdrive/assets/offroad/icon_map_speed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7e950f121f7ed564b149dd430527c8f0ef976b6d9af66a61fb7b5ebaf7170185 -size 29822 diff --git a/selfdrive/navd/.gitignore b/selfdrive/navd/.gitignore deleted file mode 100644 index 4801d60a2c..0000000000 --- a/selfdrive/navd/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -moc_* -*.moc - -mapsd -map_renderer -libmap_renderer.so diff --git a/selfdrive/navd/README.md b/selfdrive/navd/README.md deleted file mode 100644 index 81de8ae39f..0000000000 --- a/selfdrive/navd/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# navigation - -This directory contains two daemons, `navd` and `mapsd`, which support navigation in the openpilot stack. - -### navd - -`navd` takes in a route through the `NavDestination` param and sends out two packets: `navRoute` and `navInstruction`. These packets contain the coordinates of the planned route and turn-by-turn instructions. - -### map renderer - -The map renderer listens for the `navRoute` and publishes a simplified rendered map view over VisionIPC. The rendered maps look like this: - -![](https://i.imgur.com/oZLfmwq.png) - -## development - -Currently, [mapbox](https://www.mapbox.com/) is used for navigation. - -* get an API token: https://docs.mapbox.com/help/glossary/access-token/ -* set an API token using the `MAPBOX_TOKEN` environment variable -* routes/destinations are set through the `NavDestination` param - * use `set_destination.py` for debugging -* edit the map: https://www.mapbox.com/contribute -* mapbox API playground: https://docs.mapbox.com/playground/ diff --git a/selfdrive/navd/SConscript b/selfdrive/navd/SConscript deleted file mode 100644 index 378e762494..0000000000 --- a/selfdrive/navd/SConscript +++ /dev/null @@ -1,20 +0,0 @@ -Import('qt_env', 'arch', 'common', 'messaging', 'visionipc', 'transformations', 'UBUNTU_FOCAL') - -map_env = qt_env.Clone() -libs = ['qt_widgets', 'qt_util', 'QMapLibre', common, messaging, visionipc, transformations, - 'm', 'OpenCL', 'ssl', 'crypto', 'pthread', 'json11'] + map_env["LIBS"] -if arch == 'larch64': - libs.append(':libEGL_mesa.so.0') - -if arch in ['larch64', 'aarch64', 'x86_64'] and not UBUNTU_FOCAL: - if arch == 'x86_64': - rpath = Dir(f"#third_party/maplibre-native-qt/{arch}/lib").srcnode().abspath - map_env["RPATH"] += [rpath, ] - - style_path = File("style.json").abspath - map_env['CXXFLAGS'].append(f'-DSTYLE_PATH=\\"{style_path}\\"') - - map_env["RPATH"].append(Dir('.').abspath) - map_env["LIBPATH"].append(Dir('.').abspath) - maplib = map_env.SharedLibrary("maprender", ["map_renderer.cc"], LIBS=libs) - # map_env.Program("mapsd", ["main.cc", ], LIBS=[maplib[0].get_path(), ] + libs) diff --git a/selfdrive/navd/__init__.py b/selfdrive/navd/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/selfdrive/navd/helpers.py b/selfdrive/navd/helpers.py deleted file mode 100644 index 0f0410c2c7..0000000000 --- a/selfdrive/navd/helpers.py +++ /dev/null @@ -1,189 +0,0 @@ -from __future__ import annotations - -import json -import math -from typing import Any, cast - -from openpilot.common.conversions import Conversions -from openpilot.common.numpy_fast import clip -from openpilot.common.params import Params - -DIRECTIONS = ('left', 'right', 'straight') -MODIFIABLE_DIRECTIONS = ('left', 'right') - -EARTH_MEAN_RADIUS = 6371007.2 -SPEED_CONVERSIONS = { - 'km/h': Conversions.KPH_TO_MS, - 'mph': Conversions.MPH_TO_MS, - } - - -class Coordinate: - def __init__(self, latitude: float, longitude: float) -> None: - self.latitude = latitude - self.longitude = longitude - self.annotations: dict[str, float] = {} - - @classmethod - def from_mapbox_tuple(cls, t: tuple[float, float]) -> Coordinate: - return cls(t[1], t[0]) - - def as_dict(self) -> dict[str, float]: - return {'latitude': self.latitude, 'longitude': self.longitude} - - def __str__(self) -> str: - return f'Coordinate({self.latitude}, {self.longitude})' - - def __repr__(self) -> str: - return self.__str__() - - def __eq__(self, other) -> bool: - if not isinstance(other, Coordinate): - return False - return (self.latitude == other.latitude) and (self.longitude == other.longitude) - - def __sub__(self, other: Coordinate) -> Coordinate: - return Coordinate(self.latitude - other.latitude, self.longitude - other.longitude) - - def __add__(self, other: Coordinate) -> Coordinate: - return Coordinate(self.latitude + other.latitude, self.longitude + other.longitude) - - def __mul__(self, c: float) -> Coordinate: - return Coordinate(self.latitude * c, self.longitude * c) - - def dot(self, other: Coordinate) -> float: - return self.latitude * other.latitude + self.longitude * other.longitude - - def distance_to(self, other: Coordinate) -> float: - # Haversine formula - dlat = math.radians(other.latitude - self.latitude) - dlon = math.radians(other.longitude - self.longitude) - - haversine_dlat = math.sin(dlat / 2.0) - haversine_dlat *= haversine_dlat - haversine_dlon = math.sin(dlon / 2.0) - haversine_dlon *= haversine_dlon - - y = haversine_dlat \ - + math.cos(math.radians(self.latitude)) \ - * math.cos(math.radians(other.latitude)) \ - * haversine_dlon - x = 2 * math.asin(math.sqrt(y)) - return x * EARTH_MEAN_RADIUS - - -def minimum_distance(a: Coordinate, b: Coordinate, p: Coordinate): - if a.distance_to(b) < 0.01: - return a.distance_to(p) - - ap = p - a - ab = b - a - t = clip(ap.dot(ab) / ab.dot(ab), 0.0, 1.0) - projection = a + ab * t - return projection.distance_to(p) - - -def distance_along_geometry(geometry: list[Coordinate], pos: Coordinate) -> float: - if len(geometry) <= 2: - return geometry[0].distance_to(pos) - - # 1. Find segment that is closest to current position - # 2. Total distance is sum of distance to start of closest segment - # + all previous segments - total_distance = 0.0 - total_distance_closest = 0.0 - closest_distance = 1e9 - - for i in range(len(geometry) - 1): - d = minimum_distance(geometry[i], geometry[i + 1], pos) - - if d < closest_distance: - closest_distance = d - total_distance_closest = total_distance + geometry[i].distance_to(pos) - - total_distance += geometry[i].distance_to(geometry[i + 1]) - - return total_distance_closest - - -def coordinate_from_param(param: str, params: Params = None) -> Coordinate | None: - if params is None: - params = Params() - - json_str = params.get(param) - if json_str is None: - return None - - pos = json.loads(json_str) - if 'latitude' not in pos or 'longitude' not in pos: - return None - - return Coordinate(pos['latitude'], pos['longitude']) - - -def string_to_direction(direction: str) -> str: - for d in DIRECTIONS: - if d in direction: - if 'slight' in direction and d in MODIFIABLE_DIRECTIONS: - return 'slight' + d.capitalize() - return d - return 'none' - - -def maxspeed_to_ms(maxspeed: dict[str, str | float]) -> float: - unit = cast(str, maxspeed['unit']) - speed = cast(float, maxspeed['speed']) - return SPEED_CONVERSIONS[unit] * speed - - -def field_valid(dat: dict, field: str) -> bool: - return field in dat and dat[field] is not None - - -def parse_banner_instructions(banners: Any, distance_to_maneuver: float = 0.0) -> dict[str, Any] | None: - if not len(banners): - return None - - instruction = {} - - # A segment can contain multiple banners, find one that we need to show now - current_banner = banners[0] - for banner in banners: - if distance_to_maneuver < banner['distanceAlongGeometry']: - current_banner = banner - - # Only show banner when close enough to maneuver - instruction['showFull'] = distance_to_maneuver < current_banner['distanceAlongGeometry'] - - # Primary - p = current_banner['primary'] - if field_valid(p, 'text'): - instruction['maneuverPrimaryText'] = p['text'] - if field_valid(p, 'type'): - instruction['maneuverType'] = p['type'] - if field_valid(p, 'modifier'): - instruction['maneuverModifier'] = p['modifier'] - - # Secondary - if field_valid(current_banner, 'secondary'): - instruction['maneuverSecondaryText'] = current_banner['secondary']['text'] - - # Lane lines - if field_valid(current_banner, 'sub'): - lanes = [] - for component in current_banner['sub']['components']: - if component['type'] != 'lane': - continue - - lane = { - 'active': component['active'], - 'directions': [string_to_direction(d) for d in component['directions']], - } - - if field_valid(component, 'active_direction'): - lane['activeDirection'] = string_to_direction(component['active_direction']) - - lanes.append(lane) - instruction['lanes'] = lanes - - return instruction diff --git a/selfdrive/navd/main.cc b/selfdrive/navd/main.cc deleted file mode 100644 index 2e7b4d3b60..0000000000 --- a/selfdrive/navd/main.cc +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -#include -#include - -#include "common/util.h" -#include "selfdrive/ui/qt/util.h" -#include "selfdrive/ui/qt/maps/map_helpers.h" -#include "selfdrive/navd/map_renderer.h" -#include "system/hardware/hw.h" - -int main(int argc, char *argv[]) { - Hardware::config_cpu_rendering(true); - - qInstallMessageHandler(swagLogMessageHandler); - setpriority(PRIO_PROCESS, 0, -20); - int ret = util::set_core_affinity({0, 1, 2, 3}); - assert(ret == 0); - - QApplication app(argc, argv); - std::signal(SIGINT, sigTermHandler); - std::signal(SIGTERM, sigTermHandler); - - MapRenderer * m = new MapRenderer(get_mapbox_settings()); - assert(m); - - return app.exec(); -} diff --git a/selfdrive/navd/map_renderer.cc b/selfdrive/navd/map_renderer.cc deleted file mode 100644 index 1e57ad3e7c..0000000000 --- a/selfdrive/navd/map_renderer.cc +++ /dev/null @@ -1,338 +0,0 @@ -#include "selfdrive/navd/map_renderer.h" - -#include -#include -#include -#include - -#include "common/util.h" -#include "common/timing.h" -#include "common/swaglog.h" -#include "selfdrive/ui/qt/maps/map_helpers.h" - -const float DEFAULT_ZOOM = 13.5; // Don't go below 13 or features will start to disappear -const int HEIGHT = 256, WIDTH = 256; -const int NUM_VIPC_BUFFERS = 4; - -const int EARTH_CIRCUMFERENCE_METERS = 40075000; -const int EARTH_RADIUS_METERS = 6378137; -const int PIXELS_PER_TILE = 256; -const int MAP_OFFSET = 128; - -const bool TEST_MODE = getenv("MAP_RENDER_TEST_MODE"); -const int LLK_DECIMATION = TEST_MODE ? 1 : 10; - -float get_zoom_level_for_scale(float lat, float meters_per_pixel) { - float meters_per_tile = meters_per_pixel * PIXELS_PER_TILE; - float num_tiles = cos(DEG2RAD(lat)) * EARTH_CIRCUMFERENCE_METERS / meters_per_tile; - return log2(num_tiles) - 1; -} - -QMapLibre::Coordinate get_point_along_line(float lat, float lon, float bearing, float dist) { - float ang_dist = dist / EARTH_RADIUS_METERS; - float lat1 = DEG2RAD(lat), lon1 = DEG2RAD(lon), bearing1 = DEG2RAD(bearing); - float lat2 = asin(sin(lat1)*cos(ang_dist) + cos(lat1)*sin(ang_dist)*cos(bearing1)); - float lon2 = lon1 + atan2(sin(bearing1)*sin(ang_dist)*cos(lat1), cos(ang_dist)-sin(lat1)*sin(lat2)); - return QMapLibre::Coordinate(RAD2DEG(lat2), RAD2DEG(lon2)); -} - - -MapRenderer::MapRenderer(const QMapLibre::Settings &settings, bool online) : m_settings(settings) { - QSurfaceFormat fmt; - fmt.setRenderableType(QSurfaceFormat::OpenGLES); - - m_settings.setMapMode(QMapLibre::Settings::MapMode::Static); - - ctx = std::make_unique(); - ctx->setFormat(fmt); - ctx->create(); - assert(ctx->isValid()); - - surface = std::make_unique(); - surface->setFormat(ctx->format()); - surface->create(); - - ctx->makeCurrent(surface.get()); - assert(QOpenGLContext::currentContext() == ctx.get()); - - gl_functions.reset(ctx->functions()); - gl_functions->initializeOpenGLFunctions(); - - QOpenGLFramebufferObjectFormat fbo_format; - fbo.reset(new QOpenGLFramebufferObject(WIDTH, HEIGHT, fbo_format)); - - std::string style = util::read_file(STYLE_PATH); - m_map.reset(new QMapLibre::Map(nullptr, m_settings, fbo->size(), 1)); - m_map->setCoordinateZoom(QMapLibre::Coordinate(0, 0), DEFAULT_ZOOM); - m_map->setStyleJson(style.c_str()); - m_map->createRenderer(); - ever_loaded = false; - - m_map->resize(fbo->size()); - m_map->setFramebufferObject(fbo->handle(), fbo->size()); - gl_functions->glViewport(0, 0, WIDTH, HEIGHT); - - QObject::connect(m_map.data(), &QMapLibre::Map::mapChanged, [=](QMapLibre::Map::MapChange change) { - // Ignore expected signals - // https://github.com/mapbox/mapbox-gl-native/blob/cf734a2fec960025350d8de0d01ad38aeae155a0/platform/qt/include/qmapboxgl.hpp#L116 - if (ever_loaded) { - if (change != QMapLibre::Map::MapChange::MapChangeRegionWillChange && - change != QMapLibre::Map::MapChange::MapChangeRegionDidChange && - change != QMapLibre::Map::MapChange::MapChangeWillStartRenderingFrame && - change != QMapLibre::Map::MapChange::MapChangeDidFinishRenderingFrameFullyRendered) { - LOGD("New map state: %d", change); - } - } - }); - - QObject::connect(m_map.data(), &QMapLibre::Map::mapLoadingFailed, [=](QMapLibre::Map::MapLoadingFailure err_code, const QString &reason) { - LOGE("Map loading failed with %d: '%s'\n", err_code, reason.toStdString().c_str()); - }); - - QObject::connect(m_map.data(), &QMapLibre::Map::staticRenderFinished, [=](const QString &error) { - rendering = false; - - if (!error.isEmpty()) { - LOGE("Static map rendering failed with error: '%s'\n", error.toStdString().c_str()); - } else if (vipc_server != nullptr) { - double end_render_t = millis_since_boot(); - publish((end_render_t - start_render_t) / 1000.0, true); - last_llk_rendered = (*sm)["liveLocationKalman"].getLogMonoTime(); - } - }); - - if (online) { - vipc_server.reset(new VisionIpcServer("navd")); - vipc_server->create_buffers(VisionStreamType::VISION_STREAM_MAP, NUM_VIPC_BUFFERS, false, WIDTH, HEIGHT); - vipc_server->start_listener(); - - pm.reset(new PubMaster({"navThumbnail", "mapRenderState"})); - sm.reset(new SubMaster({"liveLocationKalman", "navRoute"}, {"liveLocationKalman"})); - - timer = new QTimer(this); - timer->setSingleShot(true); - QObject::connect(timer, SIGNAL(timeout()), this, SLOT(msgUpdate())); - timer->start(0); - } -} - -void MapRenderer::msgUpdate() { - sm->update(1000); - - if (sm->updated("liveLocationKalman")) { - auto location = (*sm)["liveLocationKalman"].getLiveLocationKalman(); - auto pos = location.getPositionGeodetic(); - auto orientation = location.getCalibratedOrientationNED(); - - if ((sm->rcv_frame("liveLocationKalman") % LLK_DECIMATION) == 0) { - float bearing = RAD2DEG(orientation.getValue()[2]); - updatePosition(get_point_along_line(pos.getValue()[0], pos.getValue()[1], bearing, MAP_OFFSET), bearing); - - if (!rendering) { - update(); - } - - if (!rendered()) { - publish(0, false); - } - } - - - } - - if (sm->updated("navRoute")) { - QList route; - auto coords = (*sm)["navRoute"].getNavRoute().getCoordinates(); - for (auto const &c : coords) { - route.push_back(QGeoCoordinate(c.getLatitude(), c.getLongitude())); - } - updateRoute(route); - } - - // schedule next update - timer->start(0); -} - -void MapRenderer::updatePosition(QMapLibre::Coordinate position, float bearing) { - if (m_map.isNull()) { - return; - } - - // Choose a scale that ensures above 13 zoom level up to and above 75deg of lat - float meters_per_pixel = 2; - float zoom = get_zoom_level_for_scale(position.first, meters_per_pixel); - - m_map->setCoordinate(position); - m_map->setBearing(bearing); - m_map->setZoom(zoom); - if (!rendering) { - update(); - } -} - -bool MapRenderer::loaded() { - return m_map->isFullyLoaded(); -} - -void MapRenderer::update() { - rendering = true; - gl_functions->glClear(GL_COLOR_BUFFER_BIT); - start_render_t = millis_since_boot(); - m_map->startStaticRender(); -} - -void MapRenderer::sendThumbnail(const uint64_t ts, const kj::Array &buf) { - MessageBuilder msg; - auto thumbnaild = msg.initEvent().initNavThumbnail(); - thumbnaild.setFrameId(frame_id); - thumbnaild.setTimestampEof(ts); - thumbnaild.setThumbnail(buf); - pm->send("navThumbnail", msg); -} - -void MapRenderer::publish(const double render_time, const bool loaded) { - QImage cap = fbo->toImage().convertToFormat(QImage::Format_RGB888, Qt::AutoColor); - - auto location = (*sm)["liveLocationKalman"].getLiveLocationKalman(); - bool valid = loaded && (location.getStatus() == cereal::LiveLocationKalman::Status::VALID) && location.getPositionGeodetic().getValid(); - ever_loaded = ever_loaded || loaded; - uint64_t ts = nanos_since_boot(); - VisionBuf* buf = vipc_server->get_buffer(VisionStreamType::VISION_STREAM_MAP); - VisionIpcBufExtra extra = { - .frame_id = frame_id, - .timestamp_sof = (*sm)["liveLocationKalman"].getLogMonoTime(), - .timestamp_eof = ts, - .valid = valid, - }; - - assert(cap.sizeInBytes() >= buf->len); - uint8_t* dst = (uint8_t*)buf->addr; - uint8_t* src = cap.bits(); - - // RGB to greyscale - memset(dst, 128, buf->len); - for (int i = 0; i < WIDTH * HEIGHT; i++) { - dst[i] = src[i * 3]; - } - - vipc_server->send(buf, &extra); - - // Send thumbnail - if (TEST_MODE) { - // Full image in thumbnails in test mode - kj::Array buffer_kj = kj::heapArray((const capnp::byte*)cap.bits(), cap.sizeInBytes()); - sendThumbnail(ts, buffer_kj); - } else if (frame_id % 100 == 0) { - // Write jpeg into buffer - QByteArray buffer_bytes; - QBuffer buffer(&buffer_bytes); - buffer.open(QIODevice::WriteOnly); - cap.save(&buffer, "JPG", 50); - - kj::Array buffer_kj = kj::heapArray((const capnp::byte*)buffer_bytes.constData(), buffer_bytes.size()); - sendThumbnail(ts, buffer_kj); - } - - // Send state msg - MessageBuilder msg; - auto evt = msg.initEvent(); - auto state = evt.initMapRenderState(); - evt.setValid(valid); - state.setLocationMonoTime((*sm)["liveLocationKalman"].getLogMonoTime()); - state.setRenderTime(render_time); - state.setFrameId(frame_id); - pm->send("mapRenderState", msg); - - frame_id++; -} - -uint8_t* MapRenderer::getImage() { - QImage cap = fbo->toImage().convertToFormat(QImage::Format_RGB888, Qt::AutoColor); - - uint8_t* src = cap.bits(); - uint8_t* dst = new uint8_t[WIDTH * HEIGHT]; - - // RGB to greyscale - for (int i = 0; i < WIDTH * HEIGHT; i++) { - dst[i] = src[i * 3]; - } - - return dst; -} - -void MapRenderer::updateRoute(QList coordinates) { - if (m_map.isNull()) return; - initLayers(); - - auto route_points = coordinate_list_to_collection(coordinates); - QMapLibre::Feature feature(QMapLibre::Feature::LineStringType, route_points, {}, {}); - QVariantMap navSource; - navSource["type"] = "geojson"; - navSource["data"] = QVariant::fromValue(feature); - m_map->updateSource("navSource", navSource); - m_map->setLayoutProperty("navLayer", "visibility", "visible"); -} - -void MapRenderer::initLayers() { - if (!m_map->layerExists("navLayer")) { - LOGD("Initializing navLayer"); - QVariantMap nav; - nav["type"] = "line"; - nav["source"] = "navSource"; - m_map->addLayer("navLayer", nav, "road-intersection"); - m_map->setPaintProperty("navLayer", "line-color", QColor("grey")); - m_map->setPaintProperty("navLayer", "line-width", 5); - m_map->setLayoutProperty("navLayer", "line-cap", "round"); - } -} - -MapRenderer::~MapRenderer() { -} - -extern "C" { - MapRenderer* map_renderer_init(char *maps_host = nullptr, char *token = nullptr) { - char *argv[] = { - (char*)"navd", - nullptr - }; - int argc = 0; - QApplication *app = new QApplication(argc, argv); - assert(app); - - QMapLibre::Settings settings; - settings.setProviderTemplate(QMapLibre::Settings::ProviderTemplate::MapboxProvider); - settings.setApiBaseUrl(maps_host == nullptr ? MAPS_HOST : maps_host); - settings.setApiKey(token == nullptr ? get_mapbox_token() : token); - - return new MapRenderer(settings, false); - } - - void map_renderer_update_position(MapRenderer *inst, float lat, float lon, float bearing) { - inst->updatePosition({lat, lon}, bearing); - QApplication::processEvents(); - } - - void map_renderer_update_route(MapRenderer *inst, char* polyline) { - inst->updateRoute(polyline_to_coordinate_list(QString::fromUtf8(polyline))); - } - - void map_renderer_update(MapRenderer *inst) { - inst->update(); - } - - void map_renderer_process(MapRenderer *inst) { - QApplication::processEvents(); - } - - bool map_renderer_loaded(MapRenderer *inst) { - return inst->loaded(); - } - - uint8_t * map_renderer_get_image(MapRenderer *inst) { - return inst->getImage(); - } - - void map_renderer_free_image(MapRenderer *inst, uint8_t * buf) { - delete[] buf; - } -} diff --git a/selfdrive/navd/map_renderer.h b/selfdrive/navd/map_renderer.h deleted file mode 100644 index 956c1d54bc..0000000000 --- a/selfdrive/navd/map_renderer.h +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "msgq/visionipc/visionipc_server.h" -#include "cereal/messaging/messaging.h" - - -class MapRenderer : public QObject { - Q_OBJECT - -public: - MapRenderer(const QMapLibre::Settings &, bool online=true); - uint8_t* getImage(); - void update(); - bool loaded(); - ~MapRenderer(); - -private: - std::unique_ptr ctx; - std::unique_ptr surface; - std::unique_ptr gl_functions; - std::unique_ptr fbo; - - std::unique_ptr vipc_server; - std::unique_ptr pm; - std::unique_ptr sm; - void publish(const double render_time, const bool loaded); - void sendThumbnail(const uint64_t ts, const kj::Array &buf); - - QMapLibre::Settings m_settings; - QScopedPointer m_map; - - void initLayers(); - - double start_render_t; - uint32_t frame_id = 0; - uint64_t last_llk_rendered = 0; - bool rendering = false; - bool rendered() { - return last_llk_rendered == (*sm)["liveLocationKalman"].getLogMonoTime(); - } - - QTimer* timer; - bool ever_loaded = false; - -public slots: - void updatePosition(QMapLibre::Coordinate position, float bearing); - void updateRoute(QList coordinates); - void msgUpdate(); -}; diff --git a/selfdrive/navd/map_renderer.py b/selfdrive/navd/map_renderer.py deleted file mode 100755 index e44b883436..0000000000 --- a/selfdrive/navd/map_renderer.py +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/env python3 -# You might need to uninstall the PyQt5 pip package to avoid conflicts - -import os -import time -import numpy as np -import polyline -from cffi import FFI - -from openpilot.common.ffi_wrapper import suffix -from openpilot.common.basedir import BASEDIR - -HEIGHT = WIDTH = SIZE = 256 -METERS_PER_PIXEL = 2 - - -def get_ffi(): - lib = os.path.join(BASEDIR, "selfdrive", "navd", "libmaprender" + suffix()) - - ffi = FFI() - ffi.cdef(""" -void* map_renderer_init(char *maps_host, char *token); -void map_renderer_update_position(void *inst, float lat, float lon, float bearing); -void map_renderer_update_route(void *inst, char *polyline); -void map_renderer_update(void *inst); -void map_renderer_process(void *inst); -bool map_renderer_loaded(void *inst); -uint8_t* map_renderer_get_image(void *inst); -void map_renderer_free_image(void *inst, uint8_t *buf); -""") - return ffi, ffi.dlopen(lib) - - -def wait_ready(lib, renderer, timeout=None): - st = time.time() - while not lib.map_renderer_loaded(renderer): - lib.map_renderer_update(renderer) - - # The main qt app is not execed, so we need to periodically process events for e.g. network requests - lib.map_renderer_process(renderer) - - time.sleep(0.01) - - if timeout is not None and time.time() - st > timeout: - raise TimeoutError("Timeout waiting for map renderer to be ready") - - -def get_image(lib, renderer): - buf = lib.map_renderer_get_image(renderer) - r = list(buf[0:WIDTH * HEIGHT]) - lib.map_renderer_free_image(renderer, buf) - - # Convert to numpy - r = np.asarray(r) - return r.reshape((WIDTH, HEIGHT)) - - -def navRoute_to_polyline(nr): - coords = [(m.latitude, m.longitude) for m in nr.navRoute.coordinates] - return coords_to_polyline(coords) - - -def coords_to_polyline(coords): - # TODO: where does this factor of 10 come from? - return polyline.encode([(lat * 10., lon * 10.) for lat, lon in coords]) - - -def polyline_to_coords(p): - coords = polyline.decode(p) - return [(lat / 10., lon / 10.) for lat, lon in coords] - - - -if __name__ == "__main__": - import matplotlib.pyplot as plt - - ffi, lib = get_ffi() - renderer = lib.map_renderer_init(ffi.NULL, ffi.NULL) - wait_ready(lib, renderer) - - geometry = r"{yxk}@|obn~Eg@@eCFqc@J{RFw@?kA@gA?q|@Riu@NuJBgi@ZqVNcRBaPBkG@iSD{I@_H@cH?gG@mG@gG?aD@{LDgDDkVVyQLiGDgX@q_@@qI@qKhS{R~[}NtYaDbGoIvLwNfP_b@|f@oFnF_JxHel@bf@{JlIuxAlpAkNnLmZrWqFhFoh@jd@kX|TkJxH_RnPy^|[uKtHoZ~Um`DlkCorC``CuShQogCtwB_ThQcr@fk@sVrWgRhVmSb\\oj@jxA{Qvg@u]tbAyHzSos@xjBeKbWszAbgEc~@~jCuTrl@cYfo@mRn\\_m@v}@ij@jp@om@lk@y|A`pAiXbVmWzUod@xj@wNlTw}@|uAwSn\\kRfYqOdS_IdJuK`KmKvJoOhLuLbHaMzGwO~GoOzFiSrEsOhD}PhCqw@vJmnAxSczA`Vyb@bHk[fFgl@pJeoDdl@}}@zIyr@hG}X`BmUdBcM^aRR}Oe@iZc@mR_@{FScHxAn_@vz@zCzH~GjPxAhDlB~DhEdJlIbMhFfG|F~GlHrGjNjItLnGvQ~EhLnBfOn@p`@AzAAvn@CfC?fc@`@lUrArStCfSxEtSzGxM|ElFlBrOzJlEbDnC~BfDtCnHjHlLvMdTnZzHpObOf^pKla@~G|a@dErg@rCbj@zArYlj@ttJ~AfZh@r]LzYg@`TkDbj@gIdv@oE|i@kKzhA{CdNsEfOiGlPsEvMiDpLgBpHyB`MkB|MmArPg@|N?|P^rUvFz~AWpOCdAkB|PuB`KeFfHkCfGy@tAqC~AsBPkDs@uAiAcJwMe@s@eKkPMoXQux@EuuCoH?eI?Kas@}Dy@wAUkMOgDL" # noqa: E501 - lib.map_renderer_update_route(renderer, geometry.encode()) - - POSITIONS = [ - (32.71569271952601, -117.16384270868463, 0), (32.71569271952601, -117.16384270868463, 45), # San Diego - (52.378641991483136, 4.902623379456488, 0), (52.378641991483136, 4.902623379456488, 45), # Amsterdam - ] - plt.figure() - - for i, pos in enumerate(POSITIONS): - t = time.time() - lib.map_renderer_update_position(renderer, *pos) - wait_ready(lib, renderer) - - print(f"{pos} took {time.time() - t:.2f} s") - - plt.subplot(2, 2, i + 1) - plt.imshow(get_image(lib, renderer), cmap='gray') - - plt.show() diff --git a/selfdrive/navd/navd.py b/selfdrive/navd/navd.py deleted file mode 100755 index 8cfc495f27..0000000000 --- a/selfdrive/navd/navd.py +++ /dev/null @@ -1,368 +0,0 @@ -#!/usr/bin/env python3 -import json -import math -import os -import threading - -import requests - -import cereal.messaging as messaging -from cereal import log -from openpilot.common.api import Api -from openpilot.common.params import Params -from openpilot.common.realtime import Ratekeeper -from openpilot.selfdrive.navd.helpers import (Coordinate, coordinate_from_param, - distance_along_geometry, maxspeed_to_ms, - minimum_distance, - parse_banner_instructions) -from openpilot.common.swaglog import cloudlog - -REROUTE_DISTANCE = 25 -MANEUVER_TRANSITION_THRESHOLD = 10 -REROUTE_COUNTER_MIN = 3 - - -class RouteEngine: - def __init__(self, sm, pm): - self.sm = sm - self.pm = pm - - self.params = Params() - - # Get last gps position from params - self.last_position = coordinate_from_param("LastGPSPosition", self.params) - self.last_bearing = None - - self.gps_ok = False - self.localizer_valid = False - - self.nav_destination = None - self.step_idx = None - self.route = None - self.route_geometry = None - - self.recompute_backoff = 0 - self.recompute_countdown = 0 - - self.ui_pid = None - - self.reroute_counter = 0 - - - self.api = None - self.mapbox_token = None - if "MAPBOX_TOKEN" in os.environ: - self.mapbox_token = os.environ["MAPBOX_TOKEN"] - self.mapbox_host = "https://api.mapbox.com" - else: - self.api = Api(self.params.get("DongleId", encoding='utf8')) - self.mapbox_host = "https://maps.comma.ai" - - def update(self): - self.sm.update(0) - - if self.sm.updated["managerState"]: - ui_pid = [p.pid for p in self.sm["managerState"].processes if p.name == "ui" and p.running] - if ui_pid: - if self.ui_pid and self.ui_pid != ui_pid[0]: - cloudlog.warning("UI restarting, sending route") - threading.Timer(5.0, self.send_route).start() - self.ui_pid = ui_pid[0] - - self.update_location() - try: - self.recompute_route() - self.send_instruction() - except Exception: - cloudlog.exception("navd.failed_to_compute") - - def update_location(self): - location = self.sm['liveLocationKalman'] - self.gps_ok = location.gpsOK - - self.localizer_valid = (location.status == log.LiveLocationKalman.Status.valid) and location.positionGeodetic.valid - - if self.localizer_valid: - self.last_bearing = math.degrees(location.calibratedOrientationNED.value[2]) - self.last_position = Coordinate(location.positionGeodetic.value[0], location.positionGeodetic.value[1]) - - def recompute_route(self): - if self.last_position is None: - return - - new_destination = coordinate_from_param("NavDestination", self.params) - if new_destination is None: - self.clear_route() - self.reset_recompute_limits() - return - - should_recompute = self.should_recompute() - if new_destination != self.nav_destination: - cloudlog.warning(f"Got new destination from NavDestination param {new_destination}") - should_recompute = True - - # Don't recompute when GPS drifts in tunnels - if not self.gps_ok and self.step_idx is not None: - return - - if self.recompute_countdown == 0 and should_recompute: - self.recompute_countdown = 2**self.recompute_backoff - self.recompute_backoff = min(6, self.recompute_backoff + 1) - self.calculate_route(new_destination) - self.reroute_counter = 0 - else: - self.recompute_countdown = max(0, self.recompute_countdown - 1) - - def calculate_route(self, destination): - cloudlog.warning(f"Calculating route {self.last_position} -> {destination}") - self.nav_destination = destination - - lang = self.params.get('LanguageSetting', encoding='utf8') - if lang is not None: - lang = lang.replace('main_', '') - - token = self.mapbox_token - if token is None: - token = self.api.get_token() - - params = { - 'access_token': token, - 'annotations': 'maxspeed', - 'geometries': 'geojson', - 'overview': 'full', - 'steps': 'true', - 'banner_instructions': 'true', - 'alternatives': 'false', - 'language': lang, - } - - # TODO: move waypoints into NavDestination param? - waypoints = self.params.get('NavDestinationWaypoints', encoding='utf8') - waypoint_coords = [] - if waypoints is not None and len(waypoints) > 0: - waypoint_coords = json.loads(waypoints) - - coords = [ - (self.last_position.longitude, self.last_position.latitude), - *waypoint_coords, - (destination.longitude, destination.latitude) - ] - params['waypoints'] = f'0;{len(coords)-1}' - if self.last_bearing is not None: - params['bearings'] = f"{(self.last_bearing + 360) % 360:.0f},90" + (';'*(len(coords)-1)) - - coords_str = ';'.join([f'{lon},{lat}' for lon, lat in coords]) - url = self.mapbox_host + '/directions/v5/mapbox/driving-traffic/' + coords_str - try: - resp = requests.get(url, params=params, timeout=10) - if resp.status_code != 200: - cloudlog.event("API request failed", status_code=resp.status_code, text=resp.text, error=True) - resp.raise_for_status() - - r = resp.json() - if len(r['routes']): - self.route = r['routes'][0]['legs'][0]['steps'] - self.route_geometry = [] - - maxspeed_idx = 0 - maxspeeds = r['routes'][0]['legs'][0]['annotation']['maxspeed'] - - # Convert coordinates - for step in self.route: - coords = [] - - for c in step['geometry']['coordinates']: - coord = Coordinate.from_mapbox_tuple(c) - - # Last step does not have maxspeed - if (maxspeed_idx < len(maxspeeds)): - maxspeed = maxspeeds[maxspeed_idx] - if ('unknown' not in maxspeed) and ('none' not in maxspeed): - coord.annotations['maxspeed'] = maxspeed_to_ms(maxspeed) - - coords.append(coord) - maxspeed_idx += 1 - - self.route_geometry.append(coords) - maxspeed_idx -= 1 # Every segment ends with the same coordinate as the start of the next - - self.step_idx = 0 - else: - cloudlog.warning("Got empty route response") - self.clear_route() - - # clear waypoints to avoid a re-route including past waypoints - # TODO: only clear once we're past a waypoint - self.params.remove('NavDestinationWaypoints') - - except requests.exceptions.RequestException: - cloudlog.exception("failed to get route") - self.clear_route() - - self.send_route() - - def send_instruction(self): - msg = messaging.new_message('navInstruction', valid=True) - - if self.step_idx is None: - msg.valid = False - self.pm.send('navInstruction', msg) - return - - step = self.route[self.step_idx] - geometry = self.route_geometry[self.step_idx] - along_geometry = distance_along_geometry(geometry, self.last_position) - distance_to_maneuver_along_geometry = step['distance'] - along_geometry - - # Banner instructions are for the following maneuver step, don't use empty last step - banner_step = step - if not len(banner_step['bannerInstructions']) and self.step_idx == len(self.route) - 1: - banner_step = self.route[max(self.step_idx - 1, 0)] - - # Current instruction - msg.navInstruction.maneuverDistance = distance_to_maneuver_along_geometry - instruction = parse_banner_instructions(banner_step['bannerInstructions'], distance_to_maneuver_along_geometry) - if instruction is not None: - for k,v in instruction.items(): - setattr(msg.navInstruction, k, v) - - # All instructions - maneuvers = [] - for i, step_i in enumerate(self.route): - if i < self.step_idx: - distance_to_maneuver = -sum(self.route[j]['distance'] for j in range(i+1, self.step_idx)) - along_geometry - elif i == self.step_idx: - distance_to_maneuver = distance_to_maneuver_along_geometry - else: - distance_to_maneuver = distance_to_maneuver_along_geometry + sum(self.route[j]['distance'] for j in range(self.step_idx+1, i+1)) - - instruction = parse_banner_instructions(step_i['bannerInstructions'], distance_to_maneuver) - if instruction is None: - continue - maneuver = {'distance': distance_to_maneuver} - if 'maneuverType' in instruction: - maneuver['type'] = instruction['maneuverType'] - if 'maneuverModifier' in instruction: - maneuver['modifier'] = instruction['maneuverModifier'] - maneuvers.append(maneuver) - - msg.navInstruction.allManeuvers = maneuvers - - # Compute total remaining time and distance - remaining = 1.0 - along_geometry / max(step['distance'], 1) - total_distance = step['distance'] * remaining - total_time = step['duration'] * remaining - - if step['duration_typical'] is None: - total_time_typical = total_time - else: - total_time_typical = step['duration_typical'] * remaining - - # Add up totals for future steps - for i in range(self.step_idx + 1, len(self.route)): - total_distance += self.route[i]['distance'] - total_time += self.route[i]['duration'] - if self.route[i]['duration_typical'] is None: - total_time_typical += self.route[i]['duration'] - else: - total_time_typical += self.route[i]['duration_typical'] - - msg.navInstruction.distanceRemaining = total_distance - msg.navInstruction.timeRemaining = total_time - msg.navInstruction.timeRemainingTypical = total_time_typical - - # Speed limit - closest_idx, closest = min(enumerate(geometry), key=lambda p: p[1].distance_to(self.last_position)) - if closest_idx > 0: - # If we are not past the closest point, show previous - if along_geometry < distance_along_geometry(geometry, geometry[closest_idx]): - closest = geometry[closest_idx - 1] - - if ('maxspeed' in closest.annotations) and self.localizer_valid: - msg.navInstruction.speedLimit = closest.annotations['maxspeed'] - - # Speed limit sign type - if 'speedLimitSign' in step: - if step['speedLimitSign'] == 'mutcd': - msg.navInstruction.speedLimitSign = log.NavInstruction.SpeedLimitSign.mutcd - elif step['speedLimitSign'] == 'vienna': - msg.navInstruction.speedLimitSign = log.NavInstruction.SpeedLimitSign.vienna - - self.pm.send('navInstruction', msg) - - # Transition to next route segment - if distance_to_maneuver_along_geometry < -MANEUVER_TRANSITION_THRESHOLD: - if self.step_idx + 1 < len(self.route): - self.step_idx += 1 - self.reset_recompute_limits() - else: - cloudlog.warning("Destination reached") - - # Clear route if driving away from destination - dist = self.nav_destination.distance_to(self.last_position) - if dist > REROUTE_DISTANCE: - self.params.remove("NavDestination") - self.clear_route() - - def send_route(self): - coords = [] - - if self.route is not None: - for path in self.route_geometry: - coords += [c.as_dict() for c in path] - - msg = messaging.new_message('navRoute', valid=True) - msg.navRoute.coordinates = coords - self.pm.send('navRoute', msg) - - def clear_route(self): - self.route = None - self.route_geometry = None - self.step_idx = None - self.nav_destination = None - - def reset_recompute_limits(self): - self.recompute_backoff = 0 - self.recompute_countdown = 0 - - def should_recompute(self): - if self.step_idx is None or self.route is None: - return True - - # Don't recompute in last segment, assume destination is reached - if self.step_idx == len(self.route) - 1: - return False - - # Compute closest distance to all line segments in the current path - min_d = REROUTE_DISTANCE + 1 - path = self.route_geometry[self.step_idx] - for i in range(len(path) - 1): - a = path[i] - b = path[i + 1] - - if a.distance_to(b) < 1.0: - continue - - min_d = min(min_d, minimum_distance(a, b, self.last_position)) - - if min_d > REROUTE_DISTANCE: - self.reroute_counter += 1 - else: - self.reroute_counter = 0 - return self.reroute_counter > REROUTE_COUNTER_MIN - # TODO: Check for going wrong way in segment - - -def main(): - pm = messaging.PubMaster(['navInstruction', 'navRoute']) - sm = messaging.SubMaster(['liveLocationKalman', 'managerState']) - - rk = Ratekeeper(1.0) - route_engine = RouteEngine(sm, pm) - while True: - route_engine.update() - rk.keep_time() - - -if __name__ == "__main__": - main() diff --git a/selfdrive/navd/set_destination.py b/selfdrive/navd/set_destination.py deleted file mode 100755 index 811aa576d1..0000000000 --- a/selfdrive/navd/set_destination.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python3 -import json -import sys - -from openpilot.common.params import Params - -if __name__ == "__main__": - params = Params() - - # set from google maps url - if len(sys.argv) > 1: - coords = sys.argv[1].split("/@")[-1].split("/")[0].split(",") - dest = { - "latitude": float(coords[0]), - "longitude": float(coords[1]) - } - params.put("NavDestination", json.dumps(dest)) - params.remove("NavDestinationWaypoints") - else: - print("Setting to Taco Bell") - dest = { - "latitude": 32.71160109904473, - "longitude": -117.12556569985693, - } - params.put("NavDestination", json.dumps(dest)) - - waypoints = [ - (-117.16020713111648, 32.71997612490662), - ] - params.put("NavDestinationWaypoints", json.dumps(waypoints)) - - print(dest) - print(waypoints) diff --git a/selfdrive/navd/style.json b/selfdrive/navd/style.json deleted file mode 100644 index 06bb750d1f..0000000000 --- a/selfdrive/navd/style.json +++ /dev/null @@ -1 +0,0 @@ -{"version": 8, "name": "Navigation Model", "metadata": {"mapbox:type": "default", "mapbox:origin": "monochrome-dark-v1", "mapbox:sdk-support": {"android": "10.0.0", "ios": "10.0.0", "js": "2.3.0"}, "mapbox:autocomposite": true, "mapbox:groups": {"Transit, transit-labels": {"name": "Transit, transit-labels", "collapsed": true}, "Administrative boundaries, admin": {"name": "Administrative boundaries, admin", "collapsed": true}, "Transit, bridges": {"name": "Transit, bridges", "collapsed": true}, "Transit, surface": {"name": "Transit, surface", "collapsed": true}, "Road network, bridges": {"name": "Road network, bridges", "collapsed": false}, "Land, water, & sky, water": {"name": "Land, water, & sky, water", "collapsed": true}, "Road network, tunnels": {"name": "Road network, tunnels", "collapsed": false}, "Road network, road-labels": {"name": "Road network, road-labels", "collapsed": true}, "Buildings, built": {"name": "Buildings, built", "collapsed": true}, "Natural features, natural-labels": {"name": "Natural features, natural-labels", "collapsed": true}, "Road network, surface": {"name": "Road network, surface", "collapsed": false}, "Land, water, & sky, built": {"name": "Land, water, & sky, built", "collapsed": true}, "Place labels, place-labels": {"name": "Place labels, place-labels", "collapsed": true}, "Point of interest labels, poi-labels": {"name": "Point of interest labels, poi-labels", "collapsed": true}, "Road network, tunnels-case": {"name": "Road network, tunnels-case", "collapsed": true}, "Transit, built": {"name": "Transit, built", "collapsed": true}, "Road network, surface-icons": {"name": "Road network, surface-icons", "collapsed": false}, "Land, water, & sky, land": {"name": "Land, water, & sky, land", "collapsed": true}}}, "center": [-117.19189443261149, 32.756553679559985], "zoom": 12.932776547838778, "bearing": 0, "pitch": 0.5017568344510897, "sources": {"composite": {"url": "mapbox://mapbox.mapbox-streets-v8", "type": "vector", "maxzoom": 13}}, "sprite": "mapbox://sprites/commaai/ckvmksrpd4n0a14pfdo5heqzr/bkx9h9tjdf3xedbnjvfo5xnbv", "glyphs": "mapbox://fonts/mapbox/{fontstack}/{range}.pbf", "layers": [{"id": "land", "type": "background", "layout": {"visibility": "none"}, "paint": {"background-color": "rgb(252, 252, 252)"}, "metadata": {"mapbox:featureComponent": "land-and-water", "mapbox:group": "Land, water, & sky, land"}}, {"minzoom": 5, "layout": {"visibility": "none"}, "metadata": {"mapbox:featureComponent": "land-and-water", "mapbox:group": "Land, water, & sky, land"}, "filter": ["==", ["get", "class"], "national_park"], "type": "fill", "source": "composite", "id": "national-park", "paint": {"fill-color": "rgb(240, 240, 240)", "fill-opacity": ["interpolate", ["linear"], ["zoom"], 5, 0, 6, 0.5, 10, 0.5]}, "source-layer": "landuse_overlay"}, {"minzoom": 5, "layout": {"visibility": "none"}, "metadata": {"mapbox:featureComponent": "land-and-water", "mapbox:group": "Land, water, & sky, land"}, "filter": ["match", ["get", "class"], ["park", "airport", "glacier", "pitch", "sand", "facility"], true, false], "type": "fill", "source": "composite", "id": "landuse", "paint": {"fill-color": "rgb(240, 240, 240)", "fill-opacity": ["interpolate", ["linear"], ["zoom"], 5, 0, 6, ["match", ["get", "class"], "glacier", 0.5, 1]]}, "source-layer": "landuse"}, {"id": "waterway-shadow", "type": "line", "source": "composite", "source-layer": "waterway", "minzoom": 8, "layout": {"line-cap": ["step", ["zoom"], "butt", 11, "round"], "line-join": "round", "visibility": "none"}, "paint": {"line-color": "rgb(204, 204, 204)", "line-width": ["interpolate", ["exponential", 1.3], ["zoom"], 9, ["match", ["get", "class"], ["canal", "river"], 0.1, 0], 20, ["match", ["get", "class"], ["canal", "river"], 8, 3]], "line-translate": ["interpolate", ["exponential", 1.2], ["zoom"], 7, ["literal", [0, 0]], 16, ["literal", [-1, -1]]], "line-translate-anchor": "viewport", "line-opacity": ["interpolate", ["linear"], ["zoom"], 8, 0, 8.5, 1]}, "metadata": {"mapbox:featureComponent": "land-and-water", "mapbox:group": "Land, water, & sky, water"}}, {"id": "water-shadow", "type": "fill", "source": "composite", "source-layer": "water", "layout": {"visibility": "none"}, "paint": {"fill-color": "rgb(204, 204, 204)", "fill-translate": ["interpolate", ["exponential", 1.2], ["zoom"], 7, ["literal", [0, 0]], 16, ["literal", [-1, -1]]], "fill-translate-anchor": "viewport"}, "metadata": {"mapbox:featureComponent": "land-and-water", "mapbox:group": "Land, water, & sky, water"}}, {"id": "waterway", "type": "line", "source": "composite", "source-layer": "waterway", "minzoom": 8, "layout": {"line-cap": ["step", ["zoom"], "butt", 11, "round"], "line-join": "round", "visibility": "none"}, "paint": {"line-color": "rgb(224, 224, 224)", "line-width": ["interpolate", ["exponential", 1.3], ["zoom"], 9, ["match", ["get", "class"], ["canal", "river"], 0.1, 0], 20, ["match", ["get", "class"], ["canal", "river"], 8, 3]], "line-opacity": ["interpolate", ["linear"], ["zoom"], 8, 0, 8.5, 1]}, "metadata": {"mapbox:featureComponent": "land-and-water", "mapbox:group": "Land, water, & sky, water"}}, {"id": "water", "type": "fill", "source": "composite", "source-layer": "water", "layout": {"visibility": "none"}, "paint": {"fill-color": "rgb(224, 224, 224)"}, "metadata": {"mapbox:featureComponent": "land-and-water", "mapbox:group": "Land, water, & sky, water"}}, {"minzoom": 13, "layout": {"visibility": "none"}, "metadata": {"mapbox:featureComponent": "land-and-water", "mapbox:group": "Land, water, & sky, built"}, "filter": ["all", ["==", ["geometry-type"], "Polygon"], ["==", ["get", "class"], "land"]], "type": "fill", "source": "composite", "id": "land-structure-polygon", "paint": {"fill-color": "rgb(252, 252, 252)"}, "source-layer": "structure"}, {"minzoom": 13, "layout": {"line-cap": "round", "visibility": "none"}, "metadata": {"mapbox:featureComponent": "land-and-water", "mapbox:group": "Land, water, & sky, built"}, "filter": ["all", ["==", ["geometry-type"], "LineString"], ["==", ["get", "class"], "land"]], "type": "line", "source": "composite", "id": "land-structure-line", "paint": {"line-width": ["interpolate", ["exponential", 1.99], ["zoom"], 14, 0.75, 20, 40], "line-color": "rgb(252, 252, 252)"}, "source-layer": "structure"}, {"minzoom": 11, "layout": {"visibility": "none"}, "metadata": {"mapbox:featureComponent": "transit", "mapbox:group": "Transit, built"}, "filter": ["all", ["==", ["geometry-type"], "Polygon"], ["match", ["get", "type"], ["runway", "taxiway", "helipad"], true, false]], "type": "fill", "source": "composite", "id": "aeroway-polygon", "paint": {"fill-color": "rgb(255, 255, 255)", "fill-opacity": ["interpolate", ["linear"], ["zoom"], 11, 0, 11.5, 1]}, "source-layer": "aeroway"}, {"minzoom": 9, "layout": {"visibility": "none"}, "metadata": {"mapbox:featureComponent": "transit", "mapbox:group": "Transit, built"}, "filter": ["==", ["geometry-type"], "LineString"], "type": "line", "source": "composite", "id": "aeroway-line", "paint": {"line-color": "rgb(255, 255, 255)", "line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 9, ["match", ["get", "type"], "runway", 1, 0.5], 18, ["match", ["get", "type"], "runway", 80, 20]]}, "source-layer": "aeroway"}, {"minzoom": 13, "layout": {"visibility": "none"}, "metadata": {"mapbox:featureComponent": "buildings", "mapbox:group": "Buildings, built"}, "filter": ["all", ["!=", ["get", "type"], "building:part"], ["==", ["get", "underground"], "false"]], "type": "line", "source": "composite", "id": "building-outline", "paint": {"line-color": "rgb(227, 227, 227)", "line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 15, 0.75, 20, 3], "line-opacity": ["interpolate", ["linear"], ["zoom"], 15, 0, 16, 1]}, "source-layer": "building"}, {"minzoom": 13, "layout": {"visibility": "none"}, "metadata": {"mapbox:featureComponent": "buildings", "mapbox:group": "Buildings, built"}, "filter": ["all", ["!=", ["get", "type"], "building:part"], ["==", ["get", "underground"], "false"]], "type": "fill", "source": "composite", "id": "building", "paint": {"fill-color": ["interpolate", ["linear"], ["zoom"], 15, "rgb(242, 242, 242)", 16, "rgb(242, 242, 242)"], "fill-opacity": ["interpolate", ["linear"], ["zoom"], 15, 0, 16, 1], "fill-outline-color": "rgb(227, 227, 227)"}, "source-layer": "building"}, {"minzoom": 13, "layout": {}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, tunnels-case"}, "filter": ["all", ["==", ["get", "structure"], "tunnel"], ["step", ["zoom"], ["match", ["get", "class"], ["street", "street_limited", "primary_link", "track"], true, false], 1, ["match", ["get", "class"], ["street", "street_limited", "track", "primary_link", "secondary_link", "tertiary_link", "service"], true, false]], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "tunnel-street-minor-low", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, ["match", ["get", "class"], ["street", "street_limited", "primary_link"], 2, "track", 1, 0.5], 18, ["match", ["get", "class"], ["street", "street_limited", "primary_link"], 18, 12]], "line-color": "rgb(235, 235, 235)", "line-opacity": ["step", ["zoom"], 1, 14, 0]}, "source-layer": "road"}, {"minzoom": 13, "layout": {}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, tunnels-case"}, "filter": ["all", ["==", ["get", "structure"], "tunnel"], ["step", ["zoom"], ["match", ["get", "class"], ["street", "street_limited", "primary_link", "track"], true, false], 1, ["match", ["get", "class"], ["street", "street_limited", "track", "primary_link", "secondary_link", "tertiary_link", "service"], true, false]], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "tunnel-street-minor-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.75, 20, 2], "line-color": "rgb(255, 255, 255)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, ["match", ["get", "class"], ["street", "street_limited", "primary_link"], 2, "track", 1, 0.5], 18, ["match", ["get", "class"], ["street", "street_limited", "primary_link"], 18, 12]], "line-opacity": ["step", ["zoom"], 0, 14, 1], "line-dasharray": [3, 3]}, "source-layer": "road"}, {"minzoom": 13, "layout": {}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, tunnels-case"}, "filter": ["all", ["==", ["get", "structure"], "tunnel"], ["match", ["get", "class"], ["primary", "secondary", "tertiary"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "tunnel-primary-secondary-tertiary-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 10, ["match", ["get", "class"], "primary", 1, 0.75], 18, 2], "line-color": "rgb(255, 255, 255)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, ["match", ["get", "class"], "primary", 0.75, 0.1], 18, ["match", ["get", "class"], "primary", 32, 26]], "line-dasharray": [3, 3]}, "source-layer": "road"}, {"minzoom": 13, "layout": {}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, tunnels-case"}, "filter": ["all", ["==", ["get", "structure"], "tunnel"], ["match", ["get", "class"], ["motorway_link", "trunk_link"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "tunnel-major-link-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.75, 20, 2], "line-color": "rgb(255, 255, 255)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, 2, 18, 18], "line-dasharray": [3, 3]}, "source-layer": "road"}, {"minzoom": 13, "layout": {}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, tunnels-case"}, "filter": ["all", ["==", ["get", "structure"], "tunnel"], ["match", ["get", "class"], ["motorway", "trunk"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "tunnel-motorway-trunk-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 10, 1, 18, 2], "line-color": "rgb(255, 255, 255)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, 0.75, 18, 32], "line-dasharray": [3, 3]}, "source-layer": "road"}, {"minzoom": 13, "layout": {}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, tunnels-case"}, "filter": ["all", ["==", ["get", "structure"], "tunnel"], ["==", ["get", "class"], "construction"], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "tunnel-construction", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 14, 2, 18, 18], "line-color": "rgb(235, 235, 235)", "line-dasharray": ["step", ["zoom"], ["literal", [0.4, 0.8]], 15, ["literal", [0.3, 0.6]], 16, ["literal", [0.2, 0.3]], 17, ["literal", [0.2, 0.25]], 18, ["literal", [0.15, 0.15]]]}, "source-layer": "road"}, {"minzoom": 13, "layout": {}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, tunnels"}, "filter": ["all", ["==", ["get", "structure"], "tunnel"], ["match", ["get", "class"], ["motorway_link", "trunk_link"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "tunnel-major-link", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, 2, 18, 18], "line-color": "rgb(235, 235, 235)"}, "source-layer": "road"}, {"minzoom": 13, "layout": {}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, tunnels"}, "filter": ["all", ["==", ["get", "structure"], "tunnel"], ["step", ["zoom"], ["match", ["get", "class"], ["street", "street_limited", "primary_link", "track"], true, false], 1, ["match", ["get", "class"], ["street", "street_limited", "track", "primary_link", "secondary_link", "tertiary_link", "service"], true, false]], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "tunnel-street-minor", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, ["match", ["get", "class"], ["street", "street_limited", "primary_link"], 2, "track", 1, 0.5], 18, ["match", ["get", "class"], ["street", "street_limited", "primary_link"], 18, 12]], "line-color": "rgb(235, 235, 235)", "line-opacity": ["step", ["zoom"], 0, 14, 1]}, "source-layer": "road"}, {"minzoom": 13, "layout": {}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, tunnels"}, "filter": ["all", ["==", ["get", "structure"], "tunnel"], ["match", ["get", "class"], ["primary", "secondary", "tertiary"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "tunnel-primary-secondary-tertiary", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, ["match", ["get", "class"], "primary", 0.75, 0.1], 18, ["match", ["get", "class"], "primary", 32, 26]], "line-color": "rgb(235, 235, 235)"}, "source-layer": "road"}, {"minzoom": 13, "layout": {}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, tunnels"}, "filter": ["all", ["==", ["get", "structure"], "tunnel"], ["match", ["get", "class"], ["motorway", "trunk"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "tunnel-motorway-trunk", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, 0.75, 18, 32], "line-color": "rgb(235, 235, 235)"}, "source-layer": "road"}, {"minzoom": 13, "layout": {"icon-image": "turning-circle-outline", "icon-size": ["interpolate", ["exponential", 1.5], ["zoom"], 14, 0.122, 18, 0.969, 20, 1], "icon-allow-overlap": true, "icon-ignore-placement": true, "icon-padding": 0, "icon-rotation-alignment": "map", "visibility": "none"}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["==", ["geometry-type"], "Point"], ["match", ["get", "class"], ["turning_circle", "turning_loop"], true, false]], "type": "symbol", "source": "composite", "id": "turning-feature-outline", "paint": {}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["step", ["zoom"], ["==", ["get", "class"], "track"], 1, ["match", ["get", "class"], ["track", "secondary_link", "tertiary_link", "service"], true, false]], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "road-minor-low", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 14, ["match", ["get", "class"], "track", 1, 0.5], 18, 12], "line-color": "rgb(255, 255, 255)", "line-opacity": ["step", ["zoom"], 1, 14, 0]}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["step", ["zoom"], ["==", ["get", "class"], "track"], 1, ["match", ["get", "class"], ["track", "secondary_link", "tertiary_link", "service"], true, false]], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "road-minor-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.75, 20, 2], "line-color": "rgb(242, 242, 242)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 14, ["match", ["get", "class"], "track", 1, 0.5], 18, 12], "line-opacity": ["step", ["zoom"], 0, 14, 1]}, "source-layer": "road"}, {"minzoom": 11, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["match", ["get", "class"], ["street", "street_limited", "primary_link"], true, false], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "road-street-low", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, 2, 18, 18], "line-color": "rgb(255, 255, 255)", "line-opacity": ["step", ["zoom"], 1, 14, 0]}, "source-layer": "road"}, {"minzoom": 11, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["match", ["get", "class"], ["street", "street_limited", "primary_link"], true, false], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "road-street-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.75, 20, 2], "line-color": "rgb(242, 242, 242)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, 2, 18, 18], "line-opacity": ["step", ["zoom"], 0, 14, 1]}, "source-layer": "road"}, {"minzoom": 8, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["match", ["get", "class"], ["secondary", "tertiary"], true, false], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "road-secondary-tertiary-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 10, 0.75, 18, 2], "line-color": "rgb(242, 242, 242)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, 0.1, 18, 26], "line-opacity": ["step", ["zoom"], 0, 10, 1]}, "source-layer": "road"}, {"minzoom": 7, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["==", ["get", "class"], "primary"], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "road-primary-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 10, 1, 18, 2], "line-color": "rgb(242, 242, 242)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, 0.75, 18, 32], "line-opacity": ["step", ["zoom"], 0, 10, 1]}, "source-layer": "road"}, {"minzoom": 10, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["match", ["get", "class"], ["motorway_link", "trunk_link"], true, false], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "road-major-link-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.75, 20, 2], "line-color": "rgb(242, 242, 242)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, 2, 18, 18], "line-opacity": ["step", ["zoom"], 0, 11, 1]}, "source-layer": "road"}, {"minzoom": 5, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["match", ["get", "class"], ["motorway", "trunk"], true, false], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "road-motorway-trunk-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 10, 1, 18, 2], "line-color": "rgb(242, 242, 242)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, 0.75, 18, 32], "line-opacity": ["step", ["zoom"], ["match", ["get", "class"], "motorway", 1, 0], 6, 1]}, "source-layer": "road"}, {"minzoom": 13, "layout": {}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["==", ["get", "class"], "construction"], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "road-construction", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 14, 2, 18, 18], "line-color": "rgb(255, 255, 255)", "line-dasharray": ["step", ["zoom"], ["literal", [0.4, 0.8]], 15, ["literal", [0.3, 0.6]], 16, ["literal", [0.2, 0.3]], 17, ["literal", [0.2, 0.25]], 18, ["literal", [0.15, 0.15]]]}, "source-layer": "road"}, {"minzoom": 10, "layout": {"line-cap": ["step", ["zoom"], "butt", 13, "round"], "line-join": ["step", ["zoom"], "miter", 13, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["match", ["get", "class"], ["motorway_link", "trunk_link"], true, false], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "road-major-link", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, 2, 18, 18], "line-color": "rgb(255, 255, 255)"}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["step", ["zoom"], ["==", ["get", "class"], "track"], 1, ["match", ["get", "class"], ["track", "secondary_link", "tertiary_link", "service"], true, false]], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "road-minor", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 14, ["match", ["get", "class"], "track", 1, 0.5], 18, 12], "line-color": "rgb(255, 255, 255)", "line-opacity": ["step", ["zoom"], 0, 14, 1]}, "source-layer": "road"}, {"minzoom": 11, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["match", ["get", "class"], ["street", "street_limited", "primary_link"], true, false], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "road-street", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, 2, 18, 18], "line-color": "rgb(255, 255, 255)", "line-opacity": ["step", ["zoom"], 0, 14, 1]}, "source-layer": "road"}, {"minzoom": 8, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["match", ["get", "class"], ["secondary", "tertiary"], true, false], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "road-secondary-tertiary", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, 0.1, 18, 26], "line-color": "rgb(255, 255, 255)"}, "source-layer": "road"}, {"minzoom": 6, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}, "filter": ["all", ["==", ["get", "class"], "primary"], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "road-primary", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, 0.75, 18, 32], "line-color": "rgb(255, 255, 255)"}, "source-layer": "road"}, {"id": "road-motorway-trunk", "type": "line", "source": "composite", "source-layer": "road", "filter": ["all", ["match", ["get", "class"], ["motorway", "trunk"], true, false], ["match", ["get", "structure"], ["none", "ford"], true, false], ["==", ["geometry-type"], "LineString"]], "layout": {"line-cap": ["step", ["zoom"], "butt", 13, "round"], "line-join": ["step", ["zoom"], "miter", 13, "round"]}, "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, 0.75, 18, 32], "line-color": "rgb(255, 255, 255)"}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface"}}, {"minzoom": 13, "layout": {"line-join": "round", "visibility": "none"}, "metadata": {"mapbox:featureComponent": "transit", "mapbox:group": "Transit, surface"}, "filter": ["all", ["match", ["get", "class"], ["major_rail", "minor_rail"], true, false], ["match", ["get", "structure"], ["none", "ford"], true, false]], "type": "line", "source": "composite", "id": "road-rail", "paint": {"line-color": ["interpolate", ["linear"], ["zoom"], 13, "rgb(242, 242, 242)", 17, "rgb(227, 227, 227)"], "line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 14, 0.5, 20, 1]}, "source-layer": "road"}, {"minzoom": 13, "layout": {"icon-image": "turning-circle", "icon-size": ["interpolate", ["exponential", 1.5], ["zoom"], 14, 0.095, 18, 1], "icon-allow-overlap": true, "icon-ignore-placement": true, "icon-padding": 0, "icon-rotation-alignment": "map", "visibility": "none"}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, surface-icons"}, "filter": ["all", ["==", ["geometry-type"], "Point"], ["match", ["get", "class"], ["turning_circle", "turning_loop"], true, false]], "type": "symbol", "source": "composite", "id": "turning-feature", "paint": {}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], ["step", ["zoom"], ["match", ["get", "class"], ["street", "street_limited", "primary_link", "track"], true, false], 1, ["match", ["get", "class"], ["street", "street_limited", "track", "primary_link", "secondary_link", "tertiary_link", "service"], true, false]], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "bridge-street-minor-low", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, ["match", ["get", "class"], ["street", "street_limited", "primary_link"], 2, "track", 1, 0.5], 18, ["match", ["get", "class"], ["street", "street_limited", "primary_link"], 18, 12]], "line-color": "rgb(255, 255, 255)", "line-opacity": ["step", ["zoom"], 1, 14, 0]}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-join": "round"}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], ["step", ["zoom"], ["match", ["get", "class"], ["street", "street_limited", "primary_link", "track"], true, false], 1, ["match", ["get", "class"], ["street", "street_limited", "track", "primary_link", "secondary_link", "tertiary_link", "service"], true, false]], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "bridge-street-minor-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.75, 20, 2], "line-color": "rgb(242, 242, 242)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, ["match", ["get", "class"], ["street", "street_limited", "primary_link"], 2, "track", 1, 0.5], 18, ["match", ["get", "class"], ["street", "street_limited", "primary_link"], 18, 12]], "line-opacity": ["step", ["zoom"], 0, 14, 1]}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-join": "round"}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], ["match", ["get", "class"], ["primary", "secondary", "tertiary"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "bridge-primary-secondary-tertiary-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 10, ["match", ["get", "class"], "primary", 1, 0.75], 18, 2], "line-color": "rgb(242, 242, 242)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, ["match", ["get", "class"], "primary", 0.75, 0.1], 18, ["match", ["get", "class"], "primary", 32, 26]], "line-opacity": ["step", ["zoom"], 0, 10, 1]}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-join": "round"}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], ["match", ["get", "class"], ["motorway_link", "trunk_link"], true, false], ["<=", ["get", "layer"], 1], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "bridge-major-link-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.75, 20, 2], "line-color": "rgb(242, 242, 242)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, 2, 18, 18]}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-join": "round"}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], ["match", ["get", "class"], ["motorway", "trunk"], true, false], ["<=", ["get", "layer"], 1], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "bridge-motorway-trunk-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 10, 1, 18, 2], "line-color": "rgb(242, 242, 242)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, 0.75, 18, 32]}, "source-layer": "road"}, {"minzoom": 13, "layout": {}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], ["==", ["get", "class"], "construction"], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "bridge-construction", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 14, 2, 18, 18], "line-color": "rgb(255, 255, 255)", "line-dasharray": ["step", ["zoom"], ["literal", [0.4, 0.8]], 15, ["literal", [0.3, 0.6]], 16, ["literal", [0.2, 0.3]], 17, ["literal", [0.2, 0.25]], 18, ["literal", [0.15, 0.15]]]}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-cap": "round", "line-join": "round"}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], ["match", ["get", "class"], ["motorway_link", "trunk_link"], true, false], ["<=", ["get", "layer"], 1], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "bridge-major-link", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, 2, 18, 18], "line-color": "rgb(255, 255, 255)"}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], ["step", ["zoom"], ["match", ["get", "class"], ["street", "street_limited", "primary_link", "track"], true, false], 1, ["match", ["get", "class"], ["street", "street_limited", "track", "primary_link", "secondary_link", "tertiary_link", "service"], true, false]], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "bridge-street-minor", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, ["match", ["get", "class"], ["street", "street_limited", "primary_link"], 2, "track", 1, 0.5], 18, ["match", ["get", "class"], ["street", "street_limited", "primary_link"], 18, 12]], "line-color": "rgb(255, 255, 255)", "line-opacity": ["step", ["zoom"], 0, 14, 1]}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], ["match", ["get", "class"], ["primary", "secondary", "tertiary"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "bridge-primary-secondary-tertiary", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, ["match", ["get", "class"], "primary", 0.75, 0.1], 18, ["match", ["get", "class"], "primary", 32, 26]], "line-color": "rgb(255, 255, 255)"}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-cap": "round", "line-join": "round"}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], ["match", ["get", "class"], ["motorway", "trunk"], true, false], ["<=", ["get", "layer"], 1], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "bridge-motorway-trunk", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, 0.75, 18, 32], "line-color": "rgb(255, 255, 255)"}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-join": "round"}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], [">=", ["get", "layer"], 2], ["match", ["get", "class"], ["motorway_link", "trunk_link"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "bridge-major-link-2-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.75, 20, 2], "line-color": "rgb(242, 242, 242)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, 2, 18, 18]}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-join": "round"}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], [">=", ["get", "layer"], 2], ["match", ["get", "class"], ["motorway", "trunk"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "bridge-motorway-trunk-2-case", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 10, 1, 18, 2], "line-color": "rgb(242, 242, 242)", "line-gap-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, 0.75, 18, 32]}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-cap": "round", "line-join": "round"}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], [">=", ["get", "layer"], 2], ["match", ["get", "class"], ["motorway_link", "trunk_link"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "bridge-major-link-2", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 12, 0.5, 14, 2, 18, 18], "line-color": "rgb(255, 255, 255)"}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-cap": ["step", ["zoom"], "butt", 14, "round"], "line-join": ["step", ["zoom"], "miter", 14, "round"]}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], [">=", ["get", "layer"], 2], ["match", ["get", "class"], ["motorway", "trunk"], true, false], ["==", ["geometry-type"], "LineString"]], "type": "line", "source": "composite", "id": "bridge-motorway-trunk-2", "paint": {"line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 5, 0.75, 18, 32], "line-color": "rgb(255, 255, 255)"}, "source-layer": "road"}, {"minzoom": 13, "layout": {"line-join": "round", "visibility": "none"}, "metadata": {"mapbox:featureComponent": "transit", "mapbox:group": "Transit, bridges"}, "filter": ["all", ["==", ["get", "structure"], "bridge"], ["match", ["get", "class"], ["major_rail", "minor_rail"], true, false]], "type": "line", "source": "composite", "id": "bridge-rail", "paint": {"line-color": "rgb(227, 227, 227)", "line-width": ["interpolate", ["exponential", 1.5], ["zoom"], 14, 0.5, 20, 1]}, "source-layer": "road"}, {"minzoom": 7, "layout": {"line-join": "bevel", "visibility": "none"}, "metadata": {"mapbox:featureComponent": "admin-boundaries", "mapbox:group": "Administrative boundaries, admin"}, "filter": ["all", ["==", ["get", "admin_level"], 1], ["==", ["get", "maritime"], "false"], ["match", ["get", "worldview"], ["all", "US"], true, false]], "type": "line", "source": "composite", "id": "admin-1-boundary-bg", "paint": {"line-color": ["interpolate", ["linear"], ["zoom"], 8, "rgb(227, 227, 227)", 16, "rgb(227, 227, 227)"], "line-width": ["interpolate", ["linear"], ["zoom"], 7, 3.75, 12, 5.5], "line-opacity": ["interpolate", ["linear"], ["zoom"], 7, 0, 8, 0.75], "line-dasharray": [1, 0], "line-blur": ["interpolate", ["linear"], ["zoom"], 3, 0, 8, 3]}, "source-layer": "admin"}, {"minzoom": 1, "layout": {"visibility": "none"}, "metadata": {"mapbox:featureComponent": "admin-boundaries", "mapbox:group": "Administrative boundaries, admin"}, "filter": ["all", ["==", ["get", "admin_level"], 0], ["==", ["get", "maritime"], "false"], ["match", ["get", "worldview"], ["all", "US"], true, false]], "type": "line", "source": "composite", "id": "admin-0-boundary-bg", "paint": {"line-width": ["interpolate", ["linear"], ["zoom"], 3, 3.5, 10, 8], "line-color": "rgb(227, 227, 227)", "line-opacity": ["interpolate", ["linear"], ["zoom"], 3, 0, 4, 0.5], "line-blur": ["interpolate", ["linear"], ["zoom"], 3, 0, 10, 2]}, "source-layer": "admin"}, {"minzoom": 2, "layout": {"line-join": "round", "line-cap": "round", "visibility": "none"}, "metadata": {"mapbox:featureComponent": "admin-boundaries", "mapbox:group": "Administrative boundaries, admin"}, "filter": ["all", ["==", ["get", "admin_level"], 1], ["==", ["get", "maritime"], "false"], ["match", ["get", "worldview"], ["all", "US"], true, false]], "type": "line", "source": "composite", "id": "admin-1-boundary", "paint": {"line-dasharray": ["step", ["zoom"], ["literal", [2, 0]], 7, ["literal", [2, 2, 6, 2]]], "line-width": ["interpolate", ["linear"], ["zoom"], 7, 0.75, 12, 1.5], "line-opacity": ["interpolate", ["linear"], ["zoom"], 2, 0, 3, 1], "line-color": ["interpolate", ["linear"], ["zoom"], 3, "rgb(224, 224, 224)", 7, "rgb(184, 184, 184)"]}, "source-layer": "admin"}, {"minzoom": 1, "layout": {"line-join": "round", "line-cap": "round", "visibility": "none"}, "metadata": {"mapbox:featureComponent": "admin-boundaries", "mapbox:group": "Administrative boundaries, admin"}, "filter": ["all", ["==", ["get", "admin_level"], 0], ["==", ["get", "disputed"], "false"], ["==", ["get", "maritime"], "false"], ["match", ["get", "worldview"], ["all", "US"], true, false]], "type": "line", "source": "composite", "id": "admin-0-boundary", "paint": {"line-color": "rgb(184, 184, 184)", "line-width": ["interpolate", ["linear"], ["zoom"], 3, 0.5, 10, 2], "line-dasharray": [10, 0]}, "source-layer": "admin"}, {"minzoom": 1, "layout": {"line-join": "round", "visibility": "none"}, "metadata": {"mapbox:featureComponent": "admin-boundaries", "mapbox:group": "Administrative boundaries, admin"}, "filter": ["all", ["==", ["get", "disputed"], "true"], ["==", ["get", "admin_level"], 0], ["==", ["get", "maritime"], "false"], ["match", ["get", "worldview"], ["all", "US"], true, false]], "type": "line", "source": "composite", "id": "admin-0-boundary-disputed", "paint": {"line-color": "rgb(184, 184, 184)", "line-width": ["interpolate", ["linear"], ["zoom"], 3, 0.5, 10, 2], "line-dasharray": ["step", ["zoom"], ["literal", [3.25, 3.25]], 6, ["literal", [2.5, 2.5]], 7, ["literal", [2, 2.25]], 8, ["literal", [1.75, 2]]]}, "source-layer": "admin"}, {"minzoom": 10, "layout": {"text-size": ["interpolate", ["linear"], ["zoom"], 10, ["match", ["get", "class"], ["motorway", "trunk", "primary", "secondary", "tertiary"], 10, ["motorway_link", "trunk_link", "primary_link", "secondary_link", "tertiary_link", "street", "street_limited"], 9, 6.5], 18, ["match", ["get", "class"], ["motorway", "trunk", "primary", "secondary", "tertiary"], 16, ["motorway_link", "trunk_link", "primary_link", "secondary_link", "tertiary_link", "street", "street_limited"], 14, 13]], "text-max-angle": 30, "text-font": ["DIN Pro Regular", "Arial Unicode MS Regular"], "symbol-placement": "line", "text-padding": 1, "visibility": "none", "text-rotation-alignment": "map", "text-pitch-alignment": "viewport", "text-field": ["coalesce", ["get", "name_en"], ["get", "name"]], "text-letter-spacing": 0.01}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, road-labels"}, "filter": ["step", ["zoom"], ["match", ["get", "class"], ["motorway", "trunk", "primary", "secondary", "tertiary"], true, false], 1, ["match", ["get", "class"], ["motorway", "trunk", "primary", "secondary", "tertiary", "street", "street_limited"], true, false], 2, ["match", ["get", "class"], ["path", "pedestrian", "golf", "ferry", "aerialway"], false, true]], "type": "symbol", "source": "composite", "id": "road-label", "paint": {"text-color": "rgb(128, 128, 128)", "text-halo-color": "rgb(255, 255, 255)", "text-halo-width": 1, "text-halo-blur": 1}, "source-layer": "road"}, {"minzoom": 13, "layout": {"text-field": ["coalesce", ["get", "name_en"], ["get", "name"]], "icon-image": "intersection", "icon-text-fit": "both", "icon-text-fit-padding": [1, 2, 1, 2], "text-size": ["interpolate", ["exponential", 1.2], ["zoom"], 15, 9, 18, 12], "text-font": ["DIN Pro Bold", "Arial Unicode MS Bold"], "visibility": "none"}, "metadata": {"mapbox:featureComponent": "road-network", "mapbox:group": "Road network, road-labels"}, "filter": ["all", ["==", ["get", "class"], "intersection"], ["has", "name"]], "type": "symbol", "source": "composite", "id": "road-intersection", "paint": {"text-color": "rgb(153, 153, 153)"}, "source-layer": "road"}, {"minzoom": 13, "layout": {"text-font": ["DIN Pro Italic", "Arial Unicode MS Regular"], "text-max-angle": 30, "symbol-spacing": ["interpolate", ["linear", 1], ["zoom"], 15, 250, 17, 400], "text-size": ["interpolate", ["linear"], ["zoom"], 13, 12, 18, 16], "symbol-placement": "line", "text-pitch-alignment": "viewport", "text-field": ["coalesce", ["get", "name_en"], ["get", "name"]], "visibility": "none"}, "metadata": {"mapbox:featureComponent": "natural-features", "mapbox:group": "Natural features, natural-labels"}, "filter": ["all", ["match", ["get", "class"], ["canal", "river", "stream"], ["match", ["get", "worldview"], ["all", "US"], true, false], ["disputed_canal", "disputed_river", "disputed_stream"], ["all", ["==", ["get", "disputed"], "true"], ["match", ["get", "worldview"], ["all", "US"], true, false]], false], ["==", ["geometry-type"], "LineString"]], "type": "symbol", "source": "composite", "id": "waterway-label", "paint": {"text-color": "rgb(150, 150, 150)"}, "source-layer": "natural_label"}, {"minzoom": 4, "layout": {"text-size": ["step", ["zoom"], ["step", ["get", "sizerank"], 18, 5, 12], 17, ["step", ["get", "sizerank"], 18, 13, 12]], "text-max-angle": 30, "text-field": ["coalesce", ["get", "name_en"], ["get", "name"]], "text-font": ["DIN Pro Medium", "Arial Unicode MS Regular"], "symbol-placement": "line-center", "text-pitch-alignment": "viewport", "visibility": "none"}, "metadata": {"mapbox:featureComponent": "natural-features", "mapbox:group": "Natural features, natural-labels"}, "filter": ["all", ["match", ["get", "class"], ["glacier", "landform"], ["match", ["get", "worldview"], ["all", "US"], true, false], ["disputed_glacier", "disputed_landform"], ["all", ["==", ["get", "disputed"], "true"], ["match", ["get", "worldview"], ["all", "US"], true, false]], false], ["==", ["geometry-type"], "LineString"], ["<=", ["get", "filterrank"], 1]], "type": "symbol", "source": "composite", "id": "natural-line-label", "paint": {"text-halo-width": 0.5, "text-halo-color": "rgb(255, 255, 255)", "text-halo-blur": 0.5, "text-color": "rgb(128, 128, 128)"}, "source-layer": "natural_label"}, {"minzoom": 4, "layout": {"text-size": ["step", ["zoom"], ["step", ["get", "sizerank"], 18, 5, 12], 17, ["step", ["get", "sizerank"], 18, 13, 12]], "icon-image": "", "text-font": ["DIN Pro Medium", "Arial Unicode MS Regular"], "text-offset": ["literal", [0, 0]], "text-field": ["coalesce", ["get", "name_en"], ["get", "name"]], "visibility": "none"}, "metadata": {"mapbox:featureComponent": "natural-features", "mapbox:group": "Natural features, natural-labels"}, "filter": ["all", ["match", ["get", "class"], ["dock", "glacier", "landform", "water_feature", "wetland"], ["match", ["get", "worldview"], ["all", "US"], true, false], ["disputed_dock", "disputed_glacier", "disputed_landform", "disputed_water_feature", "disputed_wetland"], ["all", ["==", ["get", "disputed"], "true"], ["match", ["get", "worldview"], ["all", "US"], true, false]], false], ["==", ["geometry-type"], "Point"], ["<=", ["get", "filterrank"], 1]], "type": "symbol", "source": "composite", "id": "natural-point-label", "paint": {"icon-opacity": ["step", ["zoom"], ["step", ["get", "sizerank"], 0, 5, 1], 17, ["step", ["get", "sizerank"], 0, 13, 1]], "text-halo-color": "rgb(255, 255, 255)", "text-halo-width": 0.5, "text-halo-blur": 0.5, "text-color": "rgb(128, 128, 128)"}, "source-layer": "natural_label"}, {"id": "water-line-label", "type": "symbol", "metadata": {"mapbox:featureComponent": "natural-features", "mapbox:group": "Natural features, natural-labels"}, "source": "composite", "source-layer": "natural_label", "filter": ["all", ["match", ["get", "class"], ["bay", "ocean", "reservoir", "sea", "water"], ["match", ["get", "worldview"], ["all", "US"], true, false], ["disputed_bay", "disputed_ocean", "disputed_reservoir", "disputed_sea", "disputed_water"], ["all", ["==", ["get", "disputed"], "true"], ["match", ["get", "worldview"], ["all", "US"], true, false]], false], ["==", ["geometry-type"], "LineString"]], "layout": {"text-size": ["interpolate", ["linear"], ["zoom"], 7, ["step", ["get", "sizerank"], 20, 6, 18, 12, 12], 10, ["step", ["get", "sizerank"], 15, 9, 12], 18, ["step", ["get", "sizerank"], 15, 9, 14]], "text-max-angle": 30, "text-letter-spacing": ["match", ["get", "class"], "ocean", 0.25, ["sea", "bay"], 0.15, 0], "text-font": ["DIN Pro Italic", "Arial Unicode MS Regular"], "symbol-placement": "line-center", "text-pitch-alignment": "viewport", "text-field": ["coalesce", ["get", "name_en"], ["get", "name"]], "visibility": "none"}, "paint": {"text-color": "rgb(150, 150, 150)"}}, {"id": "water-point-label", "type": "symbol", "source": "composite", "source-layer": "natural_label", "filter": ["all", ["match", ["get", "class"], ["bay", "ocean", "reservoir", "sea", "water"], ["match", ["get", "worldview"], ["all", "US"], true, false], ["disputed_bay", "disputed_ocean", "disputed_reservoir", "disputed_sea", "disputed_water"], ["all", ["==", ["get", "disputed"], "true"], ["match", ["get", "worldview"], ["all", "US"], true, false]], false], ["==", ["geometry-type"], "Point"]], "layout": {"text-line-height": 1.3, "text-size": ["interpolate", ["linear"], ["zoom"], 7, ["step", ["get", "sizerank"], 20, 6, 15, 12, 12], 10, ["step", ["get", "sizerank"], 15, 9, 12]], "text-font": ["DIN Pro Italic", "Arial Unicode MS Regular"], "text-field": ["coalesce", ["get", "name_en"], ["get", "name"]], "text-letter-spacing": ["match", ["get", "class"], "ocean", 0.25, ["bay", "sea"], 0.15, 0.01], "text-max-width": ["match", ["get", "class"], "ocean", 4, "sea", 5, ["bay", "water"], 7, 10], "visibility": "none"}, "paint": {"text-color": "rgb(150, 150, 150)"}, "metadata": {"mapbox:featureComponent": "natural-features", "mapbox:group": "Natural features, natural-labels"}}, {"minzoom": 6, "layout": {"text-size": ["step", ["zoom"], ["step", ["get", "sizerank"], 18, 5, 12], 17, ["step", ["get", "sizerank"], 18, 13, 12]], "icon-image": "", "text-font": ["DIN Pro Medium", "Arial Unicode MS Regular"], "text-offset": [0, 0], "text-anchor": ["step", ["zoom"], ["step", ["get", "sizerank"], "center", 5, "top"], 17, ["step", ["get", "sizerank"], "center", 13, "top"]], "text-field": ["coalesce", ["get", "name_en"], ["get", "name"]], "visibility": "none"}, "metadata": {"mapbox:featureComponent": "point-of-interest-labels", "mapbox:group": "Point of interest labels, poi-labels"}, "filter": ["<=", ["get", "filterrank"], ["+", ["step", ["zoom"], 1, 2, 3, 4, 5], 1]], "type": "symbol", "source": "composite", "id": "poi-label", "paint": {"text-halo-color": "rgb(255, 255, 255)", "text-halo-width": 0.5, "text-halo-blur": 0.5, "text-color": ["step", ["zoom"], ["step", ["get", "sizerank"], "rgb(184, 184, 184)", 5, "rgb(161, 161, 161)"], 17, ["step", ["get", "sizerank"], "rgb(184, 184, 184)", 13, "rgb(161, 161, 161)"]]}, "source-layer": "poi_label"}, {"minzoom": 8, "layout": {"text-line-height": 1.1, "text-size": ["step", ["get", "sizerank"], 18, 9, 12], "icon-image": ["get", "maki"], "text-font": ["DIN Pro Medium", "Arial Unicode MS Regular"], "visibility": "none", "text-offset": [0, 0.75], "text-rotation-alignment": "viewport", "text-anchor": "top", "text-field": ["step", ["get", "sizerank"], ["coalesce", ["get", "name_en"], ["get", "name"]], 15, ["get", "ref"]], "text-letter-spacing": 0.01, "text-max-width": 9}, "metadata": {"mapbox:featureComponent": "transit", "mapbox:group": "Transit, transit-labels"}, "filter": ["match", ["get", "class"], ["military", "civil"], ["match", ["get", "worldview"], ["all", "US"], true, false], ["disputed_military", "disputed_civil"], ["all", ["==", ["get", "disputed"], "true"], ["match", ["get", "worldview"], ["all", "US"], true, false]], false], "type": "symbol", "source": "composite", "id": "airport-label", "paint": {"text-color": "rgb(128, 128, 128)", "text-halo-color": "rgb(255, 255, 255)", "text-halo-width": 1}, "source-layer": "airport_label"}, {"minzoom": 10, "layout": {"text-field": ["coalesce", ["get", "name_en"], ["get", "name"]], "text-transform": "uppercase", "text-font": ["DIN Pro Regular", "Arial Unicode MS Regular"], "text-letter-spacing": ["match", ["get", "type"], "suburb", 0.15, 0.1], "text-max-width": 7, "text-padding": 3, "text-size": ["interpolate", ["cubic-bezier", 0.5, 0, 1, 1], ["zoom"], 11, ["match", ["get", "type"], "suburb", 11, 10.5], 15, ["match", ["get", "type"], "suburb", 15, 14]], "visibility": "none"}, "metadata": {"mapbox:featureComponent": "place-labels", "mapbox:group": "Place labels, place-labels"}, "maxzoom": 15, "filter": ["all", ["match", ["get", "class"], "settlement_subdivision", ["match", ["get", "worldview"], ["all", "US"], true, false], "disputed_settlement_subdivision", ["all", ["==", ["get", "disputed"], "true"], ["match", ["get", "worldview"], ["all", "US"], true, false]], false], ["<=", ["get", "filterrank"], 4]], "type": "symbol", "source": "composite", "id": "settlement-subdivision-label", "paint": {"text-halo-color": "rgb(255, 255, 255)", "text-halo-width": 1, "text-color": "rgb(179, 179, 179)", "text-halo-blur": 0.5}, "source-layer": "place_label"}, {"minzoom": 3, "layout": {"text-line-height": 1.1, "text-size": ["interpolate", ["cubic-bezier", 0.2, 0, 0.9, 1], ["zoom"], 3, ["step", ["get", "symbolrank"], 12, 9, 11, 10, 10.5, 12, 9.5, 14, 8.5, 16, 6.5, 17, 4], 13, ["step", ["get", "symbolrank"], 23, 9, 21, 10, 19, 11, 17, 12, 16, 13, 15, 15, 13]], "text-radial-offset": ["step", ["zoom"], ["match", ["get", "capital"], 2, 0.6, 0.55], 8, 0], "icon-image": ["step", ["zoom"], ["case", ["==", ["get", "capital"], 2], "border-dot-13", ["step", ["get", "symbolrank"], "dot-11", 9, "dot-10", 11, "dot-9"]], 8, ""], "text-font": ["DIN Pro Regular", "Arial Unicode MS Regular"], "text-justify": "auto", "visibility": "none", "text-anchor": ["step", ["zoom"], ["get", "text_anchor"], 8, "center"], "text-field": ["coalesce", ["get", "name_en"], ["get", "name"]], "text-max-width": 7}, "metadata": {"mapbox:featureComponent": "place-labels", "mapbox:group": "Place labels, place-labels"}, "maxzoom": 13, "filter": ["all", ["<=", ["get", "filterrank"], 3], ["match", ["get", "class"], "settlement", ["match", ["get", "worldview"], ["all", "US"], true, false], "disputed_settlement", ["all", ["==", ["get", "disputed"], "true"], ["match", ["get", "worldview"], ["all", "US"], true, false]], false], ["step", ["zoom"], [">", ["get", "symbolrank"], 6], 1, [">=", ["get", "symbolrank"], 7], 2, [">=", ["get", "symbolrank"], 8], 3, [">=", ["get", "symbolrank"], 10], 4, [">=", ["get", "symbolrank"], 11], 5, [">=", ["get", "symbolrank"], 13], 6, [">=", ["get", "symbolrank"], 15]]], "type": "symbol", "source": "composite", "id": "settlement-minor-label", "paint": {"text-color": ["step", ["get", "symbolrank"], "rgb(128, 128, 128)", 11, "rgb(161, 161, 161)", 16, "rgb(184, 184, 184)"], "text-halo-color": "rgb(255, 255, 255)", "text-halo-width": 1, "text-halo-blur": 1}, "source-layer": "place_label"}, {"minzoom": 3, "layout": {"text-line-height": 1.1, "text-size": ["interpolate", ["cubic-bezier", 0.2, 0, 0.9, 1], ["zoom"], 3, ["step", ["get", "symbolrank"], 13, 6, 12], 6, ["step", ["get", "symbolrank"], 16, 6, 15, 7, 14], 8, ["step", ["get", "symbolrank"], 18, 9, 17, 10, 15], 15, ["step", ["get", "symbolrank"], 23, 9, 22, 10, 20, 11, 18, 12, 16, 13, 15, 15, 13]], "text-radial-offset": ["step", ["zoom"], ["match", ["get", "capital"], 2, 0.6, 0.55], 8, 0], "icon-image": ["step", ["zoom"], ["case", ["==", ["get", "capital"], 2], "border-dot-13", ["step", ["get", "symbolrank"], "dot-11", 9, "dot-10", 11, "dot-9"]], 8, ""], "text-font": ["DIN Pro Medium", "Arial Unicode MS Regular"], "text-justify": ["step", ["zoom"], ["match", ["get", "text_anchor"], ["left", "bottom-left", "top-left"], "left", ["right", "bottom-right", "top-right"], "right", "center"], 8, "center"], "visibility": "none", "text-anchor": ["step", ["zoom"], ["get", "text_anchor"], 8, "center"], "text-field": ["coalesce", ["get", "name_en"], ["get", "name"]], "text-max-width": 7}, "metadata": {"mapbox:featureComponent": "place-labels", "mapbox:group": "Place labels, place-labels"}, "maxzoom": 15, "filter": ["all", ["<=", ["get", "filterrank"], 3], ["match", ["get", "class"], "settlement", ["match", ["get", "worldview"], ["all", "US"], true, false], "disputed_settlement", ["all", ["==", ["get", "disputed"], "true"], ["match", ["get", "worldview"], ["all", "US"], true, false]], false], ["step", ["zoom"], false, 1, ["<=", ["get", "symbolrank"], 6], 2, ["<", ["get", "symbolrank"], 7], 3, ["<", ["get", "symbolrank"], 8], 4, ["<", ["get", "symbolrank"], 10], 5, ["<", ["get", "symbolrank"], 11], 6, ["<", ["get", "symbolrank"], 13], 7, ["<", ["get", "symbolrank"], 15], 8, [">=", ["get", "symbolrank"], 11], 9, [">=", ["get", "symbolrank"], 15]]], "type": "symbol", "source": "composite", "id": "settlement-major-label", "paint": {"text-color": ["step", ["get", "symbolrank"], "rgb(128, 128, 128)", 11, "rgb(161, 161, 161)", 16, "rgb(184, 184, 184)"], "text-halo-color": "rgb(255, 255, 255)", "text-halo-width": 1, "text-halo-blur": 1}, "source-layer": "place_label"}, {"minzoom": 3, "layout": {"text-size": ["interpolate", ["cubic-bezier", 0.85, 0.7, 0.65, 1], ["zoom"], 4, ["step", ["get", "symbolrank"], 10, 6, 9.5, 7, 9], 9, ["step", ["get", "symbolrank"], 21, 6, 16, 7, 13]], "text-transform": "uppercase", "text-font": ["DIN Pro Bold", "Arial Unicode MS Bold"], "text-field": ["step", ["zoom"], ["step", ["get", "symbolrank"], ["coalesce", ["get", "name_en"], ["get", "name"]], 5, ["coalesce", ["get", "abbr"], ["get", "name_en"], ["get", "name"]]], 5, ["coalesce", ["get", "name_en"], ["get", "name"]]], "text-letter-spacing": 0.15, "text-max-width": 6, "visibility": "none"}, "metadata": {"mapbox:featureComponent": "place-labels", "mapbox:group": "Place labels, place-labels"}, "maxzoom": 9, "filter": ["match", ["get", "class"], "state", ["match", ["get", "worldview"], ["all", "US"], true, false], "disputed_state", ["all", ["==", ["get", "disputed"], "true"], ["match", ["get", "worldview"], ["all", "US"], true, false]], false], "type": "symbol", "source": "composite", "id": "state-label", "paint": {"text-color": "rgb(184, 184, 184)", "text-halo-color": "rgb(255, 255, 255)", "text-halo-width": 1}, "source-layer": "place_label"}, {"minzoom": 1, "layout": {"text-line-height": 1.1, "text-size": ["interpolate", ["cubic-bezier", 0.2, 0, 0.7, 1], ["zoom"], 1, ["step", ["get", "symbolrank"], 11, 4, 9, 5, 8], 9, ["step", ["get", "symbolrank"], 22, 4, 19, 5, 17]], "text-radial-offset": ["step", ["zoom"], 0.6, 8, 0], "icon-image": "", "text-font": ["DIN Pro Medium", "Arial Unicode MS Regular"], "text-justify": ["step", ["zoom"], ["match", ["get", "text_anchor"], ["left", "bottom-left", "top-left"], "left", ["right", "bottom-right", "top-right"], "right", "center"], 7, "auto"], "visibility": "none", "text-field": ["coalesce", ["get", "name_en"], ["get", "name"]], "text-max-width": 6}, "metadata": {"mapbox:featureComponent": "place-labels", "mapbox:group": "Place labels, place-labels"}, "maxzoom": 10, "filter": ["match", ["get", "class"], "country", ["match", ["get", "worldview"], ["all", "US"], true, false], "disputed_country", ["all", ["==", ["get", "disputed"], "true"], ["match", ["get", "worldview"], ["all", "US"], true, false]], false], "type": "symbol", "source": "composite", "id": "country-label", "paint": {"icon-opacity": ["step", ["zoom"], ["case", ["has", "text_anchor"], 1, 0], 7, 0], "text-color": "rgb(128, 128, 128)", "text-halo-color": "rgb(255, 255, 255)", "text-halo-width": 1.25}, "source-layer": "place_label"}], "created": "2021-11-05T16:12:04.822Z", "modified": "2021-11-25T13:58:04.167Z", "id": "ckvmksrpd4n0a14pfdo5heqzr", "owner": "commaai", "visibility": "private", "protected": false, "draft": false} \ No newline at end of file diff --git a/selfdrive/navd/tests/test_map_renderer.py b/selfdrive/navd/tests/test_map_renderer.py deleted file mode 100644 index 04363883b2..0000000000 --- a/selfdrive/navd/tests/test_map_renderer.py +++ /dev/null @@ -1,212 +0,0 @@ -import time -import numpy as np -import os -import pytest -import requests -import threading -import http.server -import cereal.messaging as messaging - -from typing import Any -from msgq.visionipc import VisionIpcClient, VisionStreamType -from openpilot.common.mock.generators import LLK_DECIMATION, LOCATION1, LOCATION2, generate_liveLocationKalman -from openpilot.selfdrive.test.helpers import with_processes - -CACHE_PATH = "/data/mbgl-cache-navd.db" - -RENDER_FRAMES = 15 -DEFAULT_ITERATIONS = RENDER_FRAMES * LLK_DECIMATION -LOCATION1_REPEATED = [LOCATION1] * DEFAULT_ITERATIONS -LOCATION2_REPEATED = [LOCATION2] * DEFAULT_ITERATIONS - - -class MapBoxInternetDisabledRequestHandler(http.server.BaseHTTPRequestHandler): - INTERNET_ACTIVE = True - - def do_GET(self): - if not self.INTERNET_ACTIVE: - self.send_response(500) - self.end_headers() - return - - url = f'https://api.mapbox.com{self.path}' - - headers = dict(self.headers) - headers["Host"] = "api.mapbox.com" - - r = requests.get(url, headers=headers, timeout=5) - - self.send_response(r.status_code) - self.end_headers() - self.wfile.write(r.content) - - def log_message(self, *args: Any) -> None: - return - - def log_error(self, *args: Any) -> None: - return - - -class MapBoxInternetDisabledServer(threading.Thread): - def run(self): - self.server = http.server.HTTPServer(("127.0.0.1", 0), MapBoxInternetDisabledRequestHandler) - self.port = self.server.server_port - self.server.serve_forever() - - def stop(self): - self.server.shutdown() - - def disable_internet(self): - MapBoxInternetDisabledRequestHandler.INTERNET_ACTIVE = False - - def enable_internet(self): - MapBoxInternetDisabledRequestHandler.INTERNET_ACTIVE = True - - -@pytest.mark.skip(reason="not used") -class TestMapRenderer: - server: MapBoxInternetDisabledServer - - @classmethod - def setup_class(cls): - assert "MAPBOX_TOKEN" in os.environ - cls.original_token = os.environ["MAPBOX_TOKEN"] - cls.server = MapBoxInternetDisabledServer() - cls.server.start() - time.sleep(0.5) # wait for server to startup - - @classmethod - def teardown_class(cls) -> None: - cls.server.stop() - - def setup_method(self): - self.server.enable_internet() - os.environ['MAPS_HOST'] = f'http://localhost:{self.server.port}' - - self.sm = messaging.SubMaster(['mapRenderState']) - self.pm = messaging.PubMaster(['liveLocationKalman']) - self.vipc = VisionIpcClient("navd", VisionStreamType.VISION_STREAM_MAP, True) - - if os.path.exists(CACHE_PATH): - os.remove(CACHE_PATH) - - def _setup_test(self): - assert self.pm.wait_for_readers_to_update("liveLocationKalman", 10) - - time.sleep(0.5) - - assert VisionIpcClient.available_streams("navd", False) == {VisionStreamType.VISION_STREAM_MAP, } - assert self.vipc.connect(False) - self.vipc.recv() - - def _run_test(self, expect_valid, locations=LOCATION1_REPEATED): - starting_frame_id = None - - render_times = [] - - # run test - prev_frame_id = -1 - for i, location in enumerate(locations): - frame_expected = (i+1) % LLK_DECIMATION == 0 - - if self.sm.logMonoTime['mapRenderState'] == 0: - prev_valid = False - prev_frame_id = -1 - else: - prev_valid = self.sm.valid['mapRenderState'] - prev_frame_id = self.sm['mapRenderState'].frameId - - if starting_frame_id is None: - starting_frame_id = prev_frame_id - - llk = generate_liveLocationKalman(location) - self.pm.send("liveLocationKalman", llk) - self.pm.wait_for_readers_to_update("liveLocationKalman", 10) - self.sm.update(1000 if frame_expected else 0) - assert self.sm.updated['mapRenderState'] == frame_expected, "renderer running at wrong frequency" - - if not frame_expected: - continue - - frames_since_test_start = self.sm['mapRenderState'].frameId - starting_frame_id - - # give a few frames to switch from valid to invalid, or vice versa - invalid_and_not_previously_valid = (expect_valid and not self.sm.valid['mapRenderState'] and not prev_valid) - valid_and_not_previously_invalid = (not expect_valid and self.sm.valid['mapRenderState'] and prev_valid) - - if (invalid_and_not_previously_valid or valid_and_not_previously_invalid) and frames_since_test_start < 20: - continue - - # check output - assert self.sm.valid['mapRenderState'] == expect_valid - assert self.sm['mapRenderState'].frameId == (prev_frame_id + 1) - assert self.sm['mapRenderState'].locationMonoTime == llk.logMonoTime - if not expect_valid: - assert self.sm['mapRenderState'].renderTime == 0. - else: - assert 0. < self.sm['mapRenderState'].renderTime < 0.1 - render_times.append(self.sm['mapRenderState'].renderTime) - - # check vision ipc output - assert self.vipc.recv() is not None - assert self.vipc.valid == expect_valid - assert self.vipc.timestamp_sof == llk.logMonoTime - assert self.vipc.frame_id == self.sm['mapRenderState'].frameId - - assert frames_since_test_start >= RENDER_FRAMES - - return render_times - - @with_processes(["mapsd"]) - def test_with_internet(self): - self._setup_test() - self._run_test(True) - - @with_processes(["mapsd"]) - def test_with_no_internet(self): - self.server.disable_internet() - self._setup_test() - self._run_test(False) - - @with_processes(["mapsd"]) - @pytest.mark.skip(reason="slow, flaky, and unlikely to break") - def test_recover_from_no_internet(self): - self._setup_test() - self._run_test(True) - - self.server.disable_internet() - - # change locations to force mapsd to refetch - self._run_test(False, LOCATION2_REPEATED) - - self.server.enable_internet() - self._run_test(True, LOCATION2_REPEATED) - - @with_processes(["mapsd"]) - @pytest.mark.tici - def test_render_time_distribution(self): - self._setup_test() - # from location1 -> location2 and back - locations = np.array([*np.linspace(LOCATION1, LOCATION2, 2000), *np.linspace(LOCATION2, LOCATION1, 2000)]).tolist() - - render_times = self._run_test(True, locations) - - _min = np.min(render_times) - _max = np.max(render_times) - _mean = np.mean(render_times) - _median = np.median(render_times) - _stddev = np.std(render_times) - - print(f"Stats: min: {_min}, max: {_max}, mean: {_mean}, median: {_median}, stddev: {_stddev}, count: {len(render_times)}") - - def assert_stat(stat, nominal, tol=0.3): - tol = (nominal / (1+tol)), (nominal * (1+tol)) - assert tol[0] < stat < tol[1], f"{stat} not in tolerance {tol}" - - assert_stat(_mean, 0.030) - assert_stat(_median, 0.027) - assert_stat(_stddev, 0.0078) - - assert _max < 0.065 - assert _min > 0.015 - diff --git a/selfdrive/navd/tests/test_navd.py b/selfdrive/navd/tests/test_navd.py deleted file mode 100644 index b6580acff1..0000000000 --- a/selfdrive/navd/tests/test_navd.py +++ /dev/null @@ -1,57 +0,0 @@ -import json -import random -import numpy as np - -from parameterized import parameterized - -import cereal.messaging as messaging -from openpilot.common.params import Params -from openpilot.system.manager.process_config import managed_processes - - -class TestNavd: - def setup_method(self): - self.params = Params() - self.sm = messaging.SubMaster(['navRoute', 'navInstruction']) - - def teardown_method(self): - managed_processes['navd'].stop() - - def _check_route(self, start, end, check_coords=True): - self.params.put("NavDestination", json.dumps(end)) - self.params.put("LastGPSPosition", json.dumps(start)) - - managed_processes['navd'].start() - for _ in range(30): - self.sm.update(1000) - if all(f > 0 for f in self.sm.recv_frame.values()): - break - else: - raise Exception("didn't get a route") - - assert managed_processes['navd'].proc.is_alive() - managed_processes['navd'].stop() - - # ensure start and end match up - if check_coords: - coords = self.sm['navRoute'].coordinates - assert np.allclose([start['latitude'], start['longitude'], end['latitude'], end['longitude']], - [coords[0].latitude, coords[0].longitude, coords[-1].latitude, coords[-1].longitude], - rtol=1e-3) - - def test_simple(self): - start = { - "latitude": 32.7427228, - "longitude": -117.2321177, - } - end = { - "latitude": 32.7557004, - "longitude": -117.268002, - } - self._check_route(start, end) - - @parameterized.expand([(i,) for i in range(10)]) - def test_random(self, index): - start = {"latitude": random.uniform(-90, 90), "longitude": random.uniform(-180, 180)} - end = {"latitude": random.uniform(-90, 90), "longitude": random.uniform(-180, 180)} - self._check_route(start, end, check_coords=False) diff --git a/selfdrive/test/test_onroad.py b/selfdrive/test/test_onroad.py index 7b44a3b80e..7574a5e4ab 100644 --- a/selfdrive/test/test_onroad.py +++ b/selfdrive/test/test_onroad.py @@ -60,7 +60,6 @@ PROCS = { "system.timed": 0, "selfdrive.pandad.pandad": 0, "system.statsd": 0.4, - "selfdrive.navd.navd": 0.4, "system.loggerd.uploader": (0.5, 15.0), "system.loggerd.deleter": 0.1, } diff --git a/selfdrive/ui/SConscript b/selfdrive/ui/SConscript index e4fb32586d..8b268b9e84 100644 --- a/selfdrive/ui/SConscript +++ b/selfdrive/ui/SConscript @@ -1,6 +1,6 @@ import os import json -Import('qt_env', 'arch', 'common', 'messaging', 'visionipc', 'transformations', 'UBUNTU_FOCAL') +Import('qt_env', 'arch', 'common', 'messaging', 'visionipc', 'transformations') base_libs = [common, messaging, visionipc, transformations, 'm', 'OpenCL', 'ssl', 'crypto', 'pthread'] + qt_env["LIBS"] @@ -8,8 +8,6 @@ base_libs = [common, messaging, visionipc, transformations, if arch == 'larch64': base_libs.append('EGL') -maps = arch in ['larch64', 'aarch64', 'x86_64'] and not UBUNTU_FOCAL - if arch == "Darwin": del base_libs[base_libs.index('OpenCL')] qt_env['FRAMEWORKS'] += ['OpenCL'] @@ -24,13 +22,6 @@ widgets_src = ["ui.cc", "qt/widgets/input.cc", "qt/widgets/wifi.cc", "qt/widgets/scrollview.cc", "qt/widgets/cameraview.cc", "#third_party/qrcode/QrCode.cc", "qt/request_repeater.cc", "qt/qt_window.cc", "qt/network/networking.cc", "qt/network/wifi_manager.cc"] -qt_env['CPPDEFINES'] = [] -if maps: - base_libs += ['QMapLibre'] - widgets_src += ["qt/maps/map_helpers.cc", "qt/maps/map_settings.cc", "qt/maps/map.cc", "qt/maps/map_panel.cc", - "qt/maps/map_eta.cc", "qt/maps/map_instructions.cc"] - qt_env['CPPDEFINES'] += ["ENABLE_MAPS"] - widgets = qt_env.Library("qt_widgets", widgets_src, LIBS=base_libs) Export('widgets') qt_libs = [widgets, qt_util] + base_libs diff --git a/selfdrive/ui/qt/home.cc b/selfdrive/ui/qt/home.cc index 9dbe7cbae3..c510087e8e 100644 --- a/selfdrive/ui/qt/home.cc +++ b/selfdrive/ui/qt/home.cc @@ -9,10 +9,6 @@ #include "selfdrive/ui/qt/util.h" #include "selfdrive/ui/qt/widgets/prime.h" -#ifdef ENABLE_MAPS -#include "selfdrive/ui/qt/maps/map_settings.h" -#endif - // HomeWindow: the container for the offroad and onroad UIs HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) { @@ -145,13 +141,17 @@ OffroadHome::OffroadHome(QWidget* parent) : QFrame(parent) { home_layout->setContentsMargins(0, 0, 0, 0); home_layout->setSpacing(30); - // left: MapSettings/PrimeAdWidget + // left: PrimeAdWidget QStackedWidget *left_widget = new QStackedWidget(this); -#ifdef ENABLE_MAPS - left_widget->addWidget(new MapSettings); -#else - left_widget->addWidget(new QWidget); -#endif + QVBoxLayout *left_prime_layout = new QVBoxLayout(); + QWidget *prime_user = new PrimeUserWidget(); + prime_user->setStyleSheet(R"( + border-radius: 10px; + background-color: #333333; + )"); + left_prime_layout->addWidget(prime_user); + left_prime_layout->addStretch(); + left_widget->addWidget(new LayoutWidget(left_prime_layout)); left_widget->addWidget(new PrimeAdWidget); left_widget->setStyleSheet("border-radius: 10px;"); diff --git a/selfdrive/ui/qt/maps/map.cc b/selfdrive/ui/qt/maps/map.cc deleted file mode 100644 index 490eb118ca..0000000000 --- a/selfdrive/ui/qt/maps/map.cc +++ /dev/null @@ -1,390 +0,0 @@ -#include "selfdrive/ui/qt/maps/map.h" - -#include -#include - -#include - -#include "common/swaglog.h" -#include "selfdrive/ui/qt/maps/map_helpers.h" -#include "selfdrive/ui/qt/util.h" -#include "selfdrive/ui/ui.h" - - -const int INTERACTION_TIMEOUT = 100; - -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 QMapLibre::Settings &settings) : m_settings(settings), velocity_filter(0, 10, 0.05, false) { - QObject::connect(uiState(), &UIState::uiUpdate, this, &MapWindow::updateState); - - map_overlay = new QWidget (this); - map_overlay->setAttribute(Qt::WA_TranslucentBackground, true); - QVBoxLayout *overlay_layout = new QVBoxLayout(map_overlay); - overlay_layout->setContentsMargins(0, 0, 0, 0); - - // Instructions - map_instructions = new MapInstructions(this); - map_instructions->setVisible(false); - - map_eta = new MapETA(this); - map_eta->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - map_eta->setFixedHeight(120); - - error = new QLabel(this); - error->setStyleSheet(R"(color:white;padding:50px 11px;font-size: 90px; background-color:rgba(0, 0, 0, 150);)"); - error->setAlignment(Qt::AlignCenter); - - overlay_layout->addWidget(error); - overlay_layout->addWidget(map_instructions); - overlay_layout->addStretch(1); - overlay_layout->addWidget(map_eta); - - last_position = coordinate_from_param("LastGPSPosition"); - grabGesture(Qt::GestureType::PinchGesture); - qDebug() << "MapWindow initialized"; -} - -MapWindow::~MapWindow() { - makeCurrent(); -} - -void MapWindow::initLayers() { - // This doesn't work from initializeGL - if (!m_map->layerExists("modelPathLayer")) { - qDebug() << "Initializing modelPathLayer"; - QVariantMap modelPath; - //modelPath["id"] = "modelPathLayer"; - modelPath["type"] = "line"; - modelPath["source"] = "modelPathSource"; - m_map->addLayer("modelPathLayer", 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")) { - qDebug() << "Initializing navLayer"; - QVariantMap nav; - nav["type"] = "line"; - nav["source"] = "navSource"; - m_map->addLayer("navLayer", nav, "road-intersection"); - - QVariantMap transition; - transition["duration"] = 400; // ms - m_map->setPaintProperty("navLayer", "line-color", QColor("#31a1ee")); - m_map->setPaintProperty("navLayer", "line-color-transition", transition); - m_map->setPaintProperty("navLayer", "line-width", 7.5); - m_map->setLayoutProperty("navLayer", "line-cap", "round"); - } - if (!m_map->layerExists("pinLayer")) { - qDebug() << "Initializing pinLayer"; - m_map->addImage("default_marker", QImage("../assets/navigation/default_marker.svg")); - QVariantMap pin; - pin["type"] = "symbol"; - pin["source"] = "pinSource"; - m_map->addLayer("pinLayer", pin); - m_map->setLayoutProperty("pinLayer", "icon-pitch-alignment", "viewport"); - m_map->setLayoutProperty("pinLayer", "icon-image", "default_marker"); - m_map->setLayoutProperty("pinLayer", "icon-ignore-placement", true); - m_map->setLayoutProperty("pinLayer", "icon-allow-overlap", true); - m_map->setLayoutProperty("pinLayer", "symbol-sort-key", 0); - m_map->setLayoutProperty("pinLayer", "icon-anchor", "bottom"); - } - if (!m_map->layerExists("carPosLayer")) { - qDebug() << "Initializing carPosLayer"; - m_map->addImage("label-arrow", QImage("../assets/images/triangle.svg")); - - QVariantMap carPos; - carPos["type"] = "symbol"; - carPos["source"] = "carPosSource"; - m_map->addLayer("carPosLayer", 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); - // TODO: remove, symbol-sort-key does not seem to matter outside of each layer - m_map->setLayoutProperty("carPosLayer", "symbol-sort-key", 0); - } -} - -void MapWindow::updateState(const UIState &s) { - if (!uiState()->scene.started) { - return; - } - const SubMaster &sm = *(s.sm); - update(); - - // on rising edge of a valid system time, reinitialize the map to set a new token - if (sm.valid("clocks") && !prev_time_valid) { - LOGW("Time is now valid, reinitializing map"); - m_settings.setApiKey(get_mapbox_token()); - initializeGL(); - } - prev_time_valid = sm.valid("clocks"); - - if (sm.updated("liveLocationKalman")) { - auto locationd_location = sm["liveLocationKalman"].getLiveLocationKalman(); - auto locationd_pos = locationd_location.getPositionGeodetic(); - auto locationd_orientation = locationd_location.getCalibratedOrientationNED(); - auto locationd_velocity = locationd_location.getVelocityCalibrated(); - auto locationd_ecef = locationd_location.getPositionECEF(); - - locationd_valid = (locationd_pos.getValid() && locationd_orientation.getValid() && locationd_velocity.getValid() && locationd_ecef.getValid()); - if (locationd_valid) { - // Check std norm - auto pos_ecef_std = locationd_ecef.getStd(); - bool pos_accurate_enough = sqrt(pow(pos_ecef_std[0], 2) + pow(pos_ecef_std[1], 2) + pow(pos_ecef_std[2], 2)) < 100; - locationd_valid = pos_accurate_enough; - } - - if (locationd_valid) { - last_position = QMapLibre::Coordinate(locationd_pos.getValue()[0], locationd_pos.getValue()[1]); - last_bearing = RAD2DEG(locationd_orientation.getValue()[2]); - velocity_filter.update(std::max(10.0, locationd_velocity.getValue()[0])); - } - } - - if (sm.updated("navRoute") && sm["navRoute"].getNavRoute().getCoordinates().size()) { - auto nav_dest = coordinate_from_param("NavDestination"); - bool allow_open = std::exchange(last_valid_nav_dest, nav_dest) != nav_dest && - nav_dest && !isVisible(); - qWarning() << "Got new navRoute from navd. Opening map:" << allow_open; - - // Show map on destination set/change - if (allow_open) { - emit requestSettings(false); - emit requestVisible(true); - } - } - - loaded_once = loaded_once || (m_map && m_map->isFullyLoaded()); - if (!loaded_once) { - setError(tr("Map Loading")); - return; - } - initLayers(); - - if (!locationd_valid) { - setError(tr("Waiting for GPS")); - } else if (routing_problem) { - setError(tr("Waiting for route")); - } else { - setError(""); - } - - if (locationd_valid) { - // Update current location marker - auto point = coordinate_to_collection(*last_position); - QMapLibre::Feature feature1(QMapLibre::Feature::PointType, point, {}, {}); - QVariantMap carPosSource; - carPosSource["type"] = "geojson"; - carPosSource["data"] = QVariant::fromValue(feature1); - m_map->updateSource("carPosSource", carPosSource); - - // Map bearing isn't updated when interacting, keep location marker up to date - if (last_bearing) { - m_map->setLayoutProperty("carPosLayer", "icon-rotate", *last_bearing - m_map->bearing()); - } - } - - if (interaction_counter == 0) { - if (last_position) m_map->setCoordinate(*last_position); - if (last_bearing) m_map->setBearing(*last_bearing); - m_map->setZoom(util::map_val(velocity_filter.x(), 0, 30, MAX_ZOOM, MIN_ZOOM)); - } else { - interaction_counter--; - } - - if (sm.updated("navInstruction")) { - // an invalid navInstruction packet with a nav destination is only possible if: - // - API exception/no internet - // - route response is empty - // - any time navd is waiting for recompute_countdown - routing_problem = !sm.valid("navInstruction") && coordinate_from_param("NavDestination").has_value(); - - if (sm.valid("navInstruction")) { - auto i = sm["navInstruction"].getNavInstruction(); - map_eta->updateETA(i.getTimeRemaining(), i.getTimeRemainingTypical(), i.getDistanceRemaining()); - - if (locationd_valid) { - m_map->setPitch(MAX_PITCH); // TODO: smooth pitching based on maneuver distance - map_instructions->updateInstructions(i); - } - } else { - clearRoute(); - } - } - - if (sm.rcv_frame("navRoute") != route_rcv_frame) { - qWarning() << "Updating navLayer with new route"; - auto route = sm["navRoute"].getNavRoute(); - auto route_points = capnp_coordinate_list_to_collection(route.getCoordinates()); - QMapLibre::Feature feature(QMapLibre::Feature::LineStringType, route_points, {}, {}); - QVariantMap navSource; - navSource["type"] = "geojson"; - navSource["data"] = QVariant::fromValue(feature); - m_map->updateSource("navSource", navSource); - m_map->setLayoutProperty("navLayer", "visibility", "visible"); - - route_rcv_frame = sm.rcv_frame("navRoute"); - updateDestinationMarker(); - } -} - -void MapWindow::setError(const QString &err_str) { - if (err_str != error->text()) { - error->setText(err_str); - error->setVisible(!err_str.isEmpty()); - if (!err_str.isEmpty()) map_instructions->setVisible(false); - } -} - -void MapWindow::resizeGL(int w, int h) { - m_map->resize(size() / MAP_SCALE); - map_overlay->setFixedSize(width(), height()); -} - -void MapWindow::initializeGL() { - m_map.reset(new QMapLibre::Map(this, m_settings, size(), 1)); - - if (last_position) { - m_map->setCoordinateZoom(*last_position, MAX_ZOOM); - } else { - m_map->setCoordinateZoom(QMapLibre::Coordinate(64.31990695292795, -149.79038934046247), MIN_ZOOM); - } - - m_map->setMargins({0, 350, 0, 50}); - m_map->setPitch(MIN_PITCH); - m_map->setStyleUrl("mapbox://styles/commaai/clkqztk0f00ou01qyhsa5bzpj"); - - QObject::connect(m_map.data(), &QMapLibre::Map::mapChanged, [=](QMapLibre::Map::MapChange change) { - // set global animation duration to 0 ms so visibility changes are instant - if (change == QMapLibre::Map::MapChange::MapChangeDidFinishLoadingStyle) { - m_map->setTransitionOptions(0, 0); - } - if (change == QMapLibre::Map::MapChange::MapChangeDidFinishLoadingMap) { - loaded_once = true; - } - }); - - QObject::connect(m_map.data(), &QMapLibre::Map::mapLoadingFailed, [=](QMapLibre::Map::MapLoadingFailure err_code, const QString &reason) { - LOGE("Map loading failed with %d: '%s'\n", err_code, reason.toStdString().c_str()); - }); -} - -void MapWindow::paintGL() { - if (!isVisible() || m_map.isNull()) return; - m_map->render(); -} - -void MapWindow::clearRoute() { - if (!m_map.isNull()) { - m_map->setLayoutProperty("navLayer", "visibility", "none"); - m_map->setPitch(MIN_PITCH); - updateDestinationMarker(); - } - - map_instructions->setVisible(false); - map_eta->setVisible(false); - last_valid_nav_dest = std::nullopt; -} - -void MapWindow::mousePressEvent(QMouseEvent *ev) { - m_lastPos = ev->localPos(); - ev->accept(); -} - -void MapWindow::mouseDoubleClickEvent(QMouseEvent *ev) { - if (last_position) m_map->setCoordinate(*last_position); - if (last_bearing) m_map->setBearing(*last_bearing); - m_map->setZoom(util::map_val(velocity_filter.x(), 0, 30, MAX_ZOOM, MIN_ZOOM)); - update(); - - interaction_counter = 0; -} - -void MapWindow::mouseMoveEvent(QMouseEvent *ev) { - QPointF delta = ev->localPos() - m_lastPos; - - if (!delta.isNull()) { - interaction_counter = INTERACTION_TIMEOUT; - m_map->moveBy(delta / MAP_SCALE); - update(); - } - - 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); - update(); - - interaction_counter = INTERACTION_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}); - update(); - interaction_counter = INTERACTION_TIMEOUT; - } -} - -void MapWindow::offroadTransition(bool offroad) { - if (offroad) { - clearRoute(); - routing_problem = false; - } else { - auto dest = coordinate_from_param("NavDestination"); - emit requestVisible(dest.has_value()); - } - last_bearing = {}; -} - -void MapWindow::updateDestinationMarker() { - auto nav_dest = coordinate_from_param("NavDestination"); - if (nav_dest.has_value()) { - auto point = coordinate_to_collection(*nav_dest); - QMapLibre::Feature feature(QMapLibre::Feature::PointType, point, {}, {}); - QVariantMap pinSource; - pinSource["type"] = "geojson"; - pinSource["data"] = QVariant::fromValue(feature); - m_map->updateSource("pinSource", pinSource); - m_map->setPaintProperty("pinLayer", "visibility", "visible"); - } else { - m_map->setPaintProperty("pinLayer", "visibility", "none"); - } -} diff --git a/selfdrive/ui/qt/maps/map.h b/selfdrive/ui/qt/maps/map.h deleted file mode 100644 index 31a44f27b1..0000000000 --- a/selfdrive/ui/qt/maps/map.h +++ /dev/null @@ -1,86 +0,0 @@ -#pragma once - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cereal/messaging/messaging.h" -#include "common/params.h" -#include "common/util.h" -#include "selfdrive/ui/ui.h" -#include "selfdrive/ui/qt/maps/map_eta.h" -#include "selfdrive/ui/qt/maps/map_instructions.h" - -class MapWindow : public QOpenGLWidget { - Q_OBJECT - -public: - MapWindow(const QMapLibre::Settings &); - ~MapWindow(); - -private: - void initializeGL() final; - void paintGL() final; - void resizeGL(int w, int h) override; - - QMapLibre::Settings m_settings; - QScopedPointer m_map; - - void initLayers(); - - void mousePressEvent(QMouseEvent *ev) final; - void mouseDoubleClickEvent(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); - void setError(const QString &err_str); - - bool loaded_once = false; - bool prev_time_valid = true; - - // Panning - QPointF m_lastPos; - int interaction_counter = 0; - - // Position - std::optional last_valid_nav_dest; - std::optional last_position; - std::optional last_bearing; - FirstOrderFilter velocity_filter; - bool locationd_valid = false; - bool routing_problem = false; - - QWidget *map_overlay; - QLabel *error; - MapInstructions* map_instructions; - MapETA* map_eta; - - void clearRoute(); - void updateDestinationMarker(); - uint64_t route_rcv_frame = 0; - -private slots: - void updateState(const UIState &s); - -public slots: - void offroadTransition(bool offroad); - -signals: - void requestVisible(bool visible); - void requestSettings(bool settings); -}; diff --git a/selfdrive/ui/qt/maps/map_eta.cc b/selfdrive/ui/qt/maps/map_eta.cc deleted file mode 100644 index 0eb77e36ce..0000000000 --- a/selfdrive/ui/qt/maps/map_eta.cc +++ /dev/null @@ -1,59 +0,0 @@ -#include "selfdrive/ui/qt/maps/map_eta.h" - -#include -#include - -#include "selfdrive/ui/qt/maps/map_helpers.h" -#include "selfdrive/ui/ui.h" - -const float MANEUVER_TRANSITION_THRESHOLD = 10; - -MapETA::MapETA(QWidget *parent) : QWidget(parent) { - setVisible(false); - setAttribute(Qt::WA_TranslucentBackground); - eta_doc.setUndoRedoEnabled(false); - eta_doc.setDefaultStyleSheet("body {font-family:Inter;font-size:70px;color:white;} b{font-weight:600;} td{padding:0 3px;}"); -} - -void MapETA::paintEvent(QPaintEvent *event) { - if (!eta_doc.isEmpty()) { - QPainter p(this); - p.setRenderHint(QPainter::Antialiasing); - p.setPen(Qt::NoPen); - p.setBrush(QColor(0, 0, 0, 255)); - QSizeF txt_size = eta_doc.size(); - p.drawRoundedRect((width() - txt_size.width()) / 2 - UI_BORDER_SIZE, 0, txt_size.width() + UI_BORDER_SIZE * 2, height() + 25, 25, 25); - p.translate((width() - txt_size.width()) / 2, (height() - txt_size.height()) / 2); - eta_doc.drawContents(&p); - } -} - -void MapETA::updateETA(float s, float s_typical, float d) { - // ETA - auto eta_t = QDateTime::currentDateTime().addSecs(s).time(); - auto eta = format_24h ? std::pair{eta_t.toString("HH:mm"), tr("eta")} - : std::pair{eta_t.toString("h:mm a").split(' ')[0], eta_t.toString("a")}; - - // Remaining time - auto remaining = s < 3600 ? std::pair{QString::number(int(s / 60)), tr("min")} - : std::pair{QString("%1:%2").arg((int)s / 3600).arg(((int)s % 3600) / 60, 2, 10, QLatin1Char('0')), tr("hr")}; - QString color = "#25DA6E"; - if (std::abs(s_typical) > 1e-5) { - if (s / s_typical > 1.5) { - color = "#DA3025"; - } else if (s / s_typical > 1.2) { - color = "#DAA725"; - } - } - - // Distance - auto distance = map_format_distance(d, uiState()->scene.is_metric); - - eta_doc.setHtml(QString(R"( - - )") - .arg(eta.first, eta.second, color, remaining.first, remaining.second, distance.first, distance.second)); - - setVisible(d >= MANEUVER_TRANSITION_THRESHOLD); - update(); -} diff --git a/selfdrive/ui/qt/maps/map_eta.h b/selfdrive/ui/qt/maps/map_eta.h deleted file mode 100644 index 6e59837de3..0000000000 --- a/selfdrive/ui/qt/maps/map_eta.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include -#include -#include - -#include "common/params.h" - -class MapETA : public QWidget { - Q_OBJECT - -public: - MapETA(QWidget * parent=nullptr); - void updateETA(float seconds, float seconds_typical, float distance); - -private: - void paintEvent(QPaintEvent *event) override; - void showEvent(QShowEvent *event) override { format_24h = param.getBool("NavSettingTime24h"); } - - bool format_24h = false; - QTextDocument eta_doc; - Params param; -}; diff --git a/selfdrive/ui/qt/maps/map_helpers.cc b/selfdrive/ui/qt/maps/map_helpers.cc deleted file mode 100644 index 50e1401164..0000000000 --- a/selfdrive/ui/qt/maps/map_helpers.cc +++ /dev/null @@ -1,153 +0,0 @@ -#include "selfdrive/ui/qt/maps/map_helpers.h" - -#include -#include -#include - -#include -#include - -#include "common/params.h" -#include "system/hardware/hw.h" -#include "selfdrive/ui/qt/api.h" - -QString get_mapbox_token() { - // Valid for 4 weeks since we can't swap tokens on the fly - return MAPBOX_TOKEN.isEmpty() ? CommaApi::create_jwt({}, 4 * 7 * 24 * 3600) : MAPBOX_TOKEN; -} - -QMapLibre::Settings get_mapbox_settings() { - QMapLibre::Settings settings; - settings.setProviderTemplate(QMapLibre::Settings::ProviderTemplate::MapboxProvider); - - if (!Hardware::PC()) { - settings.setCacheDatabasePath(MAPS_CACHE_PATH); - settings.setCacheDatabaseMaximumSize(100 * 1024 * 1024); - } - settings.setApiBaseUrl(MAPS_HOST); - settings.setApiKey(get_mapbox_token()); - - return settings; -} - -QGeoCoordinate to_QGeoCoordinate(const QMapLibre::Coordinate &in) { - return QGeoCoordinate(in.first, in.second); -} - -QMapLibre::CoordinatesCollections model_to_collection( - const cereal::LiveLocationKalman::Measurement::Reader &calibratedOrientationECEF, - const cereal::LiveLocationKalman::Measurement::Reader &positionECEF, - const cereal::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); - - QMapLibre::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]}); - coordinates.push_back({point_geodetic.lat, point_geodetic.lon}); - } - - return {QMapLibre::CoordinatesCollection{coordinates}}; -} - -QMapLibre::CoordinatesCollections coordinate_to_collection(const QMapLibre::Coordinate &c) { - QMapLibre::Coordinates coordinates{c}; - return {QMapLibre::CoordinatesCollection{coordinates}}; -} - -QMapLibre::CoordinatesCollections capnp_coordinate_list_to_collection(const capnp::List::Reader& coordinate_list) { - QMapLibre::Coordinates coordinates; - for (auto const &c : coordinate_list) { - coordinates.push_back({c.getLatitude(), c.getLongitude()}); - } - return {QMapLibre::CoordinatesCollection{coordinates}}; -} - -QMapLibre::CoordinatesCollections coordinate_list_to_collection(const QList &coordinate_list) { - QMapLibre::Coordinates coordinates; - for (auto &c : coordinate_list) { - coordinates.push_back({c.latitude(), c.longitude()}); - } - return {QMapLibre::CoordinatesCollection{coordinates}}; -} - -QList polyline_to_coordinate_list(const QString &polylineString) { - QList path; - if (polylineString.isEmpty()) - return path; - - QByteArray data = polylineString.toLatin1(); - - bool parsingLatitude = true; - - int shift = 0; - int value = 0; - - QGeoCoordinate coord(0, 0); - - for (int i = 0; i < data.length(); ++i) { - unsigned char c = data.at(i) - 63; - - value |= (c & 0x1f) << shift; - shift += 5; - - // another chunk - if (c & 0x20) - continue; - - int diff = (value & 1) ? ~(value >> 1) : (value >> 1); - - if (parsingLatitude) { - coord.setLatitude(coord.latitude() + (double)diff/1e6); - } else { - coord.setLongitude(coord.longitude() + (double)diff/1e6); - path.append(coord); - } - - parsingLatitude = !parsingLatitude; - - value = 0; - shift = 0; - } - - return path; -} - -std::optional coordinate_from_param(const std::string ¶m) { - QString json_str = QString::fromStdString(Params().get(param)); - if (json_str.isEmpty()) return {}; - - QJsonDocument doc = QJsonDocument::fromJson(json_str.toUtf8()); - if (doc.isNull()) return {}; - - QJsonObject json = doc.object(); - if (json["latitude"].isDouble() && json["longitude"].isDouble()) { - QMapLibre::Coordinate coord(json["latitude"].toDouble(), json["longitude"].toDouble()); - return coord; - } else { - return {}; - } -} - -// return {distance, unit} -std::pair map_format_distance(float d, bool is_metric) { - auto round_distance = [](float d) -> QString { - return (d > 10) ? QString::number(std::nearbyint(d)) : QString::number(std::nearbyint(d * 10) / 10.0, 'f', 1); - }; - - d = std::max(d, 0.0f); - if (is_metric) { - return (d > 500) ? std::pair(round_distance(d / 1000), QObject::tr("km")) - : std::pair(QString::number(50 * std::nearbyint(d / 50)), QObject::tr("m")); - } else { - float feet = d * METER_TO_FOOT; - return (feet > 500) ? std::pair(round_distance(d * METER_TO_MILE), QObject::tr("mi")) - : std::pair(QString::number(50 * std::nearbyint(d / 50)), QObject::tr("ft")); - } -} diff --git a/selfdrive/ui/qt/maps/map_helpers.h b/selfdrive/ui/qt/maps/map_helpers.h deleted file mode 100644 index 0f4be674f0..0000000000 --- a/selfdrive/ui/qt/maps/map_helpers.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -#include "common/util.h" -#include "common/transformations/coordinates.hpp" -#include "common/transformations/orientation.hpp" -#include "cereal/messaging/messaging.h" - -const QString MAPBOX_TOKEN = util::getenv("MAPBOX_TOKEN").c_str(); -const QString MAPS_HOST = util::getenv("MAPS_HOST", MAPBOX_TOKEN.isEmpty() ? "https://maps.comma.ai" : "https://api.mapbox.com").c_str(); -const QString MAPS_CACHE_PATH = "/data/mbgl-cache-navd.db"; - -QString get_mapbox_token(); -QMapLibre::Settings get_mapbox_settings(); -QGeoCoordinate to_QGeoCoordinate(const QMapLibre::Coordinate &in); -QMapLibre::CoordinatesCollections model_to_collection( - const cereal::LiveLocationKalman::Measurement::Reader &calibratedOrientationECEF, - const cereal::LiveLocationKalman::Measurement::Reader &positionECEF, - const cereal::XYZTData::Reader &line); -QMapLibre::CoordinatesCollections coordinate_to_collection(const QMapLibre::Coordinate &c); -QMapLibre::CoordinatesCollections capnp_coordinate_list_to_collection(const capnp::List::Reader &coordinate_list); -QMapLibre::CoordinatesCollections coordinate_list_to_collection(const QList &coordinate_list); -QList polyline_to_coordinate_list(const QString &polylineString); -std::optional coordinate_from_param(const std::string ¶m); -std::pair map_format_distance(float d, bool is_metric); diff --git a/selfdrive/ui/qt/maps/map_instructions.cc b/selfdrive/ui/qt/maps/map_instructions.cc deleted file mode 100644 index ba8cb356bd..0000000000 --- a/selfdrive/ui/qt/maps/map_instructions.cc +++ /dev/null @@ -1,144 +0,0 @@ -#include "selfdrive/ui/qt/maps/map_instructions.h" - -#include -#include - -#include "selfdrive/ui/qt/maps/map_helpers.h" -#include "selfdrive/ui/ui.h" - -const QString ICON_SUFFIX = ".png"; - -MapInstructions::MapInstructions(QWidget *parent) : QWidget(parent) { - is_rhd = Params().getBool("IsRhdDetected"); - QVBoxLayout *main_layout = new QVBoxLayout(this); - main_layout->setContentsMargins(11, UI_BORDER_SIZE, 11, 20); - - QHBoxLayout *top_layout = new QHBoxLayout; - top_layout->addWidget(icon_01 = new QLabel, 0, Qt::AlignTop); - - QVBoxLayout *right_layout = new QVBoxLayout; - right_layout->setContentsMargins(9, 9, 9, 0); - right_layout->addWidget(distance = new QLabel); - distance->setStyleSheet(R"(font-size: 90px;)"); - - right_layout->addWidget(primary = new QLabel); - primary->setStyleSheet(R"(font-size: 60px;)"); - primary->setWordWrap(true); - - right_layout->addWidget(secondary = new QLabel); - secondary->setStyleSheet(R"(font-size: 50px;)"); - secondary->setWordWrap(true); - - top_layout->addLayout(right_layout); - - main_layout->addLayout(top_layout); - main_layout->addLayout(lane_layout = new QHBoxLayout); - lane_layout->setAlignment(Qt::AlignHCenter); - lane_layout->setSpacing(10); - - setStyleSheet("color:white"); - QPalette pal = palette(); - pal.setColor(QPalette::Background, QColor(0, 0, 0, 150)); - setAutoFillBackground(true); - setPalette(pal); - - buildPixmapCache(); -} - -void MapInstructions::buildPixmapCache() { - QDir dir("../assets/navigation"); - for (QString fn : dir.entryList({"*" + ICON_SUFFIX}, QDir::Files)) { - QPixmap pm(dir.filePath(fn)); - QString key = fn.left(fn.size() - ICON_SUFFIX.length()); - pm = pm.scaledToWidth(200, Qt::SmoothTransformation); - - // Maneuver icons - pixmap_cache[key] = pm; - // lane direction icons - if (key.contains("turn_")) { - pixmap_cache["lane_" + key] = pm.scaled({125, 125}, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - } - - // for rhd, reflect direction and then flip - if (key.contains("_left")) { - pixmap_cache["rhd_" + key.replace("_left", "_right")] = pm.transformed(QTransform().scale(-1, 1)); - } else if (key.contains("_right")) { - pixmap_cache["rhd_" + key.replace("_right", "_left")] = pm.transformed(QTransform().scale(-1, 1)); - } - } -} - -void MapInstructions::updateInstructions(cereal::NavInstruction::Reader instruction) { - setUpdatesEnabled(false); - - // Show instruction text - QString primary_str = QString::fromStdString(instruction.getManeuverPrimaryText()); - QString secondary_str = QString::fromStdString(instruction.getManeuverSecondaryText()); - - primary->setText(primary_str); - secondary->setVisible(secondary_str.length() > 0); - secondary->setText(secondary_str); - - auto distance_str_pair = map_format_distance(instruction.getManeuverDistance(), uiState()->scene.is_metric); - distance->setText(QString("%1 %2").arg(distance_str_pair.first, distance_str_pair.second)); - - // Show arrow with direction - QString type = QString::fromStdString(instruction.getManeuverType()); - QString modifier = QString::fromStdString(instruction.getManeuverModifier()); - if (!type.isEmpty()) { - QString fn = "direction_" + type; - if (!modifier.isEmpty()) { - fn += "_" + modifier; - } - fn = fn.replace(' ', '_'); - bool rhd = is_rhd && (fn.contains("_left") || fn.contains("_right")); - icon_01->setPixmap(pixmap_cache[!rhd ? fn : "rhd_" + fn]); - icon_01->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); - icon_01->setVisible(true); - } else { - icon_01->setVisible(false); - } - - // Hide distance after arrival - distance->setVisible(type != "arrive" || instruction.getManeuverDistance() > 0); - - // Show lanes - auto lanes = instruction.getLanes(); - for (int i = 0; i < lanes.size(); ++i) { - bool active = lanes[i].getActive(); - const auto active_direction = lanes[i].getActiveDirection(); - - // TODO: Make more images based on active direction and combined directions - QString fn = "lane_direction_"; - - // active direction has precedence - if (active && active_direction != cereal::NavInstruction::Direction::NONE) { - fn += "turn_" + DIRECTIONS[active_direction]; - } else { - for (auto const &direction : lanes[i].getDirections()) { - if (direction != cereal::NavInstruction::Direction::NONE) { - fn += "turn_" + DIRECTIONS[direction]; - break; - } - } - } - - if (!active) { - fn += "_inactive"; - } - - QLabel *label = (i < lane_labels.size()) ? lane_labels[i] : lane_labels.emplace_back(new QLabel); - if (!label->parentWidget()) { - lane_layout->addWidget(label); - } - label->setPixmap(pixmap_cache[fn]); - label->setVisible(true); - } - - for (int i = lanes.size(); i < lane_labels.size(); ++i) { - lane_labels[i]->setVisible(false); - } - - setUpdatesEnabled(true); - setVisible(true); -} diff --git a/selfdrive/ui/qt/maps/map_instructions.h b/selfdrive/ui/qt/maps/map_instructions.h deleted file mode 100644 index 06a943d27f..0000000000 --- a/selfdrive/ui/qt/maps/map_instructions.h +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include -#include - -#include -#include -#include - -#include "cereal/gen/cpp/log.capnp.h" - -static std::map DIRECTIONS = { - {cereal::NavInstruction::Direction::NONE, "none"}, - {cereal::NavInstruction::Direction::LEFT, "left"}, - {cereal::NavInstruction::Direction::RIGHT, "right"}, - {cereal::NavInstruction::Direction::STRAIGHT, "straight"}, - {cereal::NavInstruction::Direction::SLIGHT_LEFT, "slight_left"}, - {cereal::NavInstruction::Direction::SLIGHT_RIGHT, "slight_right"}, -}; - -class MapInstructions : public QWidget { - Q_OBJECT - -private: - QLabel *distance; - QLabel *primary; - QLabel *secondary; - QLabel *icon_01; - QHBoxLayout *lane_layout; - bool is_rhd = false; - std::vector lane_labels; - QHash pixmap_cache; - -public: - MapInstructions(QWidget * parent=nullptr); - void buildPixmapCache(); - void updateInstructions(cereal::NavInstruction::Reader instruction); -}; diff --git a/selfdrive/ui/qt/maps/map_panel.cc b/selfdrive/ui/qt/maps/map_panel.cc deleted file mode 100644 index c4cc20e21d..0000000000 --- a/selfdrive/ui/qt/maps/map_panel.cc +++ /dev/null @@ -1,43 +0,0 @@ -#include "selfdrive/ui/qt/maps/map_panel.h" - -#include -#include - -#include "selfdrive/ui/qt/maps/map.h" -#include "selfdrive/ui/qt/maps/map_settings.h" -#include "selfdrive/ui/qt/util.h" -#include "selfdrive/ui/ui.h" - -MapPanel::MapPanel(const QMapLibre::Settings &mapboxSettings, QWidget *parent) : QFrame(parent) { - content_stack = new QStackedLayout(this); - content_stack->setContentsMargins(0, 0, 0, 0); - - auto map = new MapWindow(mapboxSettings); - QObject::connect(uiState(), &UIState::offroadTransition, map, &MapWindow::offroadTransition); - QObject::connect(device(), &Device::interactiveTimeout, this, [=]() { - content_stack->setCurrentIndex(0); - }); - QObject::connect(map, &MapWindow::requestVisible, this, [=](bool visible) { - // when we show the map for a new route, signal HomeWindow to hide the sidebar - if (visible) { emit mapPanelRequested(); } - setVisible(visible); - }); - QObject::connect(map, &MapWindow::requestSettings, this, [=](bool settings) { - content_stack->setCurrentIndex(settings ? 1 : 0); - }); - content_stack->addWidget(map); - - auto settings = new MapSettings(true, parent); - QObject::connect(settings, &MapSettings::closeSettings, this, [=]() { - content_stack->setCurrentIndex(0); - }); - content_stack->addWidget(settings); -} - -void MapPanel::toggleMapSettings() { - // show settings if not visible, then toggle between map and settings - int new_index = isVisible() ? (1 - content_stack->currentIndex()) : 1; - content_stack->setCurrentIndex(new_index); - emit mapPanelRequested(); - show(); -} diff --git a/selfdrive/ui/qt/maps/map_panel.h b/selfdrive/ui/qt/maps/map_panel.h deleted file mode 100644 index 190bb63446..0000000000 --- a/selfdrive/ui/qt/maps/map_panel.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include -#include -#include - -class MapPanel : public QFrame { - Q_OBJECT - -public: - explicit MapPanel(const QMapLibre::Settings &settings, QWidget *parent = nullptr); - -signals: - void mapPanelRequested(); - -public slots: - void toggleMapSettings(); - -private: - QStackedLayout *content_stack; -}; diff --git a/selfdrive/ui/qt/maps/map_settings.cc b/selfdrive/ui/qt/maps/map_settings.cc deleted file mode 100644 index 4d655be36c..0000000000 --- a/selfdrive/ui/qt/maps/map_settings.cc +++ /dev/null @@ -1,385 +0,0 @@ -#include "selfdrive/ui/qt/maps/map_settings.h" - -#include - -#include -#include - -#include "common/util.h" -#include "selfdrive/ui/qt/request_repeater.h" -#include "selfdrive/ui/qt/widgets/scrollview.h" - -static void swap(QJsonValueRef v1, QJsonValueRef v2) { std::swap(v1, v2); } - -static bool locationEqual(const QJsonValue &v1, const QJsonValue &v2) { - return v1["latitude"] == v2["latitude"] && v1["longitude"] == v2["longitude"]; -} - -static qint64 convertTimestampToEpoch(const QString ×tamp) { - QDateTime dt = QDateTime::fromString(timestamp, Qt::ISODate); - return dt.isValid() ? dt.toSecsSinceEpoch() : 0; -} - -MapSettings::MapSettings(bool closeable, QWidget *parent) : QFrame(parent) { - setContentsMargins(0, 0, 0, 0); - setAttribute(Qt::WA_NoMousePropagation); - - auto *frame = new QVBoxLayout(this); - frame->setContentsMargins(40, 40, 40, 0); - frame->setSpacing(0); - - auto *heading_frame = new QHBoxLayout; - heading_frame->setContentsMargins(0, 0, 0, 0); - heading_frame->setSpacing(32); - { - if (closeable) { - auto *close_btn = new QPushButton("←"); - close_btn->setStyleSheet(R"( - QPushButton { - color: #FFFFFF; - font-size: 100px; - padding-bottom: 8px; - border 1px grey solid; - border-radius: 70px; - background-color: #292929; - font-weight: 500; - } - QPushButton:pressed { - background-color: #3B3B3B; - } - )"); - close_btn->setFixedSize(140, 140); - QObject::connect(close_btn, &QPushButton::clicked, [=]() { emit closeSettings(); }); - // TODO: read map_on_left from ui state - heading_frame->addWidget(close_btn); - } - - auto *heading = new QVBoxLayout; - heading->setContentsMargins(0, 0, 0, 0); - heading->setSpacing(16); - { - auto *title = new QLabel(tr("NAVIGATION"), this); - title->setStyleSheet("color: #FFFFFF; font-size: 54px; font-weight: 600;"); - heading->addWidget(title); - - auto *subtitle = new QLabel(tr("Manage at connect.comma.ai"), this); - subtitle->setStyleSheet("color: #A0A0A0; font-size: 40px; font-weight: 300;"); - heading->addWidget(subtitle); - } - heading_frame->addLayout(heading, 1); - } - frame->addLayout(heading_frame); - frame->addSpacing(32); - - current_widget = new DestinationWidget(this); - QObject::connect(current_widget, &DestinationWidget::actionClicked, - []() { NavManager::instance()->setCurrentDestination({}); }); - frame->addWidget(current_widget); - frame->addSpacing(32); - - QWidget *destinations_container = new QWidget(this); - destinations_layout = new QVBoxLayout(destinations_container); - destinations_layout->setContentsMargins(0, 32, 0, 32); - destinations_layout->setSpacing(20); - destinations_layout->addWidget(home_widget = new DestinationWidget(this)); - destinations_layout->addWidget(work_widget = new DestinationWidget(this)); - QObject::connect(home_widget, &DestinationWidget::navigateTo, this, &MapSettings::navigateTo); - QObject::connect(work_widget, &DestinationWidget::navigateTo, this, &MapSettings::navigateTo); - destinations_layout->addStretch(); - - ScrollView *destinations_scroller = new ScrollView(destinations_container, this); - destinations_scroller->setFrameShape(QFrame::NoFrame); - frame->addWidget(destinations_scroller); - - setStyleSheet("MapSettings { background-color: #333333; }"); - QObject::connect(NavManager::instance(), &NavManager::updated, this, &MapSettings::refresh); -} - -void MapSettings::showEvent(QShowEvent *event) { - refresh(); -} - -void MapSettings::refresh() { - if (!isVisible()) return; - - setUpdatesEnabled(false); - - auto get_w = [this](int i) { - auto w = i < widgets.size() ? widgets[i] : widgets.emplace_back(new DestinationWidget); - if (!w->parentWidget()) { - destinations_layout->insertWidget(destinations_layout->count() - 1, w); - QObject::connect(w, &DestinationWidget::navigateTo, this, &MapSettings::navigateTo); - } - return w; - }; - - const auto current_dest = NavManager::instance()->currentDestination(); - if (!current_dest.isEmpty()) { - current_widget->set(current_dest, true); - } else { - current_widget->unset("", true); - } - home_widget->unset(NAV_FAVORITE_LABEL_HOME); - work_widget->unset(NAV_FAVORITE_LABEL_WORK); - - int n = 0; - for (auto location : NavManager::instance()->currentLocations()) { - DestinationWidget *w = nullptr; - auto dest = location.toObject(); - if (dest["save_type"].toString() == NAV_TYPE_FAVORITE) { - auto label = dest["label"].toString(); - if (label == NAV_FAVORITE_LABEL_HOME) w = home_widget; - if (label == NAV_FAVORITE_LABEL_WORK) w = work_widget; - } - w = w ? w : get_w(n++); - w->set(dest, false); - w->setVisible(!locationEqual(dest, current_dest)); - } - for (; n < widgets.size(); ++n) widgets[n]->setVisible(false); - - setUpdatesEnabled(true); -} - -void MapSettings::navigateTo(const QJsonObject &place) { - NavManager::instance()->setCurrentDestination(place); - emit closeSettings(); -} - -DestinationWidget::DestinationWidget(QWidget *parent) : QPushButton(parent) { - setContentsMargins(0, 0, 0, 0); - - auto *frame = new QHBoxLayout(this); - frame->setContentsMargins(32, 24, 32, 24); - frame->setSpacing(32); - - icon = new QLabel(this); - icon->setAlignment(Qt::AlignCenter); - icon->setFixedSize(96, 96); - icon->setObjectName("icon"); - frame->addWidget(icon); - - auto *inner_frame = new QVBoxLayout; - inner_frame->setContentsMargins(0, 0, 0, 0); - inner_frame->setSpacing(0); - { - title = new ElidedLabel(this); - title->setAttribute(Qt::WA_TransparentForMouseEvents); - inner_frame->addWidget(title); - - subtitle = new ElidedLabel(this); - subtitle->setAttribute(Qt::WA_TransparentForMouseEvents); - subtitle->setObjectName("subtitle"); - inner_frame->addWidget(subtitle); - } - frame->addLayout(inner_frame, 1); - - action = new QPushButton(this); - action->setFixedSize(96, 96); - action->setObjectName("action"); - action->setStyleSheet("font-size: 65px; font-weight: 600;"); - QObject::connect(action, &QPushButton::clicked, this, &QPushButton::clicked); - QObject::connect(action, &QPushButton::clicked, this, &DestinationWidget::actionClicked); - frame->addWidget(action); - - setFixedHeight(164); - setStyleSheet(R"( - DestinationWidget { background-color: #202123; border-radius: 10px; } - QLabel { color: #FFFFFF; font-size: 48px; font-weight: 400; } - #icon { background-color: #3B4356; border-radius: 48px; } - #subtitle { color: #9BA0A5; } - #action { border: none; border-radius: 48px; color: #FFFFFF; padding-bottom: 4px; } - - /* current destination */ - [current="true"] { background-color: #E8E8E8; } - [current="true"] QLabel { color: #000000; } - [current="true"] #icon { background-color: #42906B; } - [current="true"] #subtitle { color: #333333; } - [current="true"] #action { color: #202123; } - - /* no saved destination */ - [set="false"] QLabel { color: #9BA0A5; } - [current="true"][set="false"] QLabel { color: #A0000000; } - - /* pressed */ - [current="false"]:pressed { background-color: #18191B; } - [current="true"] #action:pressed { background-color: #D6D6D6; } - )"); - QObject::connect(this, &QPushButton::clicked, [this]() { if (!dest.isEmpty()) emit navigateTo(dest); }); -} - -void DestinationWidget::set(const QJsonObject &destination, bool current) { - if (dest == destination) return; - - dest = destination; - setProperty("current", current); - setProperty("set", true); - - auto icon_pixmap = current ? icons().directions : icons().recent; - auto title_text = destination["place_name"].toString(); - auto subtitle_text = destination["place_details"].toString(); - - if (destination["save_type"] == NAV_TYPE_FAVORITE) { - if (destination["label"] == NAV_FAVORITE_LABEL_HOME) { - icon_pixmap = icons().home; - subtitle_text = title_text + ", " + subtitle_text; - title_text = tr("Home"); - } else if (destination["label"] == NAV_FAVORITE_LABEL_WORK) { - icon_pixmap = icons().work; - subtitle_text = title_text + ", " + subtitle_text; - title_text = tr("Work"); - } else { - icon_pixmap = icons().favorite; - } - } - - icon->setPixmap(icon_pixmap); - - title->setText(title_text); - subtitle->setText(subtitle_text); - subtitle->setVisible(true); - - // TODO: use pixmap - action->setAttribute(Qt::WA_TransparentForMouseEvents, !current); - action->setText(current ? "×" : "→"); - action->setVisible(true); - - setStyleSheet(styleSheet()); -} - -void DestinationWidget::unset(const QString &label, bool current) { - dest = {}; - setProperty("current", current); - setProperty("set", false); - - if (label.isEmpty()) { - icon->setPixmap(icons().directions); - title->setText(tr("No destination set")); - } else { - QString title_text = label == NAV_FAVORITE_LABEL_HOME ? tr("home") : tr("work"); - icon->setPixmap(label == NAV_FAVORITE_LABEL_HOME ? icons().home : icons().work); - title->setText(tr("No %1 location set").arg(title_text)); - } - - subtitle->setVisible(false); - action->setVisible(false); - - setStyleSheet(styleSheet()); - setVisible(true); -} - -// singleton NavManager - -NavManager *NavManager::instance() { - static NavManager *request = new NavManager(qApp); - return request; -} - -NavManager::NavManager(QObject *parent) : QObject(parent) { - locations = QJsonDocument::fromJson(params.get("NavPastDestinations").c_str()).array(); - current_dest = QJsonDocument::fromJson(params.get("NavDestination").c_str()).object(); - if (auto dongle_id = getDongleId()) { - { - // Fetch favorite and recent locations - QString url = CommaApi::BASE_URL + "/v1/navigation/" + *dongle_id + "/locations"; - RequestRepeater *repeater = new RequestRepeater(this, url, "ApiCache_NavDestinations", 30, true); - QObject::connect(repeater, &RequestRepeater::requestDone, this, &NavManager::parseLocationsResponse); - } - { - auto param_watcher = new ParamWatcher(this); - QObject::connect(param_watcher, &ParamWatcher::paramChanged, this, &NavManager::updated); - - // Destination set while offline - QString url = CommaApi::BASE_URL + "/v1/navigation/" + *dongle_id + "/next"; - HttpRequest *deleter = new HttpRequest(this); - RequestRepeater *repeater = new RequestRepeater(this, url, "", 10, true); - QObject::connect(repeater, &RequestRepeater::requestDone, [=](const QString &resp, bool success) { - if (success && resp != "null") { - if (params.get("NavDestination").empty()) { - qWarning() << "Setting NavDestination from /next" << resp; - params.put("NavDestination", resp.toStdString()); - } else { - qWarning() << "Got location from /next, but NavDestination already set"; - } - // Send DELETE to clear destination server side - deleter->sendRequest(url, HttpRequest::Method::DELETE); - } - - // athena can set destination at any time - param_watcher->addParam("NavDestination"); - current_dest = QJsonDocument::fromJson(params.get("NavDestination").c_str()).object(); - emit updated(); - }); - } - } -} - -void NavManager::parseLocationsResponse(const QString &response, bool success) { - if (!success || response == prev_response) return; - - prev_response = response; - QJsonDocument doc = QJsonDocument::fromJson(response.trimmed().toUtf8()); - if (doc.isNull()) { - qWarning() << "JSON Parse failed on navigation locations" << response; - return; - } - - // set last activity time. - auto remote_locations = doc.array(); - for (QJsonValueRef loc : remote_locations) { - auto obj = loc.toObject(); - auto serverTime = convertTimestampToEpoch(obj["modified"].toString()); - obj.insert("time", qMax(serverTime, getLastActivity(obj))); - loc = obj; - } - - locations = remote_locations; - sortLocations(); - emit updated(); -} - -void NavManager::sortLocations() { - // Sort: alphabetical FAVORITES, and then most recent. - // We don't need to care about the ordering of HOME and WORK. DestinationWidget always displays them at the top. - std::stable_sort(locations.begin(), locations.end(), [](const QJsonValue &a, const QJsonValue &b) { - if (a["save_type"] == NAV_TYPE_FAVORITE || b["save_type"] == NAV_TYPE_FAVORITE) { - return (std::tuple(a["save_type"].toString(), a["place_name"].toString()) < - std::tuple(b["save_type"].toString(), b["place_name"].toString())); - } else { - return a["time"].toVariant().toLongLong() > b["time"].toVariant().toLongLong(); - } - }); - - write_param_future = std::async(std::launch::async, [destinations = QJsonArray(locations)]() { - Params().put("NavPastDestinations", QJsonDocument(destinations).toJson().toStdString()); - }); -} - -qint64 NavManager::getLastActivity(const QJsonObject &loc) const { - qint64 last_activity = 0; - auto it = std::find_if(locations.begin(), locations.end(), - [&loc](const QJsonValue &l) { return locationEqual(loc, l); }); - if (it != locations.end()) { - auto tm = it->toObject().value("time"); - if (!tm.isUndefined() && !tm.isNull()) { - last_activity = tm.toVariant().toLongLong(); - } - } - return last_activity; -} - -void NavManager::setCurrentDestination(const QJsonObject &loc) { - current_dest = loc; - if (!current_dest.isEmpty()) { - current_dest["time"] = QDateTime::currentSecsSinceEpoch(); - auto it = std::find_if(locations.begin(), locations.end(), - [&loc](const QJsonValue &l) { return locationEqual(loc, l); }); - if (it != locations.end()) { - *it = current_dest; - sortLocations(); - } - params.put("NavDestination", QJsonDocument(current_dest).toJson().toStdString()); - } else { - params.remove("NavDestination"); - } - emit updated(); -} diff --git a/selfdrive/ui/qt/maps/map_settings.h b/selfdrive/ui/qt/maps/map_settings.h deleted file mode 100644 index 0e151df4ad..0000000000 --- a/selfdrive/ui/qt/maps/map_settings.h +++ /dev/null @@ -1,102 +0,0 @@ -#pragma once - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "common/params.h" -#include "selfdrive/ui/qt/util.h" -#include "selfdrive/ui/qt/widgets/controls.h" - -const QString NAV_TYPE_FAVORITE = "favorite"; -const QString NAV_TYPE_RECENT = "recent"; - -const QString NAV_FAVORITE_LABEL_HOME = "home"; -const QString NAV_FAVORITE_LABEL_WORK = "work"; - -class DestinationWidget; - -class NavManager : public QObject { - Q_OBJECT - -public: - static NavManager *instance(); - QJsonArray currentLocations() const { return locations; } - QJsonObject currentDestination() const { return current_dest; } - void setCurrentDestination(const QJsonObject &loc); - qint64 getLastActivity(const QJsonObject &loc) const; - -signals: - void updated(); - -private: - NavManager(QObject *parent); - void parseLocationsResponse(const QString &response, bool success); - void sortLocations(); - - Params params; - QString prev_response; - QJsonArray locations; - QJsonObject current_dest; - std::future write_param_future; -}; - -class MapSettings : public QFrame { - Q_OBJECT -public: - explicit MapSettings(bool closeable = false, QWidget *parent = nullptr); - void navigateTo(const QJsonObject &place); - -private: - void showEvent(QShowEvent *event) override; - void refresh(); - - QVBoxLayout *destinations_layout; - DestinationWidget *current_widget; - DestinationWidget *home_widget; - DestinationWidget *work_widget; - std::vector widgets; - -signals: - void closeSettings(); -}; - -class DestinationWidget : public QPushButton { - Q_OBJECT -public: - explicit DestinationWidget(QWidget *parent = nullptr); - void set(const QJsonObject &location, bool current = false); - void unset(const QString &label, bool current = false); - -signals: - void actionClicked(); - void navigateTo(const QJsonObject &destination); - -private: - struct NavIcons { - QPixmap home, work, favorite, recent, directions; - }; - - static NavIcons icons() { - static NavIcons nav_icons { - loadPixmap("../assets/navigation/icon_home.svg", {48, 48}), - loadPixmap("../assets/navigation/icon_work.svg", {48, 48}), - loadPixmap("../assets/navigation/icon_favorite.svg", {48, 48}), - loadPixmap("../assets/navigation/icon_recent.svg", {48, 48}), - loadPixmap("../assets/navigation/icon_directions.svg", {48, 48}), - }; - return nav_icons; - } - -private: - QLabel *icon, *title, *subtitle; - QPushButton *action; - QJsonObject dest; -}; diff --git a/selfdrive/ui/qt/offroad/settings.cc b/selfdrive/ui/qt/offroad/settings.cc index 96fe6585cc..dc60d40e48 100644 --- a/selfdrive/ui/qt/offroad/settings.cc +++ b/selfdrive/ui/qt/offroad/settings.cc @@ -69,20 +69,6 @@ TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) { tr("Display speed in km/h instead of mph."), "../assets/offroad/icon_metric.png", }, -#ifdef ENABLE_MAPS - { - "NavSettingTime24h", - tr("Show ETA in 24h Format"), - tr("Use 24h format instead of am/pm"), - "../assets/offroad/icon_metric.png", - }, - { - "NavSettingLeftSide", - tr("Show Map on Left Side of UI"), - tr("Show map on left side when in split screen view."), - "../assets/offroad/icon_road.png", - }, -#endif }; diff --git a/selfdrive/ui/qt/onroad/annotated_camera.cc b/selfdrive/ui/qt/onroad/annotated_camera.cc index 241bb6ed34..07016ef94a 100644 --- a/selfdrive/ui/qt/onroad/annotated_camera.cc +++ b/selfdrive/ui/qt/onroad/annotated_camera.cc @@ -20,9 +20,6 @@ AnnotatedCameraWidget::AnnotatedCameraWidget(VisionStreamType type, QWidget* par experimental_btn = new ExperimentalButton(this); main_layout->addWidget(experimental_btn, 0, Qt::AlignTop | Qt::AlignRight); - map_settings_btn = new MapSettingsButton(this); - main_layout->addWidget(map_settings_btn, 0, Qt::AlignBottom | Qt::AlignRight); - dm_img = loadPixmap("../assets/img_driver_face.png", {img_size + 5, img_size + 5}); } @@ -70,12 +67,6 @@ void AnnotatedCameraWidget::updateState(const UIState &s) { rightHandDM = dm_state.getIsRHD(); // DM icon transition dm_fade_state = std::clamp(dm_fade_state+0.2*(0.5-dmActive), 0.0, 1.0); - - // hide map settings button for alerts and flip for right hand DM - if (map_settings_btn->isEnabled()) { - map_settings_btn->setVisible(!hideBottomIcons); - main_layout->setAlignment(map_settings_btn, (rightHandDM ? Qt::AlignLeft : Qt::AlignRight) | Qt::AlignBottom); - } } void AnnotatedCameraWidget::drawHud(QPainter &p) { diff --git a/selfdrive/ui/qt/onroad/annotated_camera.h b/selfdrive/ui/qt/onroad/annotated_camera.h index 0be4adfffa..1470b85f78 100644 --- a/selfdrive/ui/qt/onroad/annotated_camera.h +++ b/selfdrive/ui/qt/onroad/annotated_camera.h @@ -13,8 +13,6 @@ public: explicit AnnotatedCameraWidget(VisionStreamType type, QWidget* parent = 0); void updateState(const UIState &s); - MapSettingsButton *map_settings_btn; - private: void drawText(QPainter &p, int x, int y, const QString &text, int alpha = 255); diff --git a/selfdrive/ui/qt/onroad/buttons.cc b/selfdrive/ui/qt/onroad/buttons.cc index 75ec316174..92bcea11b5 100644 --- a/selfdrive/ui/qt/onroad/buttons.cc +++ b/selfdrive/ui/qt/onroad/buttons.cc @@ -47,18 +47,3 @@ void ExperimentalButton::paintEvent(QPaintEvent *event) { QPixmap img = experimental_mode ? experimental_img : engage_img; drawIcon(p, QPoint(btn_size / 2, btn_size / 2), img, QColor(0, 0, 0, 166), (isDown() || !engageable) ? 0.6 : 1.0); } - -// MapSettingsButton -MapSettingsButton::MapSettingsButton(QWidget *parent) : QPushButton(parent) { - setFixedSize(btn_size, btn_size); - settings_img = loadPixmap("../assets/navigation/icon_directions_outlined.svg", {img_size, img_size}); - - // hidden by default, made visible if map is created (has prime or mapbox token) - setVisible(false); - setEnabled(false); -} - -void MapSettingsButton::paintEvent(QPaintEvent *event) { - QPainter p(this); - drawIcon(p, QPoint(btn_size / 2, btn_size / 2), settings_img, QColor(0, 0, 0, 166), isDown() ? 0.6 : 1.0); -} diff --git a/selfdrive/ui/qt/onroad/buttons.h b/selfdrive/ui/qt/onroad/buttons.h index b0757795fb..9c91bc3c7b 100644 --- a/selfdrive/ui/qt/onroad/buttons.h +++ b/selfdrive/ui/qt/onroad/buttons.h @@ -25,17 +25,4 @@ private: bool engageable; }; - -class MapSettingsButton : public QPushButton { - Q_OBJECT - -public: - explicit MapSettingsButton(QWidget *parent = 0); - -private: - void paintEvent(QPaintEvent *event) override; - - QPixmap settings_img; -}; - void drawIcon(QPainter &p, const QPoint ¢er, const QPixmap &img, const QBrush &bg, float opacity); diff --git a/selfdrive/ui/qt/onroad/onroad_home.cc b/selfdrive/ui/qt/onroad/onroad_home.cc index 66eb1812e6..f8c7d80350 100644 --- a/selfdrive/ui/qt/onroad/onroad_home.cc +++ b/selfdrive/ui/qt/onroad/onroad_home.cc @@ -3,11 +3,6 @@ #include #include -#ifdef ENABLE_MAPS -#include "selfdrive/ui/qt/maps/map_helpers.h" -#include "selfdrive/ui/qt/maps/map_panel.h" -#endif - #include "selfdrive/ui/qt/util.h" OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent) { @@ -30,11 +25,6 @@ OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent) { split->insertWidget(0, arCam); } - if (getenv("MAP_RENDER_VIEW")) { - CameraWidget *map_render = new CameraWidget("navd", VISION_STREAM_MAP, false, this); - split->insertWidget(0, map_render); - } - stacked_layout->addWidget(split_wrapper); alerts = new OnroadAlerts(this); @@ -47,7 +37,6 @@ OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent) { setAttribute(Qt::WA_OpaquePaintEvent); QObject::connect(uiState(), &UIState::uiUpdate, this, &OnroadWindow::updateState); QObject::connect(uiState(), &UIState::offroadTransition, this, &OnroadWindow::offroadTransition); - QObject::connect(uiState(), &UIState::primeChanged, this, &OnroadWindow::primeChanged); } void OnroadWindow::updateState(const UIState &s) { @@ -73,56 +62,14 @@ void OnroadWindow::updateState(const UIState &s) { } void OnroadWindow::mousePressEvent(QMouseEvent* e) { -#ifdef ENABLE_MAPS - if (map != nullptr) { - bool sidebarVisible = geometry().x() > 0; - bool show_map = !sidebarVisible; - map->setVisible(show_map && !map->isVisible()); - } -#endif // propagation event to parent(HomeWindow) QWidget::mousePressEvent(e); } -void OnroadWindow::createMapWidget() { -#ifdef ENABLE_MAPS - auto m = new MapPanel(get_mapbox_settings()); - map = m; - QObject::connect(m, &MapPanel::mapPanelRequested, this, &OnroadWindow::mapPanelRequested); - QObject::connect(nvg->map_settings_btn, &MapSettingsButton::clicked, m, &MapPanel::toggleMapSettings); - nvg->map_settings_btn->setEnabled(true); - - m->setFixedWidth(topWidget(this)->width() / 2 - UI_BORDER_SIZE); - split->insertWidget(0, m); - // hidden by default, made visible when navRoute is published - m->setVisible(false); -#endif -} - void OnroadWindow::offroadTransition(bool offroad) { -#ifdef ENABLE_MAPS - if (!offroad) { - if (map == nullptr && (uiState()->hasPrime() || !MAPBOX_TOKEN.isEmpty())) { - createMapWidget(); - } - } -#endif alerts->clear(); } -void OnroadWindow::primeChanged(bool prime) { -#ifdef ENABLE_MAPS - if (map && (!prime && MAPBOX_TOKEN.isEmpty())) { - nvg->map_settings_btn->setEnabled(false); - nvg->map_settings_btn->setVisible(false); - map->deleteLater(); - map = nullptr; - } else if (!map && (prime || !MAPBOX_TOKEN.isEmpty())) { - createMapWidget(); - } -#endif -} - void OnroadWindow::paintEvent(QPaintEvent *event) { QPainter p(this); p.fillRect(rect(), QColor(bg.red(), bg.green(), bg.blue(), 255)); diff --git a/selfdrive/ui/qt/onroad/onroad_home.h b/selfdrive/ui/qt/onroad/onroad_home.h index 4976f56a67..e8fa19b046 100644 --- a/selfdrive/ui/qt/onroad/onroad_home.h +++ b/selfdrive/ui/qt/onroad/onroad_home.h @@ -26,6 +26,5 @@ private: private slots: void offroadTransition(bool offroad); - void primeChanged(bool prime); void updateState(const UIState &s); }; diff --git a/selfdrive/ui/qt/widgets/prime.cc b/selfdrive/ui/qt/widgets/prime.cc index 2621612f67..25712c26c7 100644 --- a/selfdrive/ui/qt/widgets/prime.cc +++ b/selfdrive/ui/qt/widgets/prime.cc @@ -155,7 +155,7 @@ PrimeAdWidget::PrimeAdWidget(QWidget* parent) : QFrame(parent) { main_layout->addWidget(features, 0, Qt::AlignBottom); main_layout->addSpacing(30); - QVector bullets = {tr("Remote access"), tr("24/7 LTE connectivity"), tr("1 year of drive storage"), tr("Turn-by-turn navigation")}; + QVector bullets = {tr("Remote access"), tr("24/7 LTE connectivity"), tr("1 year of drive storage"), tr("Remote snapshots")}; for (auto &b : bullets) { const QString check = " "; QLabel *l = new QLabel(check + b); @@ -225,9 +225,6 @@ SetupWidget::SetupWidget(QWidget* parent) : QFrame(parent) { content_layout->setContentsMargins(0, 0, 0, 0); content_layout->setSpacing(30); - primeUser = new PrimeUserWidget; - content_layout->addWidget(primeUser); - WiFiPromptWidget *wifi_prompt = new WiFiPromptWidget; QObject::connect(wifi_prompt, &WiFiPromptWidget::openSettings, this, &SetupWidget::openSettings); content_layout->addWidget(wifi_prompt); @@ -235,7 +232,6 @@ SetupWidget::SetupWidget(QWidget* parent) : QFrame(parent) { mainLayout->addWidget(content); - primeUser->setVisible(uiState()->hasPrime()); mainLayout->setCurrentIndex(1); setStyleSheet(R"( @@ -277,8 +273,6 @@ void SetupWidget::replyFinished(const QString &response, bool success) { mainLayout->setCurrentIndex(0); } else { popup->reject(); - - primeUser->setVisible(uiState()->hasPrime()); mainLayout->setCurrentIndex(1); } } diff --git a/selfdrive/ui/qt/widgets/prime.h b/selfdrive/ui/qt/widgets/prime.h index 63341c4cea..eac71bcddb 100644 --- a/selfdrive/ui/qt/widgets/prime.h +++ b/selfdrive/ui/qt/widgets/prime.h @@ -66,7 +66,6 @@ signals: private: PairingPopup *popup; QStackedWidget *mainLayout; - PrimeUserWidget *primeUser; private slots: void replyFinished(const QString &response, bool success); diff --git a/selfdrive/ui/translations/main_ar.ts b/selfdrive/ui/translations/main_ar.ts index d8146723a4..9925a2c7a9 100644 --- a/selfdrive/ui/translations/main_ar.ts +++ b/selfdrive/ui/translations/main_ar.ts @@ -136,33 +136,6 @@ رفض، إلغاء التثبيت %1 - - DestinationWidget - - Home - المنزل - - - Work - العمل - - - No destination set - لم يتم ضبط الوجهة - - - home - المنزل - - - work - العمل - - - No %1 location set - لم يتم ضبط %1 موقع - - DevicePanel @@ -349,47 +322,6 @@ جارٍ التثبيت... - - MapETA - - eta - الوصول - - - min - د - - - hr - س - - - - MapSettings - - NAVIGATION - التنقل - - - Manage at connect.comma.ai - الإدارة في connect.comma.ai - - - - MapWindow - - Map Loading - تحميل الخريطة - - - Waiting for GPS - بانتظار GPS - - - Waiting for route - بانتظار الطريق - - MultiOptionDialog @@ -568,8 +500,8 @@ سنة واحدة من تخزين القرص - Turn-by-turn navigation - التنقل خطوة بخطوة + Remote snapshots + @@ -630,22 +562,6 @@ منذ %n يوم - - km - كم - - - m - م - - - mi - ميل - - - ft - قدم - now الآن @@ -1090,22 +1006,6 @@ This may take up to a minute. When enabled, pressing the accelerator pedal will disengage openpilot. عند تمكين هذه الميزة، فإن الضغط على دواسة الوقود سيؤدي إلى فك ارتباط openpilot. - - Show ETA in 24h Format - إظهار الوقت المقدر للوصول بصيغة 24 ساعة - - - Use 24h format instead of am/pm - استخدام صيغة 24 ساعة بدلاً من صباحاً/مساء - - - Show Map on Left Side of UI - عرض الخريطة على الجانب الأيسر من واجهة المستخدم - - - Show map on left side when in split screen view. - عرض الخريطة عل الجانب الأيسر عندما تكون وضعية العرض بطريقة الشاشة المنقسمة. - openpilot Longitudinal Control (Alpha) التحكم الطولي openpilot (ألفا) diff --git a/selfdrive/ui/translations/main_de.ts b/selfdrive/ui/translations/main_de.ts index 010aa4d304..a4f9963d67 100644 --- a/selfdrive/ui/translations/main_de.ts +++ b/selfdrive/ui/translations/main_de.ts @@ -136,33 +136,6 @@ Ablehnen, deinstallieren %1 - - DestinationWidget - - Home - - - - Work - - - - No destination set - - - - No %1 location set - - - - home - - - - work - - - DevicePanel @@ -345,47 +318,6 @@ Installiere... - - MapETA - - eta - Ankunft - - - min - min - - - hr - std - - - - MapSettings - - NAVIGATION - - - - Manage at connect.comma.ai - - - - - MapWindow - - Map Loading - Karte wird geladen - - - Waiting for GPS - Warten auf GPS - - - Waiting for route - - - MultiOptionDialog @@ -559,11 +491,11 @@ - Turn-by-turn navigation + 1 year of drive storage - 1 year of drive storage + Remote snapshots @@ -613,22 +545,6 @@ vor %n Tagen - - km - km - - - m - m - - - mi - mi - - - ft - fuß - now @@ -1070,24 +986,6 @@ This may take up to a minute. When enabled, pressing the accelerator pedal will disengage openpilot. Wenn aktiviert, deaktiviert sich Openpilot sobald das Gaspedal betätigt wird. - - Use 24h format instead of am/pm - Benutze das 24Stunden Format anstatt am/pm - - - Show Map on Left Side of UI - Too long for UI - Zeige die Karte auf der linken Seite - - - Show map on left side when in split screen view. - Zeige die Karte auf der linken Seite der Benutzeroberfläche bei geteilten Bildschirm. - - - Show ETA in 24h Format - Too long for UI - Zeige die Ankunftszeit im 24 Stunden Format - Experimental Mode Experimenteller Modus diff --git a/selfdrive/ui/translations/main_fr.ts b/selfdrive/ui/translations/main_fr.ts index dde6adadd3..7f7c07d1bb 100644 --- a/selfdrive/ui/translations/main_fr.ts +++ b/selfdrive/ui/translations/main_fr.ts @@ -136,33 +136,6 @@ Refuser, désinstaller %1 - - DestinationWidget - - Home - Domicile - - - Work - Travail - - - No destination set - Aucune destination définie - - - home - domicile - - - work - travail - - - No %1 location set - Aucun lieu %1 défini - - DevicePanel @@ -345,47 +318,6 @@ Installation... - - MapETA - - eta - eta - - - min - min - - - hr - h - - - - MapSettings - - NAVIGATION - NAVIGATION - - - Manage at connect.comma.ai - Gérer sur connect.comma.ai - - - - MapWindow - - Map Loading - Chargement de la carte - - - Waiting for GPS - En attente du GPS - - - Waiting for route - En attente d'un trajet - - MultiOptionDialog @@ -564,8 +496,8 @@ 1 an de stockage de trajets - Turn-by-turn navigation - Navigation étape par étape + Remote snapshots + @@ -614,22 +546,6 @@ il y a %n jours - - km - km - - - m - m - - - mi - mi - - - ft - ft - now @@ -1090,22 +1006,6 @@ Cela peut prendre jusqu'à une minute. Display speed in km/h instead of mph. Afficher la vitesse en km/h au lieu de mph. - - Show ETA in 24h Format - Afficher l'heure d'arrivée en format 24h - - - Use 24h format instead of am/pm - Utiliser le format 24h plutôt que am/pm - - - Show Map on Left Side of UI - Afficher la carte à gauche de l'interface - - - Show map on left side when in split screen view. - Afficher la carte à gauche en mode écran scindé. - Aggressive Aggressif diff --git a/selfdrive/ui/translations/main_ja.ts b/selfdrive/ui/translations/main_ja.ts index e0fb60620b..39b018cfba 100644 --- a/selfdrive/ui/translations/main_ja.ts +++ b/selfdrive/ui/translations/main_ja.ts @@ -136,33 +136,6 @@ 拒否して %1 をアンインストール - - DestinationWidget - - Home - - - - Work - - - - No destination set - - - - No %1 location set - - - - home - - - - work - - - DevicePanel @@ -344,47 +317,6 @@ インストールしています... - - MapETA - - eta - 到着予定時間 - - - min - - - - hr - 時間 - - - - MapSettings - - NAVIGATION - - - - Manage at connect.comma.ai - - - - - MapWindow - - Map Loading - マップを読み込んでいます - - - Waiting for GPS - GPS信号を探しています - - - Waiting for route - - - MultiOptionDialog @@ -558,11 +490,11 @@ - Turn-by-turn navigation + 1 year of drive storage - 1 year of drive storage + Remote snapshots @@ -609,22 +541,6 @@ %n 日前 - - km - キロメートル - - - m - メートル - - - mi - マイル - - - ft - フィート - now @@ -1068,22 +984,6 @@ This may take up to a minute. When enabled, pressing the accelerator pedal will disengage openpilot. この機能を有効化すると、openpilotを利用中にアクセルを踏むとopenpilotによる運転サポートを中断します。 - - Show ETA in 24h Format - 24時間表示 - - - Use 24h format instead of am/pm - AM/PM の代わりに24時間形式を使用します - - - Show Map on Left Side of UI - ディスプレイの左側にマップを表示 - - - Show map on left side when in split screen view. - 分割画面表示の場合、ディスプレイの左側にマップを表示します。 - Experimental Mode 実験モード diff --git a/selfdrive/ui/translations/main_ko.ts b/selfdrive/ui/translations/main_ko.ts index 56fc5014ee..36247a6197 100644 --- a/selfdrive/ui/translations/main_ko.ts +++ b/selfdrive/ui/translations/main_ko.ts @@ -136,33 +136,6 @@ 거절, %1 제거 - - DestinationWidget - - Home - - - - Work - 회사 - - - No destination set - 목적지가 설정되지 않았습니다 - - - No %1 location set - %1 위치가 설정되지 않았습니다 - - - home - - - - work - 회사 - - DevicePanel @@ -344,47 +317,6 @@ 설치 중... - - MapETA - - eta - 도착 - - - min - - - - hr - 시간 - - - - MapSettings - - NAVIGATION - 내비게이션 - - - Manage at connect.comma.ai - connect.comma.ai에서 관리하세요 - - - - MapWindow - - Map Loading - 지도 로딩 중 - - - Waiting for GPS - GPS 수신 중 - - - Waiting for route - 경로를 기다리는 중 - - MultiOptionDialog @@ -558,14 +490,14 @@ 24/7 LTE connectivity 항상 LTE 연결 - - Turn-by-turn navigation - 내비게이션 경로안내 - 1 year of drive storage 1년간 드라이브 로그 저장 + + Remote snapshots + + PrimeUserWidget @@ -610,22 +542,6 @@ %n 일 전 - - km - km - - - m - m - - - mi - mi - - - ft - ft - now now @@ -1070,22 +986,6 @@ This may take up to a minute. When enabled, pressing the accelerator pedal will disengage openpilot. 활성화된 경우 가속 페달을 밟으면 openpilot이 해제됩니다. - - Show ETA in 24h Format - 24시간 형식으로 도착 예정 시간 표시 - - - Use 24h format instead of am/pm - 오전/오후 대신 24시간 형식 사용 - - - Show Map on Left Side of UI - UI 왼쪽에 지도 표시 - - - Show map on left side when in split screen view. - 분할 화면 보기에서 지도를 왼쪽에 표시합니다. - Experimental Mode 실험 모드 diff --git a/selfdrive/ui/translations/main_pt-BR.ts b/selfdrive/ui/translations/main_pt-BR.ts index feaa6e86a1..8a71612e3a 100644 --- a/selfdrive/ui/translations/main_pt-BR.ts +++ b/selfdrive/ui/translations/main_pt-BR.ts @@ -136,33 +136,6 @@ Rejeitar, desintalar %1 - - DestinationWidget - - Home - Casa - - - Work - Trabalho - - - No destination set - Nenhum destino definido - - - No %1 location set - Endereço de %1 não definido - - - home - casa - - - work - trabalho - - DevicePanel @@ -345,47 +318,6 @@ Instalando... - - MapETA - - eta - eta - - - min - min - - - hr - hr - - - - MapSettings - - NAVIGATION - NAVEGAÇÃO - - - Manage at connect.comma.ai - Gerencie em connect.comma.ai - - - - MapWindow - - Map Loading - Carregando Mapa - - - Waiting for GPS - Aguardando GPS - - - Waiting for route - Aguardando rota - - MultiOptionDialog @@ -559,14 +491,14 @@ 24/7 LTE connectivity Conectividade LTE (só nos EUA) - - Turn-by-turn navigation - Navegação passo a passo - 1 year of drive storage 1 ano de dados em nuvem + + Remote snapshots + + PrimeUserWidget @@ -614,22 +546,6 @@ há %n dias - - km - km - - - m - m - - - mi - milha - - - ft - pés - now agora @@ -1074,22 +990,6 @@ Isso pode levar até um minuto. When enabled, pressing the accelerator pedal will disengage openpilot. Quando ativado, pressionar o pedal do acelerador desacionará o openpilot. - - Show ETA in 24h Format - Mostrar ETA em Formato 24h - - - Use 24h format instead of am/pm - Use o formato 24h em vez de am/pm - - - Show Map on Left Side of UI - Exibir Mapa no Lado Esquerdo - - - Show map on left side when in split screen view. - Exibir mapa do lado esquerdo quando a tela for dividida. - Experimental Mode Modo Experimental diff --git a/selfdrive/ui/translations/main_th.ts b/selfdrive/ui/translations/main_th.ts index e594a6975f..d4a33398be 100644 --- a/selfdrive/ui/translations/main_th.ts +++ b/selfdrive/ui/translations/main_th.ts @@ -136,33 +136,6 @@ ปฏิเสธ และถอนการติดตั้ง %1 - - DestinationWidget - - Home - บ้าน - - - Work - ที่ทำงาน - - - No destination set - ยังไม่ได้เลือกจุดหมาย - - - home - บ้าน - - - work - ที่ทำงาน - - - No %1 location set - ยังไม่ได้เลือกตำแหน่ง%1 - - DevicePanel @@ -344,47 +317,6 @@ กำลังติดตั้ง... - - MapETA - - eta - eta - - - min - นาที - - - hr - ชม. - - - - MapSettings - - NAVIGATION - การนำทาง - - - Manage at connect.comma.ai - จัดการได้ที่ connect.comma.ai - - - - MapWindow - - Map Loading - กำลังโหลดแผนที่ - - - Waiting for GPS - กำลังรอสัญญาณ GPS - - - Waiting for route - กำลังรอเส้นทาง - - MultiOptionDialog @@ -563,8 +495,8 @@ จัดเก็บข้อมูลการขับขี่นาน 1 ปี - Turn-by-turn navigation - การนำทางแบบเลี้ยวต่อเลี้ยว + Remote snapshots + @@ -610,22 +542,6 @@ %n วันที่แล้ว - - km - กม. - - - m - ม. - - - mi - ไมล์ - - - ft - ฟุต - now ตอนนี้ @@ -1070,22 +986,6 @@ This may take up to a minute. When enabled, pressing the accelerator pedal will disengage openpilot. เมื่อเปิดใช้งาน การกดแป้นคันเร่งจะเป็นการยกเลิกระบบช่วยขับโดย openpilot - - Show ETA in 24h Format - แสดงเวลา ETA ในรูปแบบ 24 ชั่วโมง - - - Use 24h format instead of am/pm - ใช้รูปแบบเวลา 24 ชั่วโมง แทน am/pm - - - Show Map on Left Side of UI - แสดงแผนที่ที่ด้านซ้ายของหน้าจอ - - - Show map on left side when in split screen view. - แสดงแผนที่ด้านซ้ายของหน้าจอเมื่ออยู่ในโหมดแบ่งหน้าจอ - Experimental Mode โหมดทดลอง diff --git a/selfdrive/ui/translations/main_tr.ts b/selfdrive/ui/translations/main_tr.ts index 48615f1699..36d11dbe61 100644 --- a/selfdrive/ui/translations/main_tr.ts +++ b/selfdrive/ui/translations/main_tr.ts @@ -136,33 +136,6 @@ Reddet, Kurulumu kaldır. %1 - - DestinationWidget - - Home - - - - Work - - - - No destination set - - - - home - - - - work - - - - No %1 location set - - - DevicePanel @@ -344,47 +317,6 @@ Yükleniyor... - - MapETA - - eta - tahmini varış süresi - - - min - dk - - - hr - saat - - - - MapSettings - - NAVIGATION - - - - Manage at connect.comma.ai - - - - - MapWindow - - Map Loading - Harita yükleniyor - - - Waiting for GPS - GPS verisi bekleniyor... - - - Waiting for route - - - MultiOptionDialog @@ -562,7 +494,7 @@ - Turn-by-turn navigation + Remote snapshots @@ -609,22 +541,6 @@ %n gün önce - - km - km - - - m - m - - - mi - mil - - - ft - ft - now @@ -1064,22 +980,6 @@ This may take up to a minute. When enabled, pressing the accelerator pedal will disengage openpilot. Aktifleştirilirse eğer gaz pedalına basınca openpilot devre dışı kalır. - - Show ETA in 24h Format - Tahmini varış süresini 24 saat formatı şeklinde göster - - - Use 24h format instead of am/pm - 24 saat formatını kullan - - - Show Map on Left Side of UI - Haritayı arayüzün sol tarafında göster - - - Show map on left side when in split screen view. - Bölünmüş ekran görünümündeyken haritayı sol tarafta göster. - openpilot Longitudinal Control (Alpha) diff --git a/selfdrive/ui/translations/main_zh-CHS.ts b/selfdrive/ui/translations/main_zh-CHS.ts index 32119ee10f..79a6e95501 100644 --- a/selfdrive/ui/translations/main_zh-CHS.ts +++ b/selfdrive/ui/translations/main_zh-CHS.ts @@ -136,33 +136,6 @@ 拒绝并卸载%1 - - DestinationWidget - - Home - 住家 - - - Work - 工作 - - - No destination set - 尚未设置目的地 - - - No %1 location set - 尚未设置 %1 的位置 - - - home - 住家 - - - work - 工作 - - DevicePanel @@ -344,47 +317,6 @@ 正在安装…… - - MapETA - - eta - 抵达 - - - min - 分钟 - - - hr - 小时 - - - - MapSettings - - NAVIGATION - 导航 - - - Manage at connect.comma.ai - 请在 connect.comma.ai 上管理 - - - - MapWindow - - Map Loading - 地图加载中 - - - Waiting for GPS - 等待 GPS - - - Waiting for route - 等待路线 - - MultiOptionDialog @@ -558,14 +490,14 @@ 24/7 LTE connectivity 全天候 LTE 連線 - - Turn-by-turn navigation - 领航功能 - 1 year of drive storage 一年的行驶记录储存空间 + + Remote snapshots + + PrimeUserWidget @@ -610,22 +542,6 @@ %n 天前 - - km - km - - - m - m - - - mi - mi - - - ft - ft - now 现在 @@ -1070,22 +986,6 @@ This may take up to a minute. When enabled, pressing the accelerator pedal will disengage openpilot. 启用后,踩下油门踏板将取消openpilot。 - - Show ETA in 24h Format - 以24小时格式显示预计到达时间 - - - Use 24h format instead of am/pm - 使用24小时制代替am/pm - - - Show Map on Left Side of UI - 在介面左侧显示地图 - - - Show map on left side when in split screen view. - 在分屏模式中,将地图置于屏幕左侧。 - Experimental Mode 测试模式 diff --git a/selfdrive/ui/translations/main_zh-CHT.ts b/selfdrive/ui/translations/main_zh-CHT.ts index 9d1c16db9f..ec6131892e 100644 --- a/selfdrive/ui/translations/main_zh-CHT.ts +++ b/selfdrive/ui/translations/main_zh-CHT.ts @@ -136,33 +136,6 @@ 拒絕並解除安裝 %1 - - DestinationWidget - - Home - 住家 - - - Work - 工作 - - - No destination set - 尚未設定目的地 - - - No %1 location set - 尚未設定 %1 的位置 - - - home - 住家 - - - work - 工作 - - DevicePanel @@ -344,47 +317,6 @@ 安裝中… - - MapETA - - eta - 抵達 - - - min - 分鐘 - - - hr - 小時 - - - - MapSettings - - NAVIGATION - 導航 - - - Manage at connect.comma.ai - 請在 connect.comma.ai 上管理 - - - - MapWindow - - Map Loading - 地圖載入中 - - - Waiting for GPS - 等待 GPS - - - Waiting for route - 等待路線 - - MultiOptionDialog @@ -558,14 +490,14 @@ 24/7 LTE connectivity 24/7 LTE 連線 - - Turn-by-turn navigation - 導航功能 - 1 year of drive storage 一年的行駛記錄儲存空間 + + Remote snapshots + + PrimeUserWidget @@ -610,22 +542,6 @@ %n 天前 - - km - km - - - m - m - - - mi - mi - - - ft - ft - now 現在 @@ -1070,22 +986,6 @@ This may take up to a minute. When enabled, pressing the accelerator pedal will disengage openpilot. 啟用後,踩踏油門將會取消 openpilot 控制。 - - Show ETA in 24h Format - 預計到達時間單位改用 24 小時制 - - - Use 24h format instead of am/pm - 使用 24 小時制。(預設值為 12 小時制) - - - Show Map on Left Side of UI - 將地圖顯示在畫面的左側 - - - Show map on left side when in split screen view. - 進入分割畫面後,地圖將會顯示在畫面的左側。 - Experimental Mode 實驗模式 diff --git a/selfdrive/ui/ui.cc b/selfdrive/ui/ui.cc index 06b8b13bc1..2b415b1197 100644 --- a/selfdrive/ui/ui.cc +++ b/selfdrive/ui/ui.cc @@ -265,6 +265,10 @@ void UIState::update() { update_state(this); updateStatus(); + if (std::getenv("PRIME_TYPE")) { + setPrimeType((PrimeType)atoi(std::getenv("PRIME_TYPE"))); + } + if (sm->frame % UI_FREQ == 0) { watchdog_kick(nanos_since_boot()); } diff --git a/selfdrive/ui/watch3.cc b/selfdrive/ui/watch3.cc index ec35c29b6b..c14e03aa6e 100644 --- a/selfdrive/ui/watch3.cc +++ b/selfdrive/ui/watch3.cc @@ -19,7 +19,6 @@ int main(int argc, char *argv[]) { { QHBoxLayout *hlayout = new QHBoxLayout(); layout->addLayout(hlayout); - hlayout->addWidget(new CameraWidget("navd", VISION_STREAM_MAP, false)); hlayout->addWidget(new CameraWidget("camerad", VISION_STREAM_ROAD, false)); } diff --git a/system/athena/athenad.py b/system/athena/athenad.py index 9eec7a931b..9769f065f6 100755 --- a/system/athena/athenad.py +++ b/system/athena/athenad.py @@ -328,19 +328,6 @@ def getVersion() -> dict[str, str]: } -@dispatcher.add_method -def setNavDestination(latitude: int = 0, longitude: int = 0, place_name: str = None, place_details: str = None) -> dict[str, int]: - destination = { - "latitude": latitude, - "longitude": longitude, - "place_name": place_name, - "place_details": place_details, - } - Params().put("NavDestination", json.dumps(destination)) - - return {"success": 1} - - def scan_dir(path: str, prefix: str) -> list[str]: files = [] # only walk directories that match the prefix diff --git a/system/manager/process_config.py b/system/manager/process_config.py index ced31077c9..791d26a8f4 100644 --- a/system/manager/process_config.py +++ b/system/manager/process_config.py @@ -69,7 +69,6 @@ procs = [ PythonProcess("dmonitoringd", "selfdrive.monitoring.dmonitoringd", driverview, enabled=(not PC or WEBCAM)), PythonProcess("qcomgpsd", "system.qcomgpsd.qcomgpsd", qcomgps, enabled=TICI), #PythonProcess("ugpsd", "system.ugpsd", only_onroad, enabled=TICI), - PythonProcess("navd", "selfdrive.navd.navd", only_onroad), PythonProcess("pandad", "selfdrive.pandad.pandad", always_run), PythonProcess("paramsd", "selfdrive.locationd.paramsd", only_onroad), NativeProcess("ubloxd", "system/ubloxd", ["./ubloxd"], ublox, enabled=TICI), diff --git a/third_party/maplibre-native-qt/.gitignore b/third_party/maplibre-native-qt/.gitignore deleted file mode 100644 index 9adc6681c0..0000000000 --- a/third_party/maplibre-native-qt/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/maplibre/ diff --git a/third_party/maplibre-native-qt/aarch64 b/third_party/maplibre-native-qt/aarch64 deleted file mode 120000 index 062c65e8d9..0000000000 --- a/third_party/maplibre-native-qt/aarch64 +++ /dev/null @@ -1 +0,0 @@ -larch64/ \ No newline at end of file diff --git a/third_party/maplibre-native-qt/build.sh b/third_party/maplibre-native-qt/build.sh deleted file mode 100755 index a368026f0f..0000000000 --- a/third_party/maplibre-native-qt/build.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -set -e - -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" - -ARCHNAME=$(uname -m) -MAPLIBRE_FLAGS="-DMLN_QT_WITH_LOCATION=OFF" -if [ -f /TICI ]; then - ARCHNAME="larch64" - #MAPLIBRE_FLAGS="$MAPLIBRE_FLAGS -DCMAKE_SYSTEM_NAME=Android -DANDROID_ABI=arm64-v8a" -fi - -cd $DIR -if [ ! -d maplibre ]; then - git clone --single-branch https://github.com/maplibre/maplibre-native-qt.git $DIR/maplibre -fi - -cd maplibre -git checkout 3726266e127c1f94ad64837c9dbe03d238255816 -git submodule update --depth=1 --recursive --init - -# build -mkdir -p build -cd build -cmake $MAPLIBRE_FLAGS $DIR/maplibre -make -j$(nproc) - -INSTALL_DIR="$DIR/$ARCHNAME" -rm -rf $INSTALL_DIR -mkdir -p $INSTALL_DIR - -rm -rf $DIR/include -mkdir -p $INSTALL_DIR/lib $INSTALL_DIR/include $DIR/include -cp -r $DIR/maplibre/build/src/core/*.so* $INSTALL_DIR/lib -cp -r $DIR/maplibre/build/src/core/include/* $INSTALL_DIR/include -cp -r $DIR/maplibre/src/**/*.hpp $DIR/include diff --git a/third_party/maplibre-native-qt/include/conversion_p.hpp b/third_party/maplibre-native-qt/include/conversion_p.hpp deleted file mode 100644 index 38b03d498e..0000000000 --- a/third_party/maplibre-native-qt/include/conversion_p.hpp +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors -// Copyright (C) 2018 Mapbox, Inc. - -// SPDX-License-Identifier: BSD-2-Clause - -#pragma once - -#include "geojson_p.hpp" -#include "types.hpp" - -#include -#include - -#include -#include - -#include - -namespace mbgl::style::conversion { - -std::string convertColor(const QColor &color); - -template <> -class ConversionTraits { -public: - static bool isUndefined(const QVariant &value) { return value.isNull() || !value.isValid(); } - - static bool isArray(const QVariant &value) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - return QMetaType::canConvert(value.metaType(), QMetaType(QMetaType::QVariantList)); -#else - return value.canConvert(QVariant::List); -#endif - } - - static std::size_t arrayLength(const QVariant &value) { return value.toList().size(); } - - static QVariant arrayMember(const QVariant &value, std::size_t i) { return value.toList()[static_cast(i)]; } - - static bool isObject(const QVariant &value) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - return QMetaType::canConvert(value.metaType(), QMetaType(QMetaType::QVariantMap)) || - value.typeId() == QMetaType::QByteArray -#else - return value.canConvert(QVariant::Map) || value.type() == QVariant::ByteArray -#endif - || QString(value.typeName()) == QStringLiteral("QMapLibre::Feature") || - value.userType() == qMetaTypeId>() || - value.userType() == qMetaTypeId>() || - value.userType() == qMetaTypeId>(); - } - - static std::optional objectMember(const QVariant &value, const char *key) { - auto map = value.toMap(); - auto iter = map.constFind(key); - - if (iter != map.constEnd()) { - return iter.value(); - } - - return {}; - } - - template - static std::optional eachMember(const QVariant &value, Fn &&fn) { - auto map = value.toMap(); - auto iter = map.constBegin(); - - while (iter != map.constEnd()) { - std::optional result = fn(iter.key().toStdString(), QVariant(iter.value())); - if (result) { - return result; - } - - ++iter; - } - - return {}; - } - - static std::optional toBool(const QVariant &value) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - if (value.typeId() == QMetaType::Bool) { -#else - if (value.type() == QVariant::Bool) { -#endif - return value.toBool(); - } - - return {}; - } - - static std::optional toNumber(const QVariant &value) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - if (value.typeId() == QMetaType::Int || value.typeId() == QMetaType::Double || - value.typeId() == QMetaType::Long || value.typeId() == QMetaType::LongLong || - value.typeId() == QMetaType::ULong || value.typeId() == QMetaType::ULongLong) { -#else - if (value.type() == QVariant::Int || value.type() == QVariant::Double || value.type() == QVariant::LongLong || - value.type() == QVariant::ULongLong) { -#endif - return value.toFloat(); - } - - return {}; - } - - static std::optional toDouble(const QVariant &value) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - if (value.typeId() == QMetaType::Int || value.typeId() == QMetaType::Double || - value.typeId() == QMetaType::Long || value.typeId() == QMetaType::LongLong || - value.typeId() == QMetaType::ULong || value.typeId() == QMetaType::ULongLong) { -#else - if (value.type() == QVariant::Int || value.type() == QVariant::Double || value.type() == QVariant::LongLong || - value.type() == QVariant::ULongLong) { -#endif - return value.toDouble(); - } - - return {}; - } - - static std::optional toString(const QVariant &value) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - if (value.typeId() == QMetaType::QString) { - return value.toString().toStdString(); - } - - if (value.typeId() == QMetaType::QColor) { - return convertColor(value.value()); - } -#else - if (value.type() == QVariant::String) { - return value.toString().toStdString(); - } - - if (value.type() == QVariant::Color) { - return convertColor(value.value()); - } -#endif - return {}; - } - - static std::optional toValue(const QVariant &value) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - if (value.typeId() == QMetaType::Bool) { - return {value.toBool()}; - } - - if (value.typeId() == QMetaType::QString) { - return {value.toString().toStdString()}; - } - - if (value.typeId() == QMetaType::QColor) { - return {convertColor(value.value())}; - } - - if (value.typeId() == QMetaType::Int) { - return {static_cast(value.toInt())}; - } - - if (QMetaType::canConvert(value.metaType(), QMetaType(QMetaType::Double))) { - return {value.toDouble()}; - } -#else - if (value.type() == QVariant::Bool) { - return {value.toBool()}; - } - - if (value.type() == QVariant::String) { - return {value.toString().toStdString()}; - } - - if (value.type() == QVariant::Color) { - return {convertColor(value.value())}; - } - - if (value.type() == QVariant::Int) { - return {static_cast(value.toInt())}; - } - - if (value.canConvert(QVariant::Double)) { - return {value.toDouble()}; - } -#endif - return {}; - } - - static std::optional toGeoJSON(const QVariant &value, Error &error) { - if (value.typeName() == QStringLiteral("QMapLibre::Feature")) { - return GeoJSON{QMapLibre::GeoJSON::asFeature(value.value())}; - } - - if (value.userType() == qMetaTypeId>()) { - return featureCollectionToGeoJSON(value.value>()); - } - - if (value.userType() == qMetaTypeId>()) { - return featureCollectionToGeoJSON(value.value>()); - } - - if (value.userType() == qMetaTypeId>()) { - return featureCollectionToGeoJSON(value.value>()); - } - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - if (value.typeId() != QMetaType::QByteArray) { -#else - if (value.type() != QVariant::ByteArray) { -#endif - error = {"JSON data must be in QByteArray"}; - return {}; - } - - const QByteArray data = value.toByteArray(); - return parseGeoJSON(std::string(data.constData(), data.size()), error); - } - -private: - template - static GeoJSON featureCollectionToGeoJSON(const T &features) { - mapbox::feature::feature_collection collection; - collection.reserve(static_cast(features.size())); - for (const auto &feature : features) { - collection.push_back(QMapLibre::GeoJSON::asFeature(feature)); - } - return GeoJSON{std::move(collection)}; - } -}; - -template -std::optional convert(const QVariant &value, Error &error, Args &&...args) { - return convert(Convertible(value), error, std::forward(args)...); -} - -inline std::string convertColor(const QColor &color) { - return QString::asprintf("rgba(%d,%d,%d,%lf)", color.red(), color.green(), color.blue(), color.alphaF()) - .toStdString(); -} - -} // namespace mbgl::style::conversion diff --git a/third_party/maplibre-native-qt/include/export_core.hpp b/third_party/maplibre-native-qt/include/export_core.hpp deleted file mode 100644 index bd5ad495db..0000000000 --- a/third_party/maplibre-native-qt/include/export_core.hpp +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors - -// SPDX-License-Identifier: BSD-2-Clause - -#ifndef QMAPLIBRE_CORE_EXPORT_H -#define QMAPLIBRE_CORE_EXPORT_H - -#include - -#if !defined(QT_MAPLIBRE_STATIC) -#if defined(QT_BUILD_MAPLIBRE_CORE_LIB) -#define Q_MAPLIBRE_CORE_EXPORT Q_DECL_EXPORT -#else -#define Q_MAPLIBRE_CORE_EXPORT Q_DECL_IMPORT -#endif -#else -#define Q_MAPLIBRE_CORE_EXPORT -#endif - -#endif // QMAPLIBRE_CORE_EXPORT_H diff --git a/third_party/maplibre-native-qt/include/export_location.hpp b/third_party/maplibre-native-qt/include/export_location.hpp deleted file mode 100644 index a986346884..0000000000 --- a/third_party/maplibre-native-qt/include/export_location.hpp +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors - -// SPDX-License-Identifier: BSD-2-Clause - -#ifndef QMAPLIBRE_LOCATION_EXPORT_H -#define QMAPLIBRE_LOCATION_EXPORT_H - -#include - -#if !defined(QT_MAPLIBRE_STATIC) -#if defined(QT_BUILD_MAPLIBRE_LOCATION_LIB) -#define Q_MAPLIBRE_LOCATION_EXPORT Q_DECL_EXPORT -#else -#define Q_MAPLIBRE_LOCATION_EXPORT Q_DECL_IMPORT -#endif -#else -#define Q_MAPLIBRE_LOCATION_EXPORT -#endif - -#endif // QMAPLIBRE_LOCATION_EXPORT_H diff --git a/third_party/maplibre-native-qt/include/export_widgets.hpp b/third_party/maplibre-native-qt/include/export_widgets.hpp deleted file mode 100644 index 11bc288190..0000000000 --- a/third_party/maplibre-native-qt/include/export_widgets.hpp +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors - -// SPDX-License-Identifier: BSD-2-Clause - -#ifndef QMAPLIBRE_WIDGETS_EXPORT_H -#define QMAPLIBRE_WIDGETS_EXPORT_H - -#include - -#if !defined(QT_MAPLIBRE_STATIC) -#if defined(QT_BUILD_MAPLIBRE_WIDGETS_LIB) -#define Q_MAPLIBRE_WIDGETS_EXPORT Q_DECL_EXPORT -#else -#define Q_MAPLIBRE_WIDGETS_EXPORT Q_DECL_IMPORT -#endif -#else -#define Q_MAPLIBRE_WIDGETS_EXPORT -#endif - -#endif // QMAPLIBRE_WIDGETS_EXPORT_H diff --git a/third_party/maplibre-native-qt/include/geojson_p.hpp b/third_party/maplibre-native-qt/include/geojson_p.hpp deleted file mode 100644 index 8387f70c4b..0000000000 --- a/third_party/maplibre-native-qt/include/geojson_p.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors -// Copyright (C) 2019 Mapbox, Inc. - -// SPDX-License-Identifier: BSD-2-Clause - -#pragma once - -#include "types.hpp" - -#include -#include -#include - -#include - -#include - -namespace QMapLibre::GeoJSON { - -mbgl::Point asPoint(const Coordinate &coordinate); -mbgl::MultiPoint asMultiPoint(const Coordinates &multiPoint); -mbgl::LineString asLineString(const Coordinates &lineString); -mbgl::MultiLineString asMultiLineString(const CoordinatesCollection &multiLineString); -mbgl::Polygon asPolygon(const CoordinatesCollection &polygon); -mbgl::MultiPolygon asMultiPolygon(const CoordinatesCollections &multiPolygon); -mbgl::Value asPropertyValue(const QVariant &value); -mbgl::FeatureIdentifier asFeatureIdentifier(const QVariant &id); -mbgl::GeoJSONFeature asFeature(const Feature &feature); - -} // namespace QMapLibre::GeoJSON diff --git a/third_party/maplibre-native-qt/include/gl_widget.hpp b/third_party/maplibre-native-qt/include/gl_widget.hpp deleted file mode 100644 index b2630daea7..0000000000 --- a/third_party/maplibre-native-qt/include/gl_widget.hpp +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors - -// SPDX-License-Identifier: BSD-2-Clause - -#ifndef QMAPLIBRE_GL_WIDGET_H -#define QMAPLIBRE_GL_WIDGET_H - -#include - -#include -#include - -#include - -#include - -QT_BEGIN_NAMESPACE - -class QKeyEvent; -class QMouseEvent; -class QWheelEvent; - -QT_END_NAMESPACE - -namespace QMapLibre { - -class GLWidgetPrivate; - -class Q_MAPLIBRE_WIDGETS_EXPORT GLWidget : public QOpenGLWidget { - Q_OBJECT - -public: - explicit GLWidget(const Settings &); - ~GLWidget() override; - - Map *map(); - -protected: - // QWidget implementation. - void mousePressEvent(QMouseEvent *event) override; - void mouseMoveEvent(QMouseEvent *event) override; - void wheelEvent(QWheelEvent *event) override; - - // Q{,Open}GLWidget implementation. - void initializeGL() override; - void paintGL() override; - -private: - Q_DISABLE_COPY(GLWidget) - - std::unique_ptr d_ptr; -}; - -} // namespace QMapLibre - -#endif // QMAPLIBRE_GL_WIDGET_H diff --git a/third_party/maplibre-native-qt/include/gl_widget_p.hpp b/third_party/maplibre-native-qt/include/gl_widget_p.hpp deleted file mode 100644 index c97781fd29..0000000000 --- a/third_party/maplibre-native-qt/include/gl_widget_p.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors - -// SPDX-License-Identifier: BSD-2-Clause - -#pragma once - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class QKeyEvent; -class QMouseEvent; -class QWheelEvent; - -QT_END_NAMESPACE - -namespace QMapLibre { - -class GLWidgetPrivate : public QObject { - Q_OBJECT - -public: - explicit GLWidgetPrivate(QObject *parent, Settings settings); - ~GLWidgetPrivate() override; - - void handleMousePressEvent(QMouseEvent *event); - void handleMouseMoveEvent(QMouseEvent *event); - void handleWheelEvent(QWheelEvent *event) const; - - std::unique_ptr m_map{}; - Settings m_settings; - -private: - Q_DISABLE_COPY(GLWidgetPrivate); - - QPointF m_lastPos; -}; - -} // namespace QMapLibre diff --git a/third_party/maplibre-native-qt/include/map.hpp b/third_party/maplibre-native-qt/include/map.hpp deleted file mode 100644 index cd56996185..0000000000 --- a/third_party/maplibre-native-qt/include/map.hpp +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors -// Copyright (C) 2019 Mapbox, Inc. - -// SPDX-License-Identifier: BSD-2-Clause - -#ifndef QMAPLIBRE_MAP_H -#define QMAPLIBRE_MAP_H - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace QMapLibre { - -class MapPrivate; - -class Q_MAPLIBRE_CORE_EXPORT Map : public QObject { - Q_OBJECT - Q_PROPERTY(double latitude READ latitude WRITE setLatitude) - Q_PROPERTY(double longitude READ longitude WRITE setLongitude) - Q_PROPERTY(double zoom READ zoom WRITE setZoom) - Q_PROPERTY(double bearing READ bearing WRITE setBearing) - Q_PROPERTY(double pitch READ pitch WRITE setPitch) - Q_PROPERTY(QString styleJson READ styleJson WRITE setStyleJson) - Q_PROPERTY(QString styleUrl READ styleUrl WRITE setStyleUrl) - Q_PROPERTY(double scale READ scale WRITE setScale) - Q_PROPERTY(QMapLibre::Coordinate coordinate READ coordinate WRITE setCoordinate) - Q_PROPERTY(QMargins margins READ margins WRITE setMargins) - -public: - enum MapChange { - MapChangeRegionWillChange = 0, - MapChangeRegionWillChangeAnimated, - MapChangeRegionIsChanging, - MapChangeRegionDidChange, - MapChangeRegionDidChangeAnimated, - MapChangeWillStartLoadingMap, - MapChangeDidFinishLoadingMap, - MapChangeDidFailLoadingMap, - MapChangeWillStartRenderingFrame, - MapChangeDidFinishRenderingFrame, - MapChangeDidFinishRenderingFrameFullyRendered, - MapChangeWillStartRenderingMap, - MapChangeDidFinishRenderingMap, - MapChangeDidFinishRenderingMapFullyRendered, - MapChangeDidFinishLoadingStyle, - MapChangeSourceDidChange - }; - - enum MapLoadingFailure { - StyleParseFailure, - StyleLoadFailure, - NotFoundFailure, - UnknownFailure - }; - - // Determines the orientation of the map. - enum NorthOrientation { - NorthUpwards, // Default - NorthRightwards, - NorthDownwards, - NorthLeftwards, - }; - - explicit Map(QObject *parent = nullptr, - const Settings &settings = Settings(), - const QSize &size = QSize(), - qreal pixelRatio = 1); - ~Map() override; - - [[nodiscard]] QString styleJson() const; - [[nodiscard]] QString styleUrl() const; - - void setStyleJson(const QString &); - void setStyleUrl(const QString &); - - [[nodiscard]] double latitude() const; - void setLatitude(double latitude); - - [[nodiscard]] double longitude() const; - void setLongitude(double longitude); - - [[nodiscard]] double scale() const; - void setScale(double scale, const QPointF ¢er = QPointF()); - - [[nodiscard]] double zoom() const; - void setZoom(double zoom); - - [[nodiscard]] double minimumZoom() const; - [[nodiscard]] double maximumZoom() const; - - [[nodiscard]] double bearing() const; - void setBearing(double degrees); - void setBearing(double degrees, const QPointF ¢er); - - [[nodiscard]] double pitch() const; - void setPitch(double pitch); - void pitchBy(double pitch); - - [[nodiscard]] NorthOrientation northOrientation() const; - void setNorthOrientation(NorthOrientation); - - [[nodiscard]] Coordinate coordinate() const; - void setCoordinate(const Coordinate &coordinate); - void setCoordinateZoom(const Coordinate &coordinate, double zoom); - - void jumpTo(const CameraOptions &); - - void setGestureInProgress(bool inProgress); - - void setTransitionOptions(qint64 duration, qint64 delay = 0); - - void addAnnotationIcon(const QString &name, const QImage &sprite); - - AnnotationID addAnnotation(const Annotation &annotation); - void updateAnnotation(AnnotationID id, const Annotation &annotation); - void removeAnnotation(AnnotationID id); - - bool setLayoutProperty(const QString &layerId, const QString &propertyName, const QVariant &value); - bool setPaintProperty(const QString &layerId, const QString &propertyName, const QVariant &value); - - [[nodiscard]] bool isFullyLoaded() const; - - void moveBy(const QPointF &offset); - void scaleBy(double scale, const QPointF ¢er = QPointF()); - void rotateBy(const QPointF &first, const QPointF &second); - - void resize(const QSize &size); - - [[nodiscard]] QPointF pixelForCoordinate(const Coordinate &coordinate) const; - [[nodiscard]] Coordinate coordinateForPixel(const QPointF &pixel) const; - - [[nodiscard]] CoordinateZoom coordinateZoomForBounds(const Coordinate &sw, const Coordinate &ne) const; - [[nodiscard]] CoordinateZoom coordinateZoomForBounds(const Coordinate &sw, - const Coordinate &ne, - double bearing, - double pitch); - - void setMargins(const QMargins &margins); - [[nodiscard]] QMargins margins() const; - - void addSource(const QString &id, const QVariantMap ¶ms); - bool sourceExists(const QString &id); - void updateSource(const QString &id, const QVariantMap ¶ms); - void removeSource(const QString &id); - - void addImage(const QString &id, const QImage &sprite); - void removeImage(const QString &id); - - void addCustomLayer(const QString &id, - std::unique_ptr host, - const QString &before = QString()); - void addLayer(const QString &id, const QVariantMap ¶ms, const QString &before = QString()); - bool layerExists(const QString &id); - void removeLayer(const QString &id); - - [[nodiscard]] QVector layerIds() const; - - void setFilter(const QString &layerId, const QVariant &filter); - [[nodiscard]] QVariant getFilter(const QString &layerId) const; - // When rendering on a different thread, - // should be called on the render thread. - void createRenderer(); - void destroyRenderer(); - void setFramebufferObject(quint32 fbo, const QSize &size); - -public slots: - void render(); - void setConnectionEstablished(); - - // Commit changes, load all the resources - // and renders the map when completed. - void startStaticRender(); - -signals: - void needsRendering(); - void mapChanged(Map::MapChange); - void mapLoadingFailed(Map::MapLoadingFailure, const QString &reason); - void copyrightsChanged(const QString ©rightsHtml); - - void staticRenderFinished(const QString &error); - -private: - Q_DISABLE_COPY(Map) - - std::unique_ptr d_ptr; -}; - -} // namespace QMapLibre - -Q_DECLARE_METATYPE(QMapLibre::Map::MapChange); -Q_DECLARE_METATYPE(QMapLibre::Map::MapLoadingFailure); - -#endif // QMAPLIBRE_MAP_H diff --git a/third_party/maplibre-native-qt/include/map_observer_p.hpp b/third_party/maplibre-native-qt/include/map_observer_p.hpp deleted file mode 100644 index e68c72b17b..0000000000 --- a/third_party/maplibre-native-qt/include/map_observer_p.hpp +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors -// Copyright (C) 2019 Mapbox, Inc. - -// SPDX-License-Identifier: BSD-2-Clause - -#pragma once - -#include "map.hpp" - -#include -#include - -#include - -#include -#include - -namespace QMapLibre { - -class MapPrivate; - -class MapObserver : public QObject, public mbgl::MapObserver { - Q_OBJECT - -public: - explicit MapObserver(MapPrivate *ptr); - ~MapObserver() override; - - // mbgl::MapObserver implementation. - void onCameraWillChange(mbgl::MapObserver::CameraChangeMode mode) final; - void onCameraIsChanging() final; - void onCameraDidChange(mbgl::MapObserver::CameraChangeMode mode) final; - void onWillStartLoadingMap() final; - void onDidFinishLoadingMap() final; - void onDidFailLoadingMap(mbgl::MapLoadError error, const std::string &what) final; - void onWillStartRenderingFrame() final; - void onDidFinishRenderingFrame(mbgl::MapObserver::RenderFrameStatus status) final; - void onWillStartRenderingMap() final; - void onDidFinishRenderingMap(mbgl::MapObserver::RenderMode mode) final; - void onDidFinishLoadingStyle() final; - void onSourceChanged(mbgl::style::Source &source) final; - -signals: - void mapChanged(Map::MapChange); - void mapLoadingFailed(Map::MapLoadingFailure, const QString &reason); - void copyrightsChanged(const QString ©rightsHtml); - -private: - Q_DISABLE_COPY(MapObserver) - - MapPrivate *d_ptrRef; -}; - -} // namespace QMapLibre diff --git a/third_party/maplibre-native-qt/include/map_p.hpp b/third_party/maplibre-native-qt/include/map_p.hpp deleted file mode 100644 index 9ca0c7e6f5..0000000000 --- a/third_party/maplibre-native-qt/include/map_p.hpp +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors -// Copyright (C) 2019 Mapbox, Inc. - -// SPDX-License-Identifier: BSD-2-Clause - -#pragma once - -#include "map.hpp" -#include "map_observer_p.hpp" -#include "map_renderer_p.hpp" - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -namespace QMapLibre { - -class MapPrivate : public QObject, public mbgl::RendererFrontend { - Q_OBJECT - -public: - explicit MapPrivate(Map *map, const Settings &settings, const QSize &size, qreal pixelRatio); - ~MapPrivate() override; - - // mbgl::RendererFrontend implementation. - void reset() final {} - void setObserver(mbgl::RendererObserver &observer) final; - void update(std::shared_ptr parameters) final; - - // These need to be called on the same thread. - void createRenderer(); - void destroyRenderer(); - void render(); - void setFramebufferObject(quint32 fbo, const QSize &size); - - using PropertySetter = std::optional (mbgl::style::Layer::*)( - const std::string &, const mbgl::style::conversion::Convertible &); - [[nodiscard]] bool setProperty(const PropertySetter &setter, - const QString &layerId, - const QString &name, - const QVariant &value) const; - - mbgl::EdgeInsets margins; - std::unique_ptr mapObj{}; - -public slots: - void requestRendering(); - -signals: - void needsRendering(); - -private: - Q_DISABLE_COPY(MapPrivate) - - std::recursive_mutex m_mapRendererMutex; - std::shared_ptr m_rendererObserver{}; - std::shared_ptr m_updateParameters{}; - - std::unique_ptr m_mapObserver{}; - std::unique_ptr m_mapRenderer{}; - std::unique_ptr> m_resourceTransform{}; - - Settings::GLContextMode m_mode; - qreal m_pixelRatio; - - QString m_localFontFamily; - - std::atomic_flag m_renderQueued = ATOMIC_FLAG_INIT; -}; - -} // namespace QMapLibre diff --git a/third_party/maplibre-native-qt/include/map_renderer_p.hpp b/third_party/maplibre-native-qt/include/map_renderer_p.hpp deleted file mode 100644 index b9a087c392..0000000000 --- a/third_party/maplibre-native-qt/include/map_renderer_p.hpp +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors -// Copyright (C) 2019 Mapbox, Inc. - -// SPDX-License-Identifier: BSD-2-Clause - -#pragma once - -#include "settings.hpp" - -#include "utils/renderer_backend.hpp" - -#include -#include -#include - -#include - -#include - -#include -#include - -namespace mbgl { -class Renderer; -class UpdateParameters; -} // namespace mbgl - -namespace QMapLibre { - -class RendererBackend; - -class MapRenderer : public QObject { - Q_OBJECT - -public: - MapRenderer(qreal pixelRatio, Settings::GLContextMode, const QString &localFontFamily); - ~MapRenderer() override; - - void render(); - void updateFramebuffer(quint32 fbo, const mbgl::Size &size); - void setObserver(mbgl::RendererObserver *observer); - - // Thread-safe, called by the Frontend - void updateParameters(std::shared_ptr parameters); - -signals: - void needsRendering(); - -private: - MBGL_STORE_THREAD(tid) - - Q_DISABLE_COPY(MapRenderer) - - std::mutex m_updateMutex; - std::shared_ptr m_updateParameters; - - RendererBackend m_backend; - std::unique_ptr m_renderer{}; - - bool m_forceScheduler{}; -}; - -} // namespace QMapLibre diff --git a/third_party/maplibre-native-qt/include/qgeomap.hpp b/third_party/maplibre-native-qt/include/qgeomap.hpp deleted file mode 100644 index 5eb0180503..0000000000 --- a/third_party/maplibre-native-qt/include/qgeomap.hpp +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors -// Copyright (C) 2017 The Qt Company Ltd. -// Copyright (C) 2017 Mapbox, Inc. - -// SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only - -#pragma once - -#include "export_location.hpp" - -#include -#include - -#include - -namespace QMapLibre { - -class QGeoMapMapLibrePrivate; - -class Q_MAPLIBRE_LOCATION_EXPORT QGeoMapMapLibre : public QGeoMap { - Q_OBJECT - Q_DECLARE_PRIVATE(QGeoMapMapLibre) - -public: - explicit QGeoMapMapLibre(QGeoMappingManagerEngine *engine, QObject *parent = nullptr); - ~QGeoMapMapLibre() override; - - [[nodiscard]] Capabilities capabilities() const override; - - void setSettings(const Settings &settings); - void setMapItemsBefore(const QString &mapItemsBefore); - - void addStyleParameter(StyleParameter *parameter); - void removeStyleParameter(StyleParameter *parameter); - void clearStyleParameters(); - -private Q_SLOTS: - // QMapLibre - void onMapChanged(Map::MapChange); - - // QDeclarativeGeoMapItemBase - void onMapItemPropertyChanged(); - void onMapItemSubPropertyChanged(); - void onMapItemUnsupportedPropertyChanged(); - void onMapItemGeometryChanged(); - - // StyleParameter - void onStyleParameterUpdated(StyleParameter *parameter); - -private: - QSGNode *updateSceneGraph(QSGNode *oldNode, QQuickWindow *window) override; -}; - -} // namespace QMapLibre diff --git a/third_party/maplibre-native-qt/include/qgeomap_p.hpp b/third_party/maplibre-native-qt/include/qgeomap_p.hpp deleted file mode 100644 index ce415d9bcf..0000000000 --- a/third_party/maplibre-native-qt/include/qgeomap_p.hpp +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors -// Copyright (C) 2017 The Qt Company Ltd. -// Copyright (C) 2017 Mapbox, Inc. - -// SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only - -#pragma once - -#include "qgeomap.hpp" - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -namespace QMapLibre { - -class Map; -class StyleChange; - -class QGeoMapMapLibrePrivate : public QGeoMapPrivate { - Q_DECLARE_PUBLIC(QGeoMapMapLibre) - -public: - explicit QGeoMapMapLibrePrivate(QGeoMappingManagerEngine *engine); - ~QGeoMapMapLibrePrivate() override; - - QSGNode *updateSceneGraph(QSGNode *oldNode, QQuickWindow *window); - - QGeoMap::ItemTypes supportedMapItemTypes() const override; - void addMapItem(QDeclarativeGeoMapItemBase *item) override; - void removeMapItem(QDeclarativeGeoMapItemBase *item) override; - - void addStyleParameter(StyleParameter *parameter); - void removeStyleParameter(StyleParameter *parameter); - void clearStyleParameters(); - - /* Data members */ - enum SyncState : int { - NoSync = 0, - ViewportSync = 1 << 0, - CameraDataSync = 1 << 1, - MapTypeSync = 1 << 2, - VisibleAreaSync = 1 << 3 - }; - Q_DECLARE_FLAGS(SyncStates, SyncState); - - Settings m_settings; - QString m_mapItemsBefore; - - QList m_mapParameters; - - QTimer m_refresh; - bool m_shouldRefresh = true; - bool m_warned = false; - bool m_threadedRendering = false; - bool m_styleLoaded = false; - - SyncStates m_syncState = NoSync; - - std::vector> m_styleChanges; - -protected: - void changeViewportSize(const QSize &size) override; - void changeCameraData(const QGeoCameraData &data) override; -#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) - void changeActiveMapType(const QGeoMapType &mapType) override; -#else - void changeActiveMapType(const QGeoMapType mapType) override; -#endif - - void setVisibleArea(const QRectF &visibleArea) override; - QRectF visibleArea() const override; - -private: - Q_DISABLE_COPY(QGeoMapMapLibrePrivate); - - void syncStyleChanges(Map *map); - void threadedRenderingHack(QQuickWindow *window, Map *map); - - QRectF m_visibleArea; -}; - -Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoMapMapLibrePrivate::SyncStates) - -} // namespace QMapLibre diff --git a/third_party/maplibre-native-qt/include/qmaplibre.hpp b/third_party/maplibre-native-qt/include/qmaplibre.hpp deleted file mode 100644 index a8dc445e2b..0000000000 --- a/third_party/maplibre-native-qt/include/qmaplibre.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors - -// SPDX-License-Identifier: BSD-2-Clause - -#include "export_core.hpp" -#include "map.hpp" -#include "settings.hpp" -#include "types.hpp" -#include "utils.hpp" diff --git a/third_party/maplibre-native-qt/include/qmaplibrewidgets.hpp b/third_party/maplibre-native-qt/include/qmaplibrewidgets.hpp deleted file mode 100644 index ebe9a8eea4..0000000000 --- a/third_party/maplibre-native-qt/include/qmaplibrewidgets.hpp +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors - -// SPDX-License-Identifier: BSD-2-Clause - -#include "export_widgets.hpp" -#include "gl_widget.hpp" diff --git a/third_party/maplibre-native-qt/include/qt_mapping_engine.hpp b/third_party/maplibre-native-qt/include/qt_mapping_engine.hpp deleted file mode 100644 index 67cb4b56ce..0000000000 --- a/third_party/maplibre-native-qt/include/qt_mapping_engine.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors -// Copyright (C) 2017 The Qt Company Ltd. -// Copyright (C) 2017 Mapbox, Inc. - -// SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only - -#pragma once - -#include "export_location.hpp" - -#include - -#include -#include - -namespace QMapLibre { - -class Q_MAPLIBRE_LOCATION_EXPORT QtMappingEngine : public QGeoMappingManagerEngine { - Q_OBJECT - -public: - QtMappingEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString); - - QGeoMap *createMap() override; - -private: - Settings m_settings; - QString m_mapItemsBefore; -}; - -} // namespace QMapLibre diff --git a/third_party/maplibre-native-qt/include/settings.hpp b/third_party/maplibre-native-qt/include/settings.hpp deleted file mode 100644 index d6f88b871b..0000000000 --- a/third_party/maplibre-native-qt/include/settings.hpp +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors -// Copyright (C) 2019 Mapbox, Inc. - -// SPDX-License-Identifier: BSD-2-Clause - -#ifndef QMAPLIBRE_SETTINGS_H -#define QMAPLIBRE_SETTINGS_H - -#include -#include - -#include -#include - -#include -#include - -// TODO: this will be wrapped at some point -namespace mbgl { -class TileServerOptions; -} // namespace mbgl - -namespace QMapLibre { - -class SettingsPrivate; - -class Q_MAPLIBRE_CORE_EXPORT Settings { -public: - enum GLContextMode : bool { - UniqueGLContext, - SharedGLContext - }; - - enum MapMode { - Continuous = 0, - Static - }; - - enum ConstrainMode { - NoConstrain = 0, - ConstrainHeightOnly, - ConstrainWidthAndHeight - }; - - enum ViewportMode { - DefaultViewport = 0, - FlippedYViewport - }; - - enum ProviderTemplate { - NoProvider = 0, - MapLibreProvider, - MapTilerProvider, - MapboxProvider - }; - - using ResourceTransformFunction = std::function; - - explicit Settings(ProviderTemplate provider = NoProvider); - ~Settings(); - Settings(const Settings &s); - Settings(Settings &&s) noexcept; - Settings &operator=(const Settings &s); - Settings &operator=(Settings &&s) noexcept; - - [[nodiscard]] GLContextMode contextMode() const; - void setContextMode(GLContextMode); - - [[nodiscard]] MapMode mapMode() const; - void setMapMode(MapMode); - - [[nodiscard]] ConstrainMode constrainMode() const; - void setConstrainMode(ConstrainMode); - - [[nodiscard]] ViewportMode viewportMode() const; - void setViewportMode(ViewportMode); - - [[nodiscard]] unsigned cacheDatabaseMaximumSize() const; - void setCacheDatabaseMaximumSize(unsigned); - - [[nodiscard]] QString cacheDatabasePath() const; - void setCacheDatabasePath(const QString &path); - - [[nodiscard]] QString assetPath() const; - void setAssetPath(const QString &path); - - [[nodiscard]] QString apiKey() const; - void setApiKey(const QString &key); - - [[nodiscard]] QString apiBaseUrl() const; - void setApiBaseUrl(const QString &url); - - [[nodiscard]] QString localFontFamily() const; - void setLocalFontFamily(const QString &family); - - [[nodiscard]] QString clientName() const; - void setClientName(const QString &name); - - [[nodiscard]] QString clientVersion() const; - void setClientVersion(const QString &version); - - [[nodiscard]] ResourceTransformFunction resourceTransform() const; - void setResourceTransform(const ResourceTransformFunction &transform); - - void setProviderTemplate(ProviderTemplate providerTemplate); - void setStyles(const Styles &styles); - - [[nodiscard]] const Styles &styles() const; - [[nodiscard]] Styles providerStyles() const; - - [[nodiscard]] Coordinate defaultCoordinate() const; - void setDefaultCoordinate(const Coordinate &coordinate); - [[nodiscard]] double defaultZoom() const; - void setDefaultZoom(double zoom); - - [[nodiscard]] bool customTileServerOptions() const; - [[nodiscard]] const mbgl::TileServerOptions &tileServerOptions() const; - -private: - std::unique_ptr d_ptr; -}; - -} // namespace QMapLibre - -#endif // QMAPLIBRE_SETTINGS_H diff --git a/third_party/maplibre-native-qt/include/settings_p.hpp b/third_party/maplibre-native-qt/include/settings_p.hpp deleted file mode 100644 index 257bdfd5a9..0000000000 --- a/third_party/maplibre-native-qt/include/settings_p.hpp +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors -// Copyright (C) 2019 Mapbox, Inc. - -// SPDX-License-Identifier: BSD-2-Clause - -#pragma once - -#include "settings.hpp" -#include "types.hpp" - -#include - -#include -#include - -#include -#include - -namespace mbgl { -class TileServerOptions; -} // namespace mbgl - -namespace QMapLibre { - -class SettingsPrivate { -public: - SettingsPrivate(); - - void setProviderTemplate(Settings::ProviderTemplate providerTemplate); - void setProviderApiBaseUrl(const QString &url); - - Settings::GLContextMode m_contextMode{Settings::SharedGLContext}; - Settings::MapMode m_mapMode{Settings::Continuous}; - Settings::ConstrainMode m_constrainMode{Settings::ConstrainHeightOnly}; - Settings::ViewportMode m_viewportMode{Settings::DefaultViewport}; - Settings::ProviderTemplate m_providerTemplate{Settings::NoProvider}; - - unsigned m_cacheMaximumSize; - QString m_cacheDatabasePath; - QString m_assetPath; - QString m_apiKey; - QString m_localFontFamily; - QString m_clientName; - QString m_clientVersion; - - Coordinate m_defaultCoordinate{}; - double m_defaultZoom{}; - - Styles m_styles; - - std::function m_resourceTransform; - - bool m_customTileServerOptions{}; - mbgl::TileServerOptions m_tileServerOptions{}; -}; - -} // namespace QMapLibre diff --git a/third_party/maplibre-native-qt/include/style_change_utils_p.hpp b/third_party/maplibre-native-qt/include/style_change_utils_p.hpp deleted file mode 100644 index 991bb4077e..0000000000 --- a/third_party/maplibre-native-qt/include/style_change_utils_p.hpp +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors -// Copyright (C) 2017 Mapbox, Inc. - -// SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only - -#pragma once - -#include - -#include -#include -#include -#include -#include - -namespace QMapLibre::StyleChangeUtils { - -Feature featureFromMapRectangle(QDeclarativeRectangleMapItem *item); -Feature featureFromMapCircle(QDeclarativeCircleMapItem *item); -Feature featureFromMapPolygon(QDeclarativePolygonMapItem *item); -Feature featureFromMapPolyline(QDeclarativePolylineMapItem *item); -Feature featureFromMapItem(QDeclarativeGeoMapItemBase *item); - -QString featureId(QDeclarativeGeoMapItemBase *item); -std::vector featureLayoutPropertiesFromMapPolyline(QDeclarativePolylineMapItem *item); -std::vector featureLayoutPropertiesFromMapItem(QDeclarativeGeoMapItemBase *item); -std::vector featurePaintPropertiesFromMapRectangle(QDeclarativeRectangleMapItem *item); -std::vector featurePaingPropertiesFromMapCircle(QDeclarativeCircleMapItem *item); -std::vector featurePaintPropertiesFromMapPolygon(QDeclarativePolygonMapItem *item); -std::vector featurePaintPropertiesFromMapPolyline(QDeclarativePolylineMapItem *item); -std::vector featurePaintPropertiesFromMapItem(QDeclarativeGeoMapItemBase *item); -std::vector featurePropertiesFromMapItem(QDeclarativeGeoMapItemBase *item); - -} // namespace QMapLibre::StyleChangeUtils diff --git a/third_party/maplibre-native-qt/include/texture_node.hpp b/third_party/maplibre-native-qt/include/texture_node.hpp deleted file mode 100644 index 96f63b3534..0000000000 --- a/third_party/maplibre-native-qt/include/texture_node.hpp +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors -// Copyright (C) 2017 The Qt Company Ltd. -// Copyright (C) 2017 Mapbox, Inc. - -// SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only - -#pragma once - -#include -#include -#include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) -#include -#else -#include -#endif - -#include - -namespace QMapLibre { - -class QGeoMapMapLibre; - -class TextureNode : public QSGSimpleTextureNode { -public: - TextureNode(const Settings &setting, const QSize &size, qreal pixelRatio, QGeoMapMapLibre *geoMap); - - [[nodiscard]] Map *map() const; - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - void resize(const QSize &size, qreal pixelRatio, QQuickWindow *window); -#else - void resize(const QSize &size, qreal pixelRatio); -#endif - void render(QQuickWindow *); - -private: - std::unique_ptr m_map{}; - std::unique_ptr m_fbo{}; -}; - -} // namespace QMapLibre diff --git a/third_party/maplibre-native-qt/include/types.hpp b/third_party/maplibre-native-qt/include/types.hpp deleted file mode 100644 index 696fab1a88..0000000000 --- a/third_party/maplibre-native-qt/include/types.hpp +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (C) 2023 MapLibre contributors -// Copyright (C) 2019 Mapbox, Inc. - -// SPDX-License-Identifier: BSD-2-Clause - -#ifndef QMAPLIBRE_TYPES_H -#define QMAPLIBRE_TYPES_H - -#include - -#include -#include -#include -#include -#include -#include - -namespace QMapLibre { - -using Coordinate = QPair; -using CoordinateZoom = QPair; -using ProjectedMeters = QPair; - -using Coordinates = QVector; -using CoordinatesCollection = QVector; - -using CoordinatesCollections = QVector; - -struct Q_MAPLIBRE_CORE_EXPORT Style { - enum Type { // Taken from Qt to be in sync with QtLocation - NoMap = 0, - StreetMap, - SatelliteMapDay, - SatelliteMapNight, - TerrainMap, - HybridMap, - TransitMap, - GrayStreetMap, - PedestrianMap, - CarNavigationMap, - CycleMap, - CustomMap = 100 - }; - -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) - explicit Style(QString url_, QString name_ = QString()) - : url(std::move(url_)), - name(std::move(name_)) {} -#else - explicit Style(QString url_ = QString(), QString name_ = QString()) - : url(std::move(url_)), - name(std::move(name_)) {} -#endif - - QString url; - QString name; - QString description; - bool night{}; - Type type{CustomMap}; -}; - -using Styles = QVector
%1%2%4%5%6%7