From 5be53a39f05339c95a5bfcc2ea9b95bb9ba1a65b Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 16 Sep 2024 15:47:59 -0700 Subject: [PATCH] Cruise speed: 0 is considered unset (#33449) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * give 10 frames of tolerance to reset -- WARNING: hacks inside old-commit-hash: d72ac9e53d211074b059f049f8ebc89b9cff1c58 * comment old-commit-hash: adf1ef88b692132c37d865fc973189fdf971464f * more conventional old-commit-hash: 552aa2c159fc535682d098425e827d8cb56911c1 * move old-commit-hash: fe88ac0afc5aa7438d5b36908744124bc1cb68c9 * oh tf old-commit-hash: 98d8659bd0f61dd512693807ea29d2f0c78f7514 * better old-commit-hash: 5ddda806a008cc189758491f91a4a4d0aeb8d343 * this is fine 🔥 * INIT NOT UNINIT * only vCruise changes here * update refs --- selfdrive/car/cruise.py | 3 +++ selfdrive/test/process_replay/ref_commit | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/cruise.py b/selfdrive/car/cruise.py index e2d83033d6..b92d0c7465 100644 --- a/selfdrive/car/cruise.py +++ b/selfdrive/car/cruise.py @@ -53,6 +53,9 @@ class VCruiseHelper: else: self.v_cruise_kph = CS.cruiseState.speed * CV.MS_TO_KPH self.v_cruise_cluster_kph = CS.cruiseState.speedCluster * CV.MS_TO_KPH + if CS.cruiseState.speed == 0: + self.v_cruise_kph = V_CRUISE_UNSET + self.v_cruise_cluster_kph = V_CRUISE_UNSET else: self.v_cruise_kph = V_CRUISE_UNSET self.v_cruise_cluster_kph = V_CRUISE_UNSET diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index 49d920fe2a..e08f65f499 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -13d947375a5908d68b33bf3b51b799f8021a35a6 \ No newline at end of file +dbaa29106eb93267699c822e4937126b4307805a \ No newline at end of file