From 41681e1de102e74d73fe7e13257d51681dcc8b4c Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 14 Dec 2022 01:56:57 -0800 Subject: [PATCH 01/11] HKG CAN-FD: remove duplicate FW versions (#26793) * remove duplicate FW version * Update values.py --- selfdrive/car/hyundai/values.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index cdcaf629af..db2bee991e 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -1447,7 +1447,6 @@ FW_VERSIONS = { CAR.KIA_EV6: { (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00CV1_ RDR ----- 1.00 1.01 99110-CV000 ', - b'\xf1\x8799110CV000\xf1\x00CV1_ RDR ----- 1.00 1.01 99110-CV000 ', ], (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00CV1 MFC AT USA LHD 1.00 1.05 99210-CV000 211027', @@ -1459,7 +1458,6 @@ FW_VERSIONS = { CAR.IONIQ_5: { (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00NE1_ RDR ----- 1.00 1.00 99110-GI000 ', - b'\xf1\x8799110GI000\xf1\x00NE1_ RDR ----- 1.00 1.00 99110-GI000 ', ], (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00NE1 MFC AT USA LHD 1.00 1.02 99211-GI010 211206', From 6fe592c678427b17c48f79487d12e9aed75ac551 Mon Sep 17 00:00:00 2001 From: Jason Wen <47793918+sunnyhaibin@users.noreply.github.com> Date: Wed, 14 Dec 2022 04:57:17 -0500 Subject: [PATCH 02/11] Hyundai: Add FW Versions for Southeast Asia 2022 Ioniq 5 HDA1 (#26755) * Hyundai: Add FW Versions for 2022 Ioniq 5 HDA1 * Check IONIQ_5 fwdCamera FW to segregate radar and camera SCC cars * Test things out * Is it that simple? * Revert "Is it that simple?" This reverts commit 6d48945925597fa686a7c6c534960487bb811e26. * Revert "Test things out" This reverts commit 772cd5f47ab4d92c6ba69e77f44ba3799849d399. * Revert "Check IONIQ_5 fwdCamera FW to segregate radar and camera SCC cars" This reverts commit 3ca1a2d6faa02e86b8fa628985cd5d76e1763688. * No ADAS ECU detected, but has all messages for HDA2 * Check DISTANCE_UNIT on CRUISE_BUTTONS * Revert "Check DISTANCE_UNIT on CRUISE_BUTTONS" This reverts commit 9cbfe520f3406f8b1d66a56608a80417fea54871. * Check DISTANCE_UNIT on CRUISE_BUTTONS for all CAN-FD HKG * Update selfdrive/car/hyundai/interface.py Co-authored-by: Shane Smiskol * Test fingerprint * Southeast Asia specific * Revert "Test fingerprint" This reverts commit 33bb30b750c09f6d11e1b04d72e47f9354bdc9d5. * updatedocs * rename Co-authored-by: Shane Smiskol --- docs/CARS.md | 3 ++- selfdrive/car/hyundai/values.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/CARS.md b/docs/CARS.md index 5c7fe57a89..6ae647efcf 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -4,7 +4,7 @@ A supported vehicle is one that just works when you install a comma three. All supported cars provide a better experience than any stock system. -# 220 Supported Cars +# 221 Supported Cars |Make|Model|Supported Package|ACC|No ACC accel below|No ALC below|Steering Torque|Resume from stop|Harness| |---|---|---|:---:|:---:|:---:|:---:|:---:|:---:| @@ -62,6 +62,7 @@ A supported vehicle is one that just works when you install a comma three. All s |Hyundai|Elantra Hybrid 2021-23|Smart Cruise Control (SCC)|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai K| |Hyundai|Genesis 2015-16|Smart Cruise Control (SCC)|Stock|19 mph|37 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai J| |Hyundai|i30 2017-19|Smart Cruise Control (SCC)|Stock|0 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai E| +|Hyundai|Ioniq 5 (Southeast Asia only) 2022-23[5](#footnotes)|All|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai Q| |Hyundai|Ioniq 5 (with HDA II) 2022-23[5](#footnotes)|Highway Driving Assist II|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai Q| |Hyundai|Ioniq 5 (without HDA II) 2022-23[5](#footnotes)|Highway Driving Assist|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai K| |Hyundai|Ioniq Electric 2019|Smart Cruise Control (SCC)|Stock|0 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index db2bee991e..240c9b6000 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -172,6 +172,7 @@ CAR_INFO: Dict[str, Optional[Union[HyundaiCarInfo, List[HyundaiCarInfo]]]] = { CAR.VELOSTER: HyundaiCarInfo("Hyundai Veloster 2019-20", min_enable_speed=5. * CV.MPH_TO_MS, harness=Harness.hyundai_e), CAR.SONATA_HYBRID: HyundaiCarInfo("Hyundai Sonata Hybrid 2020-22", "All", harness=Harness.hyundai_a), CAR.IONIQ_5: [ + HyundaiCarInfo("Hyundai Ioniq 5 (Southeast Asia only) 2022-23", "All", harness=Harness.hyundai_q), HyundaiCarInfo("Hyundai Ioniq 5 (without HDA II) 2022-23", "Highway Driving Assist", harness=Harness.hyundai_k), HyundaiCarInfo("Hyundai Ioniq 5 (with HDA II) 2022-23", "Highway Driving Assist II", harness=Harness.hyundai_q), ], @@ -1463,6 +1464,7 @@ FW_VERSIONS = { b'\xf1\x00NE1 MFC AT USA LHD 1.00 1.02 99211-GI010 211206', b'\xf1\x00NE1 MFC AT EUR LHD 1.00 1.06 99211-GI000 210813', b'\xf1\x00NE1 MFC AT USA LHD 1.00 1.05 99211-GI010 220614', + b'\xf1\x00NE1 MFC AT EUR RHD 1.00 1.01 99211-GI010 211007', ], }, CAR.TUCSON_4TH_GEN: { From 0c1fbe22b4d83ee5873c992d02b9bc46fd16ae7b Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 14 Dec 2022 02:19:09 -0800 Subject: [PATCH 03/11] soundd: increase upper bound for volume level (#26792) Update sound.cc --- selfdrive/ui/soundd/sound.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/ui/soundd/sound.cc b/selfdrive/ui/soundd/sound.cc index 42fc9c4b1a..21afd92b1c 100644 --- a/selfdrive/ui/soundd/sound.cc +++ b/selfdrive/ui/soundd/sound.cc @@ -48,7 +48,7 @@ void Sound::update() { // scale volume using ambient noise level if (sm.updated("microphone")) { - float volume = util::map_val(sm["microphone"].getMicrophone().getFilteredSoundPressureWeightedDb(), 30.f, 54.f, 0.f, 1.f); + float volume = util::map_val(sm["microphone"].getMicrophone().getFilteredSoundPressureWeightedDb(), 30.f, 56.f, 0.f, 1.f); volume = QAudio::convertVolume(volume, QAudio::LogarithmicVolumeScale, QAudio::LinearVolumeScale); Hardware::set_volume(volume); } From a143ebf6486480dfa6e2c67a7f68dcb1b9e329a3 Mon Sep 17 00:00:00 2001 From: Jason Wen <47793918+sunnyhaibin@users.noreply.github.com> Date: Wed, 14 Dec 2022 17:05:13 -0500 Subject: [PATCH 04/11] HKG: Add FW Versions for Southeast Asia Kia EV6 2022 HDA1 (#26795) HKG: Add FW Versions for Southeast Asia Kia EV6 2022 --- docs/CARS.md | 3 ++- selfdrive/car/hyundai/values.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/CARS.md b/docs/CARS.md index 6ae647efcf..4f1a7cb652 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -4,7 +4,7 @@ A supported vehicle is one that just works when you install a comma three. All supported cars provide a better experience than any stock system. -# 221 Supported Cars +# 222 Supported Cars |Make|Model|Supported Package|ACC|No ACC accel below|No ALC below|Steering Torque|Resume from stop|Harness| |---|---|---|:---:|:---:|:---:|:---:|:---:|:---:| @@ -93,6 +93,7 @@ A supported vehicle is one that just works when you install a comma three. All s |Jeep|Grand Cherokee 2016-18|Adaptive Cruise Control (ACC)|Stock|0 mph|9 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| |Jeep|Grand Cherokee 2019-21|Adaptive Cruise Control (ACC)|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| |Kia|Ceed 2019|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai E| +|Kia|EV6 (Southeast Asia only) 2022-23[5](#footnotes)|All|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai P| |Kia|EV6 (with HDA II) 2022[5](#footnotes)|Highway Driving Assist II|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai P| |Kia|EV6 (without HDA II) 2022[5](#footnotes)|Highway Driving Assist|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai L| |Kia|Forte 2019-21|Smart Cruise Control (SCC)|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai G| diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index 240c9b6000..a90797ae18 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -215,6 +215,7 @@ CAR_INFO: Dict[str, Optional[Union[HyundaiCarInfo, List[HyundaiCarInfo]]]] = { CAR.KIA_STINGER_2022: HyundaiCarInfo("Kia Stinger 2022", "All", harness=Harness.hyundai_k), CAR.KIA_CEED: HyundaiCarInfo("Kia Ceed 2019", harness=Harness.hyundai_e), CAR.KIA_EV6: [ + HyundaiCarInfo("Kia EV6 (Southeast Asia only) 2022-23", "All", harness=Harness.hyundai_p), HyundaiCarInfo("Kia EV6 (without HDA II) 2022", "Highway Driving Assist", harness=Harness.hyundai_l), HyundaiCarInfo("Kia EV6 (with HDA II) 2022", "Highway Driving Assist II", harness=Harness.hyundai_p) ], @@ -1454,6 +1455,7 @@ FW_VERSIONS = { b'\xf1\x00CV1 MFC AT USA LHD 1.00 1.06 99210-CV000 220328', b'\xf1\x00CV1 MFC AT EUR LHD 1.00 1.05 99210-CV000 211027', b'\xf1\x00CV1 MFC AT EUR LHD 1.00 1.06 99210-CV000 220328', + b'\xf1\x00CV1 MFC AT EUR RHD 1.00 1.00 99210-CV100 220630', ], }, CAR.IONIQ_5: { From 9743b37cf2b7c3b07a21c52b8be687659fb9b4bb Mon Sep 17 00:00:00 2001 From: royjr Date: Wed, 14 Dec 2022 18:51:24 -0500 Subject: [PATCH 05/11] Honda: set MINI_CAR when engaged (#26797) * Update hondacan.py * update refs Co-authored-by: Shane Smiskol --- selfdrive/car/honda/hondacan.py | 2 +- selfdrive/test/process_replay/ref_commit | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/honda/hondacan.py b/selfdrive/car/honda/hondacan.py index 6861198158..17681444af 100644 --- a/selfdrive/car/honda/hondacan.py +++ b/selfdrive/car/honda/hondacan.py @@ -111,7 +111,7 @@ def create_ui_commands(packer, CP, enabled, pcm_speed, hud, is_metric, acc_hud, if CP.openpilotLongitudinalControl: acc_hud_values = { 'CRUISE_SPEED': hud.v_cruise, - 'ENABLE_MINI_CAR': 1, + 'ENABLE_MINI_CAR': 1 if enabled else 0, 'HUD_DISTANCE': 0, # max distance setting on display 'IMPERIAL_UNIT': int(not is_metric), 'HUD_LEAD': 2 if enabled and hud.lead_visible else 1 if enabled else 0, diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 4f06673e97..f72e160ddb 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -67a4bd615017128ce04d0836608d2c7f32432e3e \ No newline at end of file +358d330ffde4ecd679129b0e0a20806aaf21b786 \ No newline at end of file From 8d95faf97a0717be33ec12f9039efd22fad36857 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 14 Dec 2022 17:17:25 -0800 Subject: [PATCH 06/11] nav: add README (#26802) * start docs * Update README.md --- selfdrive/navd/README.md | 24 +++++++++++++++++++ .../{ui/qt/maps => navd}/set_destination.py | 0 2 files changed, 24 insertions(+) create mode 100644 selfdrive/navd/README.md rename selfdrive/{ui/qt/maps => navd}/set_destination.py (100%) diff --git a/selfdrive/navd/README.md b/selfdrive/navd/README.md new file mode 100644 index 0000000000..6c7f7eabe3 --- /dev/null +++ b/selfdrive/navd/README.md @@ -0,0 +1,24 @@ +# navigation + +This directory contains two daemons, `navd` and `map_renderer`, 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 rendered map view over VisionIPC for the navigation model, which lives in `selfdrive/modeld/`. 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/ui/qt/maps/set_destination.py b/selfdrive/navd/set_destination.py similarity index 100% rename from selfdrive/ui/qt/maps/set_destination.py rename to selfdrive/navd/set_destination.py From be9a3fad377fbc6c0cd6d9a3c12f77fb0a3f299a Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 14 Dec 2022 18:48:39 -0800 Subject: [PATCH 07/11] nav: add setting for extra coordinates to specify route (#26803) --- common/params.cc | 1 + selfdrive/navd/navd.py | 20 ++++++++++++++++++-- selfdrive/navd/set_destination.py | 29 ++++++++++++++++++++++++++--- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/common/params.cc b/common/params.cc index 9e3e32d584..8f6532bc79 100644 --- a/common/params.cc +++ b/common/params.cc @@ -149,6 +149,7 @@ std::unordered_map keys = { {"LiveTorqueCarParams", PERSISTENT}, {"LiveTorqueParameters", PERSISTENT | DONT_LOG}, {"NavDestination", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_OFF}, + {"NavDestinationWaypoints", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_OFF}, {"NavSettingTime24h", PERSISTENT}, {"NavSettingLeftSide", PERSISTENT}, {"NavdRender", PERSISTENT}, diff --git a/selfdrive/navd/navd.py b/selfdrive/navd/navd.py index 4855b63594..277b84b927 100755 --- a/selfdrive/navd/navd.py +++ b/selfdrive/navd/navd.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +import json import math import os import threading @@ -135,12 +136,27 @@ class RouteEngine: '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;" + params['bearings'] = f"{(self.last_bearing + 360) % 360:.0f},90" + (';'*(len(coords)-1)) - url = self.mapbox_host + f'/directions/v5/mapbox/driving-traffic/{self.last_position.longitude},{self.last_position.latitude};{destination.longitude},{destination.latitude}' + 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() diff --git a/selfdrive/navd/set_destination.py b/selfdrive/navd/set_destination.py index b9721171cc..e6158dbdee 100755 --- a/selfdrive/navd/set_destination.py +++ b/selfdrive/navd/set_destination.py @@ -5,6 +5,29 @@ import sys from common.params import Params if __name__ == "__main__": - 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 = 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) From 2ac87a0a456ee4a2ffc66986c86e5c7e5d44f930 Mon Sep 17 00:00:00 2001 From: Jason Young <46612682+jyoung8607@users.noreply.github.com> Date: Thu, 15 Dec 2022 01:14:28 -0500 Subject: [PATCH 08/11] add German translation to release notes (#26806) --- RELEASES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASES.md b/RELEASES.md index 7d55887ec4..eea69d295f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2,6 +2,7 @@ Version 0.9.1 (2022-12-XX) ======================== * Adjust alert volume using ambient noise level * Removed driver monitoring timer resetting on interaction if face detected and distracted +* New German translation thanks to Vrabetz and CzokNorris! * Chevrolet Bolt EV 2022-23 support thanks to JasonJShuler! * Genesis GV60 2023 support thanks to sunnyhaibin! * Hyundai Tucson 2022-23 support From 951ceecadd555abac3eea67fe655ddc33dc48b1f Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 15 Dec 2022 10:38:44 -0800 Subject: [PATCH 09/11] navd: avoid re-routing back to past waypoints --- selfdrive/navd/navd.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/selfdrive/navd/navd.py b/selfdrive/navd/navd.py index 277b84b927..f2de9261ab 100755 --- a/selfdrive/navd/navd.py +++ b/selfdrive/navd/navd.py @@ -191,6 +191,10 @@ class RouteEngine: 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() From 08b4cff484940b394fa64d89dad65330bcb51a4a Mon Sep 17 00:00:00 2001 From: YassineYousfi Date: Thu, 15 Dec 2022 10:51:21 -0800 Subject: [PATCH 10/11] navd: recompute if far for > 3 steps (#26798) * navd: recompute if far for > 3 steps * typo * reset and unindent --- selfdrive/navd/navd.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/selfdrive/navd/navd.py b/selfdrive/navd/navd.py index f2de9261ab..81e3bdb3df 100755 --- a/selfdrive/navd/navd.py +++ b/selfdrive/navd/navd.py @@ -22,6 +22,7 @@ from system.swaglog import cloudlog REROUTE_DISTANCE = 25 MANEUVER_TRANSITION_THRESHOLD = 10 VALID_POS_STD = 50.0 +REROUTE_COUNTER_MIN = 3 class RouteEngine: @@ -48,6 +49,8 @@ class RouteEngine: self.ui_pid = None + self.reroute_counter = 0 + if "MAPBOX_TOKEN" in os.environ: self.mapbox_token = os.environ["MAPBOX_TOKEN"] self.mapbox_host = "https://api.mapbox.com" @@ -114,6 +117,7 @@ class RouteEngine: 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) @@ -305,8 +309,11 @@ class RouteEngine: min_d = min(min_d, minimum_distance(a, b, self.last_position)) - return min_d > REROUTE_DISTANCE - + 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 From 0fd8e6f491264500a22d80c106ad1f6d78e99dc9 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 15 Dec 2022 15:34:44 -0800 Subject: [PATCH 11/11] soundd: increase upper bound for volume level (#26811) Raise soundd upper limit --- selfdrive/ui/soundd/sound.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/ui/soundd/sound.cc b/selfdrive/ui/soundd/sound.cc index 21afd92b1c..49c28373c5 100644 --- a/selfdrive/ui/soundd/sound.cc +++ b/selfdrive/ui/soundd/sound.cc @@ -48,7 +48,7 @@ void Sound::update() { // scale volume using ambient noise level if (sm.updated("microphone")) { - float volume = util::map_val(sm["microphone"].getMicrophone().getFilteredSoundPressureWeightedDb(), 30.f, 56.f, 0.f, 1.f); + float volume = util::map_val(sm["microphone"].getMicrophone().getFilteredSoundPressureWeightedDb(), 30.f, 60.f, 0.f, 1.f); volume = QAudio::convertVolume(volume, QAudio::LogarithmicVolumeScale, QAudio::LinearVolumeScale); Hardware::set_volume(volume); }