From 81a1601f3cf40d670b3d7393b19725c7b1c71e1c Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Wed, 31 Jul 2019 18:17:19 -0700 Subject: [PATCH 1/5] 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/5] 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/5] 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/5] 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/5] 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,