From cbc73e55a21281200c032ced9295031b315fe53e Mon Sep 17 00:00:00 2001 From: Martin Lillepuu Date: Sat, 11 May 2019 13:42:19 +0300 Subject: [PATCH 1/8] add Openpilot lane line indicators to Subaru LKAS HUD --- panda/board/safety/safety_subaru.h | 1 + selfdrive/car/subaru/carcontroller.py | 4 ++-- selfdrive/car/subaru/interface.py | 3 ++- selfdrive/car/subaru/subarucan.py | 12 +++++++++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/panda/board/safety/safety_subaru.h b/panda/board/safety/safety_subaru.h index 5d2bd23d2..e5b2efbbe 100644 --- a/panda/board/safety/safety_subaru.h +++ b/panda/board/safety/safety_subaru.h @@ -116,6 +116,7 @@ static int subaru_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) { return -1; } // global platform + // ES LKAS if (addr == 0x122) { return -1; } diff --git a/selfdrive/car/subaru/carcontroller.py b/selfdrive/car/subaru/carcontroller.py index 98deb5646..9a098ea53 100644 --- a/selfdrive/car/subaru/carcontroller.py +++ b/selfdrive/car/subaru/carcontroller.py @@ -36,7 +36,7 @@ class CarController(object): print(DBC) self.packer = CANPacker(DBC[car_fingerprint]['pt']) - def update(self, sendcan, enabled, CS, frame, actuators, pcm_cancel_cmd, visual_alert): + def update(self, sendcan, enabled, CS, frame, actuators, pcm_cancel_cmd, visual_alert, left_line, right_line): """ Controls thread """ P = self.params @@ -70,7 +70,7 @@ class CarController(object): self.es_distance_cnt = CS.es_distance_msg["Counter"] if self.es_lkas_cnt != CS.es_lkas_msg["Counter"]: - can_sends.append(subarucan.create_es_lkas(self.packer, CS.es_lkas_msg, visual_alert)) + can_sends.append(subarucan.create_es_lkas(self.packer, CS.es_lkas_msg, visual_alert, left_line, right_line)) self.es_lkas_cnt = CS.es_lkas_msg["Counter"] sendcan.send(can_list_to_can_capnp(can_sends, msgtype='sendcan')) diff --git a/selfdrive/car/subaru/interface.py b/selfdrive/car/subaru/interface.py index 8de0760b4..077f591a1 100644 --- a/selfdrive/car/subaru/interface.py +++ b/selfdrive/car/subaru/interface.py @@ -217,5 +217,6 @@ class CarInterface(object): def apply(self, c): self.CC.update(self.sendcan, c.enabled, self.CS, self.frame, c.actuators, - c.cruiseControl.cancel, c.hudControl.visualAlert) + c.cruiseControl.cancel, c.hudControl.visualAlert, + c.hudControl.leftLaneVisible, c.hudControl.rightLaneVisible) self.frame += 1 diff --git a/selfdrive/car/subaru/subarucan.py b/selfdrive/car/subaru/subarucan.py index 5e17cd72c..af2e2598e 100644 --- a/selfdrive/car/subaru/subarucan.py +++ b/selfdrive/car/subaru/subarucan.py @@ -43,12 +43,22 @@ def create_es_distance(packer, es_distance_msg, pcm_cancel_cmd): return packer.make_can_msg("ES_Distance", 0, values) -def create_es_lkas(packer, es_lkas_msg, visual_alert): +def create_es_lkas(packer, es_lkas_msg, visual_alert, left_line, right_line): values = copy.copy(es_lkas_msg) if visual_alert == VisualAlert.steerRequired: values["Keep_Hands_On_Wheel"] = 1 + if left_line: + values["LKAS_Left_Line_Visible"] = 1 + else: + values["LKAS_Left_Line_Visible"] = 0 + + if right_line: + values["LKAS_Right_Line_Visible"] = 1 + else: + values["LKAS_Right_Line_Visible"] = 0 + values["Checksum"] = subaru_checksum(packer, values, 802) return packer.make_can_msg("ES_LKAS_State", 0, values) From 25d43fe15ead4714e54c7d7bdb30462a20c53f65 Mon Sep 17 00:00:00 2001 From: Martin Lillepuu Date: Sun, 26 May 2019 11:13:39 +0300 Subject: [PATCH 2/8] Add subaru dash lane lines --- panda/board/safety/safety_subaru.h | 1 - selfdrive/car/subaru/subarucan.py | 11 ++--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/panda/board/safety/safety_subaru.h b/panda/board/safety/safety_subaru.h index e5b2efbbe..5d2bd23d2 100644 --- a/panda/board/safety/safety_subaru.h +++ b/panda/board/safety/safety_subaru.h @@ -116,7 +116,6 @@ static int subaru_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) { return -1; } // global platform - // ES LKAS if (addr == 0x122) { return -1; } diff --git a/selfdrive/car/subaru/subarucan.py b/selfdrive/car/subaru/subarucan.py index af2e2598e..922012f31 100644 --- a/selfdrive/car/subaru/subarucan.py +++ b/selfdrive/car/subaru/subarucan.py @@ -49,15 +49,8 @@ def create_es_lkas(packer, es_lkas_msg, visual_alert, left_line, right_line): if visual_alert == VisualAlert.steerRequired: values["Keep_Hands_On_Wheel"] = 1 - if left_line: - values["LKAS_Left_Line_Visible"] = 1 - else: - values["LKAS_Left_Line_Visible"] = 0 - - if right_line: - values["LKAS_Right_Line_Visible"] = 1 - else: - values["LKAS_Right_Line_Visible"] = 0 + values["LKAS_Left_Line_Visible"] = int(left_line) + values["LKAS_Right_Line_Visible"] = int(right_line) values["Checksum"] = subaru_checksum(packer, values, 802) From 1b3b260b4d191745a5893abfd11b76a38e035e47 Mon Sep 17 00:00:00 2001 From: Arne Schwarck Date: Wed, 29 May 2019 01:16:32 +0200 Subject: [PATCH 3/8] Update mapd.py (#672) --- selfdrive/mapd/mapd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/mapd/mapd.py b/selfdrive/mapd/mapd.py index d3c82bf40..b123fc68b 100755 --- a/selfdrive/mapd/mapd.py +++ b/selfdrive/mapd/mapd.py @@ -240,7 +240,7 @@ def mapsd_thread(): if cur_way is not None: dat.liveMapData.wayId = cur_way.id - # Seed limit + # Speed limit max_speed = cur_way.max_speed() if max_speed is not None: dat.liveMapData.speedLimitValid = True From b686ca87d37c0b1af9d539bcae4256f74ac17fe6 Mon Sep 17 00:00:00 2001 From: Riccardo Date: Tue, 28 May 2019 17:12:49 -0700 Subject: [PATCH 4/8] Fingeprint script: better instructions --- selfdrive/debug/get_fingerprint.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/selfdrive/debug/get_fingerprint.py b/selfdrive/debug/get_fingerprint.py index c46e84970..ed877ff50 100755 --- a/selfdrive/debug/get_fingerprint.py +++ b/selfdrive/debug/get_fingerprint.py @@ -6,8 +6,10 @@ # - connect to a Panda # - run selfdrive/boardd/boardd # - launching this script -# - since some messages are published at low frequency, keep this script running for few -# seconds, until all messages are received at least once +# - turn on the car in STOCK MODE (set giraffe switches properly). +# Note: it's very important that the car is in stock mode, in order to collect a complete fingerprint +# - since some messages are published at low frequency, keep this script running for at least 30s, +# until all messages are received at least once import zmq import selfdrive.messaging as messaging From 56b2945de44183286f29d8106e525167fd3d2f83 Mon Sep 17 00:00:00 2001 From: raf Date: Thu, 30 May 2019 22:25:10 -0400 Subject: [PATCH 5/8] Fix registration's params get_git_remote() --- selfdrive/registration.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/selfdrive/registration.py b/selfdrive/registration.py index 9b7e6964e..8ec0a2100 100644 --- a/selfdrive/registration.py +++ b/selfdrive/registration.py @@ -22,7 +22,9 @@ def get_git_branch(): return subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).strip() def get_git_remote(): - return subprocess.check_output(["git", "config", "--get", "remote.origin.url"]).strip() + local_branch = subprocess.check_output(["git", "name-rev", "--name-only", "HEAD"]).strip() + tracking_remote = subprocess.check_output(["git", "config", "branch."+local_branch+".remote"]).strip() + return subprocess.check_output(["git", "config", "remote."+tracking_remote+".url"]).strip() def register(): params = Params() From 9278fad15c82ea88b8d9c36e423568b8b4531962 Mon Sep 17 00:00:00 2001 From: ChaseCares <13863948+ChaseCares@users.noreply.github.com> Date: Fri, 31 May 2019 19:47:07 -0400 Subject: [PATCH 6/8] Add 2019 RAV4 XLE fingerprints (#671) * Add 2019 RAV4 XLE fingerprints --- selfdrive/car/toyota/values.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index 52e3d1510..d1da58792 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -147,8 +147,14 @@ FINGERPRINTS = { CAR.AVALON: [{ 36: 8, 37: 8, 170: 8, 180: 8, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 547: 8, 550: 8, 552: 4, 562: 6, 608: 8, 610: 5, 643: 7, 705: 8, 740: 5, 800: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 897: 8, 905: 8, 911: 1, 916: 2, 921: 8, 933: 6, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 979: 2, 1005: 2, 1014: 8, 1017: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1059: 1, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1190: 8, 1191: 8, 1192: 8, 1196: 8, 1200: 8, 1201: 8, 1202: 8, 1203: 8, 1206: 8, 1227: 8, 1235: 8, 1237: 8, 1264: 8, 1279: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1558: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1596: 8, 1597: 8, 1664: 8, 1728: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 }], - CAR.RAV4_2019: [{ + CAR.RAV4_2019: [ + # LE + { 36: 8, 37: 8, 170: 8, 180: 8, 186: 4, 355: 5, 401: 8, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 550: 8, 552: 4, 562: 6, 565: 8, 608: 8, 610: 8, 643: 7, 705: 8, 728: 8, 740: 5, 742: 8, 743: 8, 761: 8, 764: 8, 765: 8, 800: 8, 810: 2, 812: 8, 824: 8, 829: 2, 830: 7, 835: 8, 836: 8, 865: 8, 869: 7, 870: 7, 871: 2, 877: 8, 881: 8, 882: 8, 885: 8, 896: 8, 898: 8, 900: 6, 902: 6, 905: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 976: 1, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1059: 1, 1063: 8, 1076: 8, 1077: 8,1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1172: 8, 1235: 8, 1279: 8, 1541: 8, 1552: 8, 1553:8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1594: 8, 1595: 8, 1649: 8, 1745: 8, 1775: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 + }, + # XLE + { + 36: 8, 37: 8, 170: 8, 180: 8, 186: 4, 401: 8, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 550: 8, 552: 4, 562: 6, 565: 8, 608: 8, 610: 8, 643: 7, 705: 8, 728: 8, 740: 5, 742: 8, 743: 8, 761: 8, 764: 8, 765: 8, 800: 8, 810: 2, 812: 8, 824: 8, 829: 2, 830: 7, 835: 8, 836: 8, 865: 8, 869: 7, 870: 7, 871: 2, 877: 8, 881: 8, 882: 8, 885: 8, 896: 8, 898: 8, 900: 6, 902: 6, 905: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 976: 1, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1059: 1, 1063: 8, 1076: 8, 1077: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1172: 8, 1235: 8, 1237: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1594: 8, 1595: 8, 1649: 8, 1745: 8, 1775: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 }], CAR.COROLLA_HATCH: [{ 36: 8, 37: 8, 114: 5, 170: 8, 180: 8, 186: 4, 401: 8, 426: 6, 452: 8 , 464: 8, 466: 8, 467: 8, 544: 4, 550: 8, 552: 4, 562: 6, 608: 8, 610: 8, 643: 7 , 705: 8, 728: 8, 740: 5, 742: 8, 743: 8, 761: 8, 764: 8, 765: 8, 800: 8, 810: 2, 812: 8, 824: 8, 829: 2, 830: 7, 835: 8, 836: 8, 865: 8, 869: 7, 870: 7, 871: 2, 877: 8, 881: 8, 896: 8, 898: 8, 900: 6, 902: 6, 905: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 976: 1, 998: 5, 999: 7, 1000:8, 1001: 8, 1002: 8, 1017:8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1059:1, 1076: 8, 1077: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1172: 8, 1235: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1595: 8, 1745: 8, 1775: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 From 7ada2abca0452dce5942888cbe0443dfa4b8a869 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Fri, 31 May 2019 17:32:43 -0700 Subject: [PATCH 7/8] Revert "Fix registration's params get_git_remote()" (#674) --- selfdrive/registration.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/selfdrive/registration.py b/selfdrive/registration.py index 8ec0a2100..9b7e6964e 100644 --- a/selfdrive/registration.py +++ b/selfdrive/registration.py @@ -22,9 +22,7 @@ def get_git_branch(): return subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).strip() def get_git_remote(): - local_branch = subprocess.check_output(["git", "name-rev", "--name-only", "HEAD"]).strip() - tracking_remote = subprocess.check_output(["git", "config", "branch."+local_branch+".remote"]).strip() - return subprocess.check_output(["git", "config", "remote."+tracking_remote+".url"]).strip() + return subprocess.check_output(["git", "config", "--get", "remote.origin.url"]).strip() def register(): params = Params() From 65e1342e41d2cdc21e4651a7d18610863e1fb0b3 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Sat, 1 Jun 2019 20:03:10 -0400 Subject: [PATCH 8/8] Correct typos (#677) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit “thansk” to “thanks” --- RELEASES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 3799ad3c6..0ae93ba2b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -9,8 +9,8 @@ Version 0.5.12 (2019-05-16) * Add default speed limits for Estonia thanks to martinl! * Subaru Crosstrek support thanks to martinl! * Toyota Avalon support thanks to njbrown09! - * Toyota Rav4 with TSS 2.0 support thansk to wocsor! - * Toyota Corolla with TSS 2.0 support thansk to wocsor! + * Toyota Rav4 with TSS 2.0 support thanks to wocsor! + * Toyota Corolla with TSS 2.0 support thanks to wocsor! Version 0.5.11 (2019-04-17) ========================