From 5808958fb2618d35dbe320472603392e2ea9a805 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 1f1893a1704c8925d781750b47144b57d9e97fea 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 d5242c5b8274c443a88dc4a33e242808a08ff2af 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 1f1893a1704c8925d781750b47144b57d9e97fea. --- 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 fd71fe698c2e254f8c89425bdc980092262b3a5f 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 095ef5f9f60fca1b269aabcc3cfd322b17b9e674 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 d5242c5b8274c443a88dc4a33e242808a08ff2af. --- 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,