From 81a1601f3cf40d670b3d7393b19725c7b1c71e1c Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Wed, 31 Jul 2019 18:17:19 -0700 Subject: [PATCH 1/7] Fix timeout in longitudinal test (#772) * Fix timeout in longitudinal test --- selfdrive/controls/controlsd.py | 4 +++- selfdrive/test/tests/plant/test_longitudinal.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 11844556c..55ad2093a 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +import os import gc import capnp from cereal import car, log @@ -440,7 +441,8 @@ def controlsd_thread(gctx=None): logcan.close() # TODO: Use the logcan socket from above, but that will currenly break the tests - can_sock = messaging.sub_sock(service_list['can'].port, timeout=100) + can_timeout = None if os.environ.get('NO_CAN_TIMEOUT', False) else 100 + can_sock = messaging.sub_sock(service_list['can'].port, timeout=can_timeout) car_recognized = CP.carName != 'mock' # If stock camera is disconnected, we loaded car controls and it's not chffrplus diff --git a/selfdrive/test/tests/plant/test_longitudinal.py b/selfdrive/test/tests/plant/test_longitudinal.py index 1f30938ac..09e81b2a1 100755 --- a/selfdrive/test/tests/plant/test_longitudinal.py +++ b/selfdrive/test/tests/plant/test_longitudinal.py @@ -325,6 +325,7 @@ def setup_output(): class LongitudinalControl(unittest.TestCase): @classmethod def setUpClass(cls): + os.environ['NO_CAN_TIMEOUT'] = "1" setup_output() From 958f69608ccfbec7c7251401e5a59e185d9fb572 Mon Sep 17 00:00:00 2001 From: TK211X <33460783+TK211X@users.noreply.github.com> Date: Thu, 1 Aug 2019 15:34:19 -0400 Subject: [PATCH 2/7] Update hyundaican for Correct Message ID on LKAS11 (#746) This is the only trace of CF_Lkas_Icon found under /car/hyundai relative to open .dbc https://github.com/commaai/opendbc/pull/172 --- selfdrive/car/hyundai/hyundaican.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/hyundai/hyundaican.py b/selfdrive/car/hyundai/hyundaican.py index 5a895497a..d9e7cf3a9 100644 --- a/selfdrive/car/hyundai/hyundaican.py +++ b/selfdrive/car/hyundai/hyundaican.py @@ -8,7 +8,7 @@ def make_can_msg(addr, dat, alt): def create_lkas11(packer, car_fingerprint, apply_steer, steer_req, cnt, enabled, lkas11, hud_alert, keep_stock=False): values = { - "CF_Lkas_Icon": 3 if enabled else 0, + "CF_Lkas_Bca_R": 3 if enabled else 0, "CF_Lkas_LdwsSysState": 3 if steer_req else 1, "CF_Lkas_SysWarning": hud_alert, "CF_Lkas_LdwsLHWarning": lkas11["CF_Lkas_LdwsLHWarning"] if keep_stock else 0, From 5d1e7ddbc2453d39449663fe5342b8abd526af0d Mon Sep 17 00:00:00 2001 From: rbiasini Date: Thu, 1 Aug 2019 12:35:24 -0700 Subject: [PATCH 3/7] Revert "Update hyundaican for Correct Message ID on LKAS11 (#746)" (#775) This reverts commit 958f69608ccfbec7c7251401e5a59e185d9fb572. --- selfdrive/car/hyundai/hyundaican.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/hyundai/hyundaican.py b/selfdrive/car/hyundai/hyundaican.py index d9e7cf3a9..5a895497a 100644 --- a/selfdrive/car/hyundai/hyundaican.py +++ b/selfdrive/car/hyundai/hyundaican.py @@ -8,7 +8,7 @@ def make_can_msg(addr, dat, alt): def create_lkas11(packer, car_fingerprint, apply_steer, steer_req, cnt, enabled, lkas11, hud_alert, keep_stock=False): values = { - "CF_Lkas_Bca_R": 3 if enabled else 0, + "CF_Lkas_Icon": 3 if enabled else 0, "CF_Lkas_LdwsSysState": 3 if steer_req else 1, "CF_Lkas_SysWarning": hud_alert, "CF_Lkas_LdwsLHWarning": lkas11["CF_Lkas_LdwsLHWarning"] if keep_stock else 0, From 97bfc183efb85cdb34628db153f3eb542c48952b Mon Sep 17 00:00:00 2001 From: TK211X <33460783+TK211X@users.noreply.github.com> Date: Thu, 1 Aug 2019 15:43:50 -0400 Subject: [PATCH 4/7] Correct Message ID on LKAS11 under Openpilot .dbc (#747) https://github.com/commaai/opendbc/pull/172 --- opendbc/hyundai_kia_generic.dbc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/hyundai_kia_generic.dbc b/opendbc/hyundai_kia_generic.dbc index e3e6a1eb6..bb1c06e09 100644 --- a/opendbc/hyundai_kia_generic.dbc +++ b/opendbc/hyundai_kia_generic.dbc @@ -961,7 +961,7 @@ BO_ 64 DATC14: 8 DATC SG_ DATC_ADSDisp : 28|2@1+ (1.0,0.0) [0.0|3.0] "" CLU BO_ 832 LKAS11: 8 LDWS_LKAS - SG_ CF_Lkas_Icon : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,IBOX,PSB + SG_ CF_Lkas_Bca_R : 0|2@1+ (1.0,0.0) [0.0|3.0] "" CLU,IBOX,PSB SG_ CF_Lkas_LdwsSysState : 2|4@1+ (1.0,0.0) [0.0|15.0] "" CLU,IBOX,PSB SG_ CF_Lkas_SysWarning : 6|4@1+ (1.0,0.0) [0.0|15.0] "" BCM,CLU SG_ CF_Lkas_LdwsLHWarning : 10|2@1+ (1.0,0.0) [0.0|3.0] "" BCM,CLU,PSB From f72db32d6efc86a409f087544bfa64e4e701c9de Mon Sep 17 00:00:00 2001 From: Riccardo Date: Thu, 1 Aug 2019 12:44:41 -0700 Subject: [PATCH 5/7] Revert "Revert "Update hyundaican for Correct Message ID on LKAS11 (#746)" (#775)" This reverts commit 5d1e7ddbc2453d39449663fe5342b8abd526af0d. --- selfdrive/car/hyundai/hyundaican.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/hyundai/hyundaican.py b/selfdrive/car/hyundai/hyundaican.py index 5a895497a..d9e7cf3a9 100644 --- a/selfdrive/car/hyundai/hyundaican.py +++ b/selfdrive/car/hyundai/hyundaican.py @@ -8,7 +8,7 @@ def make_can_msg(addr, dat, alt): def create_lkas11(packer, car_fingerprint, apply_steer, steer_req, cnt, enabled, lkas11, hud_alert, keep_stock=False): values = { - "CF_Lkas_Icon": 3 if enabled else 0, + "CF_Lkas_Bca_R": 3 if enabled else 0, "CF_Lkas_LdwsSysState": 3 if steer_req else 1, "CF_Lkas_SysWarning": hud_alert, "CF_Lkas_LdwsLHWarning": lkas11["CF_Lkas_LdwsLHWarning"] if keep_stock else 0, From a0e5e385d7b53237a6bc8d49ea8f7300a9e2c41e Mon Sep 17 00:00:00 2001 From: Dragonpilot Date: Fri, 2 Aug 2019 09:17:14 +1000 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8C=87=E7=B4=8B?= =?UTF-8?q?=E6=9A=AB=E5=AD=98=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- selfdrive/car/car_helpers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 14154a384..8bc7bf162 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -124,9 +124,10 @@ def fingerprint(logcan, sendcan, is_panda_black): frame += 1 - params.put("DragonCachedModel", pickle.dumps(car_fingerprint)) - params.put("DragonCachedFP", pickle.dumps(finger)) - params.put("DragonCachedVIN", pickle.dumps(vin)) + if succeeded: + params.put("DragonCachedModel", pickle.dumps(car_fingerprint)) + params.put("DragonCachedFP", pickle.dumps(finger)) + params.put("DragonCachedVIN", pickle.dumps(vin)) cloudlog.warning("fingerprinted %s", car_fingerprint) return car_fingerprint, finger, vin From 06a4ca837ed55c74b2bd00654d546d47c564d250 Mon Sep 17 00:00:00 2001 From: Dragonpilot Date: Fri, 2 Aug 2019 09:18:07 +1000 Subject: [PATCH 7/7] =?UTF-8?q?=E5=9B=9E=E5=82=B3=E6=8C=87=E7=B4=8B?= =?UTF-8?q?=E5=88=B0=20sentry.io?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- selfdrive/car/car_helpers.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 8bc7bf162..d74892993 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -7,6 +7,7 @@ from common.fingerprints import eliminate_incompatible_cars, all_known_cars from selfdrive.swaglog import cloudlog import selfdrive.messaging as messaging import pickle +import selfdrive.crash as crash def get_startup_alert(car_recognized, controller_available): @@ -140,6 +141,12 @@ def get_car(logcan, sendcan, is_panda_black=False): if candidate is None: cloudlog.warning("car doesn't match any fingerprints: %r", fingerprints) candidate = "mock" + else: + cloudlog.warning("car does match fingerprint: %r", fingerprints) + try: + crash.capture_warning("fingerprinted %s" % candidate) + except: # fixes occasional travis errors + pass CarInterface, CarController = interfaces[candidate] car_params = CarInterface.get_params(candidate, fingerprints[0], vin, is_panda_black)