diff --git a/README.md b/README.md index 256271eebc710a..7af20f07b3fff9 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,9 @@ Supported Cars - Honda Odyssey 2018 with Honda Sensing (alpha!) - Can only be enabled above 25 mph +- Acura RDX 2018 with AcuraWatch Plus (alpha!) + - Can only be enabled above 25 mph + - Toyota RAV-4 2016+ non-hybrid with TSS-P - By default it uses stock Toyota ACC for longitudinal control - openpilot longitudinal control available after unplugging the [Driving Support ECU](https://community.comma.ai/wiki/index.php/Toyota#Rav4_.28for_openpilot.29) and can be enabled above 20 mph @@ -49,11 +52,18 @@ Supported Cars - By default it uses stock Toyota ACC for longitudinal control - openpilot longitudinal control available after unplugging the [Driving Support ECU](https://community.comma.ai/wiki/index.php/Toyota#Corolla_.28for_openpilot.29) and can be enabled above 20 mph +- Lexus RX 2017 hybrid (alpha!) + - By default it uses stock Lexus ACC for longitudinal control + - openpilot longitudinal control available after unplugging the [Driving Support ECU](https://community.comma.ai/wiki/index.php/Toyota#Lexus_RX_hybrid) + In Progress Cars ------ -- Probably all TSS-P Toyota with Steering Assist. +- All TSS-P Toyota with Steering Assist. - 'Full Speed Range Dynamic Radar Cruise Control' is required to enable stop-and-go. Only the Prius, Camry and C-HR have this option. - Even though the Tundra, Sequoia and the Land Cruiser have TSS-P, they don't have Steering Assist and are not supported. +- All LSS-P Lexus with Steering Assist or Lane Keep Assist. + - 'All-Speed Range Dynamic Radar Cruise Control' is required to enable stop-and-go. Only the GS, GSH, GS, F, RX, RXH, LX, NX, NXH, LC, LCH, LS, LSH have this option. + - Even though the LX have TSS-P, it does not have Steering Assist and is not supported. Community WIP Cars ------ @@ -64,8 +74,6 @@ Community WIP Cars - [Honda Pilot 2017 with Honda Sensing](https://github.com/commaai/openpilot/pull/161) -- [Acura RDX 2018 with AcuraWatch Plus](https://github.com/commaai/openpilot/pull/162) - Directory structure ------ diff --git a/RELEASES.md b/RELEASES.md index 4e0c81fe84a429..1acd4fc8fb4aaa 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,8 +1,17 @@ +Version 0.4.2 (2018-02-05) +========================== + * Add alpha support for 2017 Lexus RX Hybrid + * Add alpha support for 2018 ACURA RDX + * Updated fingerprint to include Toyota Rav4 SE and Prius Prime + * Bugfixes for Acura ILX and Honda Odyssey + Version 0.4.1 (2018-01-30) ========================== * Add alpha support for 2017 Toyota Corolla + * Add alpha support for 2018 Honda Odyssey with Honda Sensing * Add alpha support for Grey Panda * Refactored car abstraction layer to make car ports easier + * Increased steering torque limit on Honda CR-V by 30% Version 0.4.0.2 (2018-01-18) ========================== diff --git a/SAFETY.md b/SAFETY.md index 125705ad0447e7..0c8ae7e51eeb9a 100644 --- a/SAFETY.md +++ b/SAFETY.md @@ -42,7 +42,7 @@ Honda/Acura - Honda CAN uses both a counter and a checksum to ensure integrity and prevent replay of the same message. -Toyota +Toyota/Lexus ------ - While the system is engaged, gas, brake and steer limits are subject to the same limits used by @@ -59,7 +59,7 @@ Toyota software to a value of -1500 and 1500. In addition, the vehicle EPS unit will not respond to commands outside these limits. A steering torque rate limit is enforced by the board and in software so that the commanded steering torque must rise from 0 to max value no faster than - 1.5s. Commanded steering torque is limited by the board and in software to be no more than 500 + 1.5s. Commanded steering torque is limited by the board and in software to be no more than 350 units above the actual EPS generated motor torque to ensure limited differences between commanded and actual torques. diff --git a/common/dbc.py b/common/dbc.py index 8be1eed13cdffa..cc914f9d6b189b 100755 --- a/common/dbc.py +++ b/common/dbc.py @@ -214,8 +214,6 @@ def get_signals(self, msg): return [sgs.name for sgs in self.msgs[msg][1]] if __name__ == "__main__": - import sys - import os from opendbc import DBC_PATH dbc_test = dbc(os.path.join(DBC_PATH, sys.argv[1])) diff --git a/common/fingerprints.py b/common/fingerprints.py index 462c33b57eca32..1e0c71da47162f 100644 --- a/common/fingerprints.py +++ b/common/fingerprints.py @@ -3,6 +3,7 @@ class HONDA: ACURA_ILX = "ACURA ILX 2016 ACURAWATCH PLUS" CRV = "HONDA CR-V 2016 TOURING" ODYSSEY = "HONDA ODYSSEY 2018 EX-L" + ACURA_RDX = "ACURA RDX 2018 ACURAWATCH PLUS" class TOYOTA: @@ -10,6 +11,7 @@ class TOYOTA: RAV4H = "TOYOTA RAV4 2017 HYBRID" RAV4 = "TOYOTA RAV4 2017" COROLLA = "TOYOTA COROLLA 2017" + LEXUS_RXH = "LEXUS RX HYBRID 2017" _FINGERPRINTS = { @@ -18,6 +20,9 @@ class TOYOTA: # sent messages 0xe4: 5, 0x1fa: 8, 0x200: 3, 0x30c: 8, 0x33d: 5, }, + HONDA.ACURA_RDX: { + 57L: 3, 145L: 8, 229L: 4, 308L: 5, 316L: 8, 342L: 6, 344L: 8, 380L: 8, 392L: 6, 398L: 3, 399L: 6, 404L: 4, 420L: 8, 422L: 8, 426L: 8, 432L: 7, 464L: 8, 474L: 5, 476L: 4, 487L: 4, 490L: 8, 506L: 8, 542L: 7, 545L: 4, 597L: 8, 660L: 8, 773L: 7, 777L: 8, 780L: 8, 800L: 8, 804L: 8, 808L: 8, 819L: 7, 821L: 5, 829L: 5, 882L: 2, 884L: 7, 887L: 8, 888L: 8, 892L: 8, 923L: 2, 929L: 4, 963L: 8, 965L: 8, 966L: 8, 967L: 8, 983L: 8, 985L: 3, 1024L: 5, 1027L: 5, 1029L: 8, 1033L: 5, 1034L: 5, 1036L: 8, 1039L: 8, 1057L: 5, 1064L: 7, 1108L: 8, 1365L: 5, 1424L: 5, 1729L: 1 + }, HONDA.CIVIC: { 1024L: 5, 513L: 5, 1027L: 5, 1029L: 8, 777L: 8, 1036L: 8, 1039L: 8, 1424L: 5, 401L: 8, 148L: 8, 662L: 4, 985L: 3, 795L: 8, 773L: 7, 800L: 8, 545L: 6, 420L: 8, 806L: 8, 808L: 8, 1322L: 5, 427L: 3, 428L: 8, 304L: 8, 432L: 7, 57L: 3, 450L: 8, 929L: 8, 330L: 8, 1302L: 8, 464L: 8, 1361L: 5, 1108L: 8, 597L: 8, 470L: 2, 344L: 8, 804L: 8, 399L: 7, 476L: 7, 1633L: 8, 487L: 4, 892L: 8, 490L: 8, 493L: 5, 884L: 8, 891L: 8, 380L: 8, 1365L: 5, # sent messages @@ -32,10 +37,10 @@ class TOYOTA: 57L: 3, 148L: 8, 228L: 5, 229L: 4, 316L: 8, 342L: 6, 344L: 8, 380L: 8, 399L: 7, 411L: 5, 419L: 8, 420L: 8, 427L: 3, 432L: 7, 450L: 8, 463L: 8, 464L: 8, 476L: 4, 490L: 8, 506L: 8, 542L: 7, 545L: 6, 597L: 8, 662L: 4, 773L: 7, 777L: 8, 780L: 8, 795L: 8, 800L: 8, 804L: 8, 806L: 8, 808L: 8, 817L: 4, 819L: 7, 821L: 5, 825L: 4, 829L: 5, 837L: 5, 856L: 7, 862L: 8, 871L: 8, 881L: 8, 882L: 4, 884L: 8, 891L: 8, 892L: 8, 905L: 8, 923L: 2, 927L: 8, 929L: 8, 963L: 8, 965L: 8, 966L: 8, 967L: 8, 983L: 8, 985L: 3, 1029L: 8, 1036L: 8, 1052L: 8, 1064L: 7, 1088L: 8, 1089L: 8, 1092L: 1, 1108L: 8, 1110L: 8, 1125L: 8, 1296L: 8, 1302L: 8, 1600L: 5, 1601L: 8, 1612L: 5, 1613L: 5, 1614L: 5, 1615L: 8, 1616L: 5, 1619L: 5, 1623L: 5, 1668L: 5 }, TOYOTA.RAV4: { - 36L: 8, 37L: 8, 170L: 8, 180L: 8, 186L: 4, 426L: 6, 452L: 8, 464L: 8, 466L: 8, 467L: 8, 547L: 8, 548L: 8, 552L: 4, 562L: 4, 608L: 8, 610L: 5, 643L: 7, 705L: 8, 725L: 2, 740L: 5, 800L: 8, 835L: 8, 836L: 8, 849L: 4, 869L: 7, 870L: 7, 871L: 2, 896L: 8, 897L: 8, 900L: 6, 902L: 6, 905L: 8, 911L: 8, 916L: 3, 918L: 7, 921L: 8, 933L: 8, 944L: 8, 945L: 8, 951L: 8, 955L: 4, 956L: 8, 979L: 2, 998L: 5, 999L: 7, 1000L: 8, 1001L: 8, 1008L: 2, 1014L: 8, 1017L: 8, 1041L: 8, 1042L: 8, 1043L: 8, 1044L: 8, 1056L: 8, 1059L: 1, 1114L: 8, 1161L: 8, 1162L: 8, 1163L: 8, 1176L: 8, 1177L: 8, 1178L: 8, 1179L: 8, 1180L: 8, 1181L: 8, 1190L: 8, 1191L: 8, 1192L: 8, 1196L: 8, 1227L: 8, 1228L: 8, 1235L: 8, 1237L: 8, 1263L: 8, 1279L: 8, 1408L: 8, 1409L: 8, 1410L: 8, 1552L: 8, 1553L: 8, 1554L: 8, 1555L: 8, 1556L: 8, 1557L: 8, 1561L: 8, 1562L: 8, 1568L: 8, 1569L: 8, 1570L: 8, 1571L: 8, 1572L: 8, 1584L: 8, 1589L: 8, 1592L: 8, 1593L: 8, 1595L: 8, 1596L: 8, 1597L: 8, 1600L: 8, 1656L: 8, 1664L: 8, 1728L: 8, 1745L: 8, 1779L: 8, 1904L: 8, 1912L: 8, 1990L: 8, 1998L: 8 + 36L: 8, 37L: 8, 170L: 8, 180L: 8, 186L: 4, 426L: 6, 452L: 8, 464L: 8, 466L: 8, 467L: 8, 547L: 8, 548L: 8, 552L: 4, 562L: 4, 608L: 8, 610L: 5, 643L: 7, 705L: 8, 725L: 2, 740L: 5, 800L: 8, 835L: 8, 836L: 8, 849L: 4, 869L: 7, 870L: 7, 871L: 2, 896L: 8, 897L: 8, 900L: 6, 902L: 6, 905L: 8, 911L: 8, 916L: 3, 918L: 7, 921L: 8, 933L: 8, 944L: 8, 945L: 8, 951L: 8, 955L: 4, 956L: 8, 979L: 2, 998L: 5, 999L: 7, 1000L: 8, 1001L: 8, 1005L: 2, 1008L: 2, 1014L: 8, 1017L: 8, 1041L: 8, 1042L: 8, 1043L: 8, 1044L: 8, 1056L: 8, 1059L: 1, 1114L: 8, 1161L: 8, 1162L: 8, 1163L: 8, 1176L: 8, 1177L: 8, 1178L: 8, 1179L: 8, 1180L: 8, 1181L: 8, 1190L: 8, 1191L: 8, 1192L: 8, 1196L: 8, 1227L: 8, 1228L: 8, 1235L: 8, 1237L: 8, 1263L: 8, 1264L: 8, 1279L: 8, 1408L: 8, 1409L: 8, 1410L: 8, 1552L: 8, 1553L: 8, 1554L: 8, 1555L: 8, 1556L: 8, 1557L: 8, 1561L: 8, 1562L: 8, 1568L: 8, 1569L: 8, 1570L: 8, 1571L: 8, 1572L: 8, 1584L: 8, 1589L: 8, 1592L: 8, 1593L: 8, 1595L: 8, 1596L: 8, 1597L: 8, 1600L: 8, 1656L: 8, 1664L: 8, 1728L: 8, 1745L: 8, 1779L: 8, 1904L: 8, 1912L: 8, 1990L: 8, 1998L: 8 }, TOYOTA.RAV4H: { - 36L: 8, 37L: 8, 170L: 8, 180L: 8, 186L: 4, 426L: 6, 452L: 8, 464L: 8, 466L: 8, 467L: 8, 547L: 8, 548L: 8, 552L: 4, 562L: 4, 608L: 8, 610L: 5, 643L: 7, 705L: 8, 725L: 2, 740L: 5, 800L: 8, 835L: 8, 836L: 8, 849L: 4, 869L: 7, 870L: 7, 871L: 2, 896L: 8, 897L: 8, 900L: 6, 902L: 6, 905L: 8, 911L: 8, 916L: 3, 918L: 7, 921L: 8, 933L: 8, 944L: 8, 945L: 8, 951L: 8, 955L: 8, 956L: 8, 979L: 2, 998L: 5, 999L: 7, 1000L: 8, 1001L: 8, 1008L: 2, 1014L: 8, 1017L: 8, 1041L: 8, 1042L: 8, 1043L: 8, 1044L: 8, 1056L: 8, 1059L: 1, 1114L: 8, 1161L: 8, 1162L: 8, 1163L: 8, 1176L: 8, 1177L: 8, 1178L: 8, 1179L: 8, 1180L: 8, 1181L: 8, 1190L: 8, 1191L: 8, 1192L: 8, 1196L: 8, 1227L: 8, 1228L: 8, 1235L: 8, 1237L: 8, 1263L: 8, 1279L: 8, 1408L: 8, 1409L: 8, 1410L: 8, 1552L: 8, 1553L: 8, 1554L: 8, 1555L: 8, 1556L: 8, 1557L: 8, 1561L: 8, 1562L: 8, 1568L: 8, 1569L: 8, 1570L: 8, 1571L: 8, 1572L: 8, 1584L: 8, 1589L: 8, 1592L: 8, 1593L: 8, 1595L: 8, 1596L: 8, 1597L: 8, 1600L: 8, 1656L: 8, 1664L: 8, 1728L: 8, 1745L: 8, 1779L: 8, 1904L: 8, 1912L: 8, 1990L: 8, 1998L: 8, 581L: 5, 296: 8, 552L: 8, 560L: 7, 552L: 4, 713L: 8, 550L: 8, 608L: 8, 37L: 8, 36L: 8, 950L: 8, 1198L: 8, 1197L: 8, 1199L: 8, 1212L: 8, 953L: 3, 1264L: 8, 1184L: 8, 1005L: 2, 1185L: 8, 1232L: 8, 1186L: 8 + 36L: 8, 37L: 8, 170L: 8, 180L: 8, 186L: 4, 426L: 6, 452L: 8, 464L: 8, 466L: 8, 467L: 8, 547L: 8, 548L: 8, 552L: 4, 562L: 4, 608L: 8, 610L: 5, 643L: 7, 705L: 8, 725L: 2, 740L: 5, 800L: 8, 835L: 8, 836L: 8, 849L: 4, 869L: 7, 870L: 7, 871L: 2, 896L: 8, 897L: 8, 900L: 6, 902L: 6, 905L: 8, 911L: 8, 916L: 3, 918L: 7, 921L: 8, 933L: 8, 944L: 8, 945L: 8, 951L: 8, 955L: 8, 956L: 8, 979L: 2, 998L: 5, 999L: 7, 1000L: 8, 1001L: 8, 1008L: 2, 1014L: 8, 1017L: 8, 1041L: 8, 1042L: 8, 1043L: 8, 1044L: 8, 1056L: 8, 1059L: 1, 1114L: 8, 1161L: 8, 1162L: 8, 1163L: 8, 1176L: 8, 1177L: 8, 1178L: 8, 1179L: 8, 1180L: 8, 1181L: 8, 1190L: 8, 1191L: 8, 1192L: 8, 1196L: 8, 1227L: 8, 1228L: 8, 1235L: 8, 1237L: 8, 1263L: 8, 1279L: 8, 1408L: 8, 1409L: 8, 1410L: 8, 1552L: 8, 1553L: 8, 1554L: 8, 1555L: 8, 1556L: 8, 1557L: 8, 1561L: 8, 1562L: 8, 1568L: 8, 1569L: 8, 1570L: 8, 1571L: 8, 1572L: 8, 1584L: 8, 1589L: 8, 1592L: 8, 1593L: 8, 1595L: 8, 1596L: 8, 1597L: 8, 1600L: 8, 1656L: 8, 1664L: 8, 1728L: 8, 1745L: 8, 1779L: 8, 1904L: 8, 1912L: 8, 1990L: 8, 1998L: 8, 581L: 5, 296: 8, 560L: 7, 713L: 8, 550L: 8, 608L: 8, 37L: 8, 36L: 8, 950L: 8, 1198L: 8, 1197L: 8, 1199L: 8, 1212L: 8, 953L: 3, 1264L: 8, 1184L: 8, 1005L: 2, 1185L: 8, 1232L: 8, 1186L: 8 }, TOYOTA.PRIUS: [{ 36L: 8, 37L: 8, 166L: 8, 170L: 8, 180L: 8, 295L: 8, 296L: 8, 426L: 6, 452L: 8, 466L: 8, 467L: 8, 550L: 8, 552L: 4, 560L: 7, 562L: 6, 581L: 5, 608L: 8, 610L: 8, 614L: 8, 643L: 7, 658L: 8, 713L: 8, 740L: 5, 742L: 8, 743L: 8, 800L: 8, 810L: 2, 814L: 8, 829L: 2, 830L: 7, 835L: 8, 836L: 8, 863L: 8, 869L: 7, 870L: 7, 871L: 2, 898L: 8, 900L: 6, 902L: 6, 905L: 8, 918L: 8, 921L: 8, 933L: 8, 944L: 8, 945L: 8, 950L: 8, 951L: 8, 953L: 8, 955L: 8, 956L: 8, 971L: 7, 975L: 5, 993L: 8, 998L: 5, 999L: 7, 1000L: 8, 1001L: 8, 1014L: 8, 1017L: 8, 1020L: 8, 1041L: 8, 1042L: 8, 1044L: 8, 1056L: 8, 1057L: 8, 1059L: 1, 1071L: 8, 1077L: 8, 1082L: 8, 1083L: 8, 1084L: 8, 1085L: 8, 1086L: 8, 1114L: 8, 1132L: 8, 1161L: 8, 1162L: 8, 1163L: 8, 1175L: 8, 1227L: 8, 1228L: 8, 1235L: 8, 1237L: 8, 1279L: 8, 1552L: 8, 1553L: 8, 1556L: 8, 1557L: 8, 1568L: 8, 1570L: 8, 1571L: 8, 1572L: 8, 1595L: 8, 1777L: 8, 1779L: 8, 1904L: 8, 1912L: 8, 1990L: 8, 1998L: 8 @@ -46,12 +51,15 @@ class TOYOTA: }, # Taiwanese Prius Prime { - 36L: 8, 37L: 8, 166L: 8, 170L: 8, 180L: 8, 295L: 8, 296L: 8, 426L: 6, 452L: 8, 466L: 8, 467L: 8, 550L: 8, 552L: 4, 560L: 7, 562L: 6, 581L: 5, 608L: 8, 610L: 8, 614L: 8, 643L: 7, 658L: 8, 713L: 8, 740L: 5, 742L: 8, 743L: 8, 800L: 8, 810L: 2, 814L: 8, 824L: 2, 829L: 2, 830L: 7, 835L: 8, 836L: 8, 863L: 8, 869L: 7, 870L: 7, 871L: 2,898L: 8, 900L: 6, 902L: 6, 905L: 8, 913L: 8, 918L: 8, 921L: 8, 933L: 8, 944L: 8, 945L: 8, 950L: 8, 951L: 8, 953L: 8, 955L: 8, 956L: 8, 971L: 7, 974L: 8, 975L: 5, 993L: 8, 998L: 5, 999L: 7, 1000L: 8, 1001L: 8, 1014L: 8, 1017L: 8, 1020L: 8, 1041L: 8, 1042L: 8, 1044L: 8, 1056L: 8, 1057L: 8, 1059L: 1, 1071L: 8, 1076L: 8, 1077L: 8, 1082L: 8, 1083L: 8, 1084L: 8, 1085L: 8, 1086L: 8, 1114L: 8, 1132L: 8, 1161L: 8, 1162L: 8, 1163L: 8, 1164L: 8, 1165L: 8, 1166L: 8, 1167L: 8, 1175L: 8, 1227L: 8, 1228L: 8, 1235L: 8, 1237L: 8, 1279L: 8, 1552L: 8, 1553L: 8, 1556L: 8, 1557L: 8, 1568L: 8, 1570L: 8, 1571L: 8, 1572L: 8, 1595L: 8, 1777L: 8, 1779L: 8, 1904L: 8, 1912L: 8, 1990L: 8, 1998L: 8 + 36L: 8, 37L: 8, 166L: 8, 170L: 8, 180L: 8, 295L: 8, 296L: 8, 426L: 6, 452L: 8, 466L: 8, 467L: 8, 550L: 8, 552L: 4, 560L: 7, 562L: 6, 581L: 5, 608L: 8, 610L: 8, 614L: 8, 643L: 7, 658L: 8, 713L: 8, 740L: 5, 742L: 8, 743L: 8, 800L: 8, 810L: 2, 814L: 8, 824L: 2, 829L: 2, 830L: 7, 835L: 8, 836L: 8, 845L: 5, 863L: 8, 869L: 7, 870L: 7, 871L: 2,898L: 8, 900L: 6, 902L: 6, 905L: 8, 913L: 8, 918L: 8, 921L: 8, 933L: 8, 944L: 8, 945L: 8, 950L: 8, 951L: 8, 953L: 8, 955L: 8, 956L: 8, 971L: 7, 974L: 8, 975L: 5, 993L: 8, 998L: 5, 999L: 7, 1000L: 8, 1001L: 8, 1005L: 2, 1014L: 8, 1017L: 8, 1020L: 8, 1041L: 8, 1042L: 8, 1044L: 8, 1056L: 8, 1057L: 8, 1059L: 1, 1071L: 8, 1076L: 8, 1077L: 8, 1082L: 8, 1083L: 8, 1084L: 8, 1085L: 8, 1086L: 8, 1114L: 8, 1132L: 8, 1161L: 8, 1162L: 8, 1163L: 8, 1164L: 8, 1165L: 8, 1166L: 8, 1167L: 8, 1175L: 8, 1227L: 8, 1228L: 8, 1235L: 8, 1237L: 8, 1264L: 8, 1279L: 8, 1552L: 8, 1553L: 8, 1556L: 8, 1557L: 8, 1568L: 8, 1570L: 8, 1571L: 8, 1572L: 8, 1595L: 8, 1777L: 8, 1779L: 8, 1904L: 8, 1912L: 8, 1990L: 8, 1998L: 8 } ], TOYOTA.COROLLA: { 36: 8, 37: 8, 170: 8, 180: 8, 186: 4, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 547: 8, 548: 8, 552: 4, 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, 900: 6, 902: 6, 905: 8, 911: 8, 916: 2, 921: 8, 933: 8, 944: 8, 945: 8, 951: 8, 955: 4, 956: 8, 979: 2, 992: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1017: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1196: 8, 1227: 8, 1235: 8, 1279: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1596: 8, 1597: 8, 1600: 8, 1664: 8, 1728: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8 }, + TOYOTA.LEXUS_RXH: { + 36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 5, 643: 7, 658: 8, 713: 8, 740: 5, 742: 8, 743: 8, 800: 8, 810: 2, 812: 3, 814: 8, 830: 7, 835: 8, 836: 8, 845: 5, 863: 8, 869: 7, 870: 7, 871: 2, 898: 8, 900: 6, 902: 6, 905: 8, 913: 8, 918: 8, 921: 8, 933: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 975: 6, 993: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1005: 2, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1059: 1, 1063: 8, 1071: 8, 1077: 8, 1082: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1227: 8, 1228: 8, 1235: 8, 1237: 8, 1264: 8, 1279: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1575: 8, 1595: 8, 1777: 8, 1779: 8, 1808: 8, 1810: 8, 1816: 8, 1818: 8, 1840: 8, 1848: 8, 1904: 8, 1912: 8, 1940: 8, 1941: 8, 1948: 8, 1949: 8, 1952: 8, 1956: 8, 1960: 8, 1964: 8, 1986: 8, 1990: 8, 1994: 8, 1998: 8, 2004: 8, 2012: 8 + }, } # support additional internal only fingerprints diff --git a/common/kalman/ekf.py b/common/kalman/ekf.py index feebe0883f1070..c7043199146530 100644 --- a/common/kalman/ekf.py +++ b/common/kalman/ekf.py @@ -1,6 +1,5 @@ import abc import numpy as np -import numpy.matlib # The EKF class contains the framework for an Extended Kalman Filter, but must be subclassed to use. # A subclass must implement: # 1) calc_transfer_fun(); see bottom of file for more info. diff --git a/common/params.py b/common/params.py index d6503291eb4e4d..b843c9b989ed41 100755 --- a/common/params.py +++ b/common/params.py @@ -227,7 +227,7 @@ def __exit__(self, type, value, traceback): data_path = self._data_path() try: old_data_path = os.path.join(self._path, os.readlink(data_path)) - except (OSError, IOError) as e: + except (OSError, IOError): # NOTE(mgraczyk): If other DB implementations have bugs, this could cause # copies to be left behind, but we still want to overwrite. pass diff --git a/common/realtime.py b/common/realtime.py index e84e6eb490ecac..b8d75db09e2d03 100644 --- a/common/realtime.py +++ b/common/realtime.py @@ -1,7 +1,6 @@ """Utilities for reading real time clocks and keeping soft real time constraints.""" import os import time -import ctypes import platform import threading import subprocess diff --git a/opendbc/acura_rdx_2018_can_generated.dbc b/opendbc/acura_rdx_2018_can_generated.dbc index dc30eb22aa2cf8..1e85eb41322ccc 100644 --- a/opendbc/acura_rdx_2018_can_generated.dbc +++ b/opendbc/acura_rdx_2018_can_generated.dbc @@ -1,9 +1,47 @@ CM_ "AUTOGENERATED FILE, DO NOT EDIT" -BO_ 342 STEERING_SENSORS: 6 EPS - SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON - SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON - SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON - SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON +CM_ "Imported file _honda_2017.dbc starts here" +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BU_: EBCM ADAS PCM EPS VSA SCM BDY XXX EPB EON + +BO_ 344 ENGINE_DATA: 8 PCM + SG_ XMISSION_SPEED : 7|16@0+ (0.002759506,0) [0|70] "m/s" EON + SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON + SG_ XMISSION_SPEED2 : 39|16@0+ (0.002759506,0) [0|70] "m/s" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON + SG_ ODOMETER : 55|8@0+ (0.010588,0) [0|255] "km" XXX BO_ 380 POWERTRAIN_DATA: 8 PCM SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON @@ -16,8 +54,175 @@ BO_ 380 POWERTRAIN_DATA: 8 PCM SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "rpm" EON SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 432 STANDSTILL: 7 VSA + SG_ CONTROLLED_STANDSTILL : 0|1@0+ (1,0) [0|1] "" EON + SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON + SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 464 WHEEL_SPEEDS: 8 VSA + SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON + SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 490 VEHICLE_DYNAMICS: 8 VSA + SG_ LONG_ACCEL : 23|16@0- (0.0015384,0) [-20|20] "m/s2" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 506 BRAKE_COMMAND: 8 ADAS + SG_ COMPUTER_BRAKE : 7|10@0+ (0.003906248,0) [0|1] "" EBCM + SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST_2 : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ SET_ME_0X80 : 31|8@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM + SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM + SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM + SG_ ZEROS_BOH6 : 44|1@0+ (1,0) [0|1] "" EBCM + SG_ FCW : 43|2@0+ (1,0) [0|3] "" EBCM + SG_ ZEROS_BOH4 : 55|8@0+ (1,0) [0|0] "" EBCM + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM + SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EBCM + +BO_ 512 GAS_COMMAND: 3 EON + SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR + SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" INTERCEPTOR + SG_ CHECKSUM : 19|4@0+ (1,0) [0|3] "" INTERCEPTOR + +BO_ 513 GAS_SENSOR: 5 INTERCEPTOR + SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-83.3) [0|1] "" EON + SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" EON + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" EON + +BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA + SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON + SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON + SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" EON + SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON +BO_ 773 SEATBELT_STATUS: 7 BDY + SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON + SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON + SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON + +BO_ 777 LOCK_STATUS: 8 XXX + SG_ DOORS_UNLOCKED : 54|1@0+ (1,0) [0|1] "" EON + SG_ DOORS_LOCKED : 55|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 780 ACC_HUD: 8 ADAS + SG_ PCM_SPEED : 7|16@0+ (0.002759506,0) [0|100] "m/s" BDY + SG_ PCM_GAS : 23|7@0+ (1,0) [0|127] "" BDY + SG_ ZEROS_BOH : 16|1@0+ (1,0) [0|255] "" BDY + SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY + SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY + SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY + SG_ BOH_2 : 35|1@0+ (1,0) [0|1] "" BDY + SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY + SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY + SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X03 : 47|2@0+ (1,0) [0|3] "" BDY + SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY + SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY + SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY + SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY + SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY + +BO_ 804 CRUISE: 8 PCM + SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON + SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON + SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON + SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON + SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON + SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +BO_ 829 LKAS_HUD: 5 ADAS + SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY + SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY + SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY + SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY + SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY + SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY + SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY + SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY + SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY + SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY + SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY + SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY + SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY + SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY + SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY + SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY + +BO_ 892 CRUISE_PARAMS: 8 PCM + SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + +BO_ 1029 DOORS_STATUS: 8 BDY + SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON + SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON + SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON + SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON + +CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping"; +CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light"; +CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light"; +CM_ SG_ 780 CRUISE_SPEED "255 = no speed"; +CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed"; +CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc..."; + + +VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw" ; +VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime" ; +VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ; +VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ; +VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ; + +CM_ "acura_rdx_2018_can.dbc starts here" + +BO_ 342 STEERING_SENSORS: 6 EPS + SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON + SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON + SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON + SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON + BO_ 392 GEARBOX: 6 XXX SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" XXX SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" XXX @@ -48,13 +253,13 @@ BO_ 420 VSA_STATUS: 8 VSA BO_ 422 SCM_BUTTONS: 8 SCM SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON SG_ LIGHTS_SETTING : 1|2@0+ (1,0) [0|3] "" EON - SG_ PARKING_BREAK_LIGHT : 2|1@0+ (1,0) [0|1] "" EON + SG_ PARKING_BRAKE_LIGHT : 2|1@0+ (1,0) [0|1] "" EON SG_ MAIN_ON : 47|1@0+ (1,0) [0|1] "" EON SG_ CRUISE_SETTING : 43|2@0+ (1,0) [0|3] "" EON SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON -BO_ 487 XXX_9: 4 VSA +BO_ 487 BRAKE_PRESSURE: 4 VSA SG_ BRAKE_PRESSURE1 : 7|10@0+ (0.015625,-103) [0|1000] "" EON SG_ BRAKE_PRESSURE2 : 9|10@0+ (0.015625,-103) [0|1000] "" EON SG_ COUNTER : 29|2@0+ (1,0) [0|15] "" EON @@ -67,7 +272,7 @@ BO_ 660 SCM_FEEDBACK: 8 SCM SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON -CM_ SG_ 422 PARKING_BREAK_LIGHT "Believe this is just the dash light for the parking break"; +CM_ SG_ 422 PARKING_BRAKE_LIGHT "Believe this is just the dash light for the parking break"; VAL_ 392 GEAR_SHIFTER 0 "S" 1 "P" 2 "R" 4 "N" 8 "D" ; VAL_ 392 GEAR 26 "S" 4 "D" 3 "N" 2 "R" 1 "P" ; VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ; diff --git a/opendbc/generator/honda/acura_rdx_2018_can.dbc b/opendbc/generator/honda/acura_rdx_2018_can.dbc index 7b33013d45c77b..5179d233e1727c 100644 --- a/opendbc/generator/honda/acura_rdx_2018_can.dbc +++ b/opendbc/generator/honda/acura_rdx_2018_can.dbc @@ -1,22 +1,11 @@ +CM_ "IMPORT _honda_2017.dbc" + BO_ 342 STEERING_SENSORS: 6 EPS SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON -BO_ 380 POWERTRAIN_DATA: 8 PCM - SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON - SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON - SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON - SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "rpm" EON - SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "rpm" EON - SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "rpm" EON - SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "rpm" EON - SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON - SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "rpm" EON - SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON - SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON - BO_ 392 GEARBOX: 6 XXX SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" XXX SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" XXX @@ -47,13 +36,13 @@ BO_ 420 VSA_STATUS: 8 VSA BO_ 422 SCM_BUTTONS: 8 SCM SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON SG_ LIGHTS_SETTING : 1|2@0+ (1,0) [0|3] "" EON - SG_ PARKING_BREAK_LIGHT : 2|1@0+ (1,0) [0|1] "" EON + SG_ PARKING_BRAKE_LIGHT : 2|1@0+ (1,0) [0|1] "" EON SG_ MAIN_ON : 47|1@0+ (1,0) [0|1] "" EON SG_ CRUISE_SETTING : 43|2@0+ (1,0) [0|3] "" EON SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON -BO_ 487 XXX_9: 4 VSA +BO_ 487 BRAKE_PRESSURE: 4 VSA SG_ BRAKE_PRESSURE1 : 7|10@0+ (0.015625,-103) [0|1000] "" EON SG_ BRAKE_PRESSURE2 : 9|10@0+ (0.015625,-103) [0|1000] "" EON SG_ COUNTER : 29|2@0+ (1,0) [0|15] "" EON @@ -66,7 +55,7 @@ BO_ 660 SCM_FEEDBACK: 8 SCM SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON -CM_ SG_ 422 PARKING_BREAK_LIGHT "Believe this is just the dash light for the parking break"; +CM_ SG_ 422 PARKING_BRAKE_LIGHT "Believe this is just the dash light for the parking break"; VAL_ 392 GEAR_SHIFTER 0 "S" 1 "P" 2 "R" 4 "N" 8 "D" ; VAL_ 392 GEAR 26 "S" 4 "D" 3 "N" 2 "R" 1 "P" ; VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ; diff --git a/opendbc/generator/toyota/_toyota_2017.dbc b/opendbc/generator/toyota/_toyota_2017.dbc index 3e2b5ec86fa3b6..25120828c2d4a7 100644 --- a/opendbc/generator/toyota/_toyota_2017.dbc +++ b/opendbc/generator/toyota/_toyota_2017.dbc @@ -80,13 +80,13 @@ BO_ 614 STEERING_IPAS: 8 IPAS BO_ 643 PRE_COLLISION: 8 XXX -BO_ 740 STEERING_LKA: 8 XXX +BO_ 740 STEERING_LKA: 5 XXX SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX - SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX SG_ COUNTER : 6|6@0+ (1,0) [0|63] "" XXX SG_ SET_ME_1 : 7|1@0+ (1,0) [0|1] "" XXX SG_ STEER_TORQUE_CMD : 15|16@0- (1,0) [0|65535] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX BO_ 742 LEAD_INFO: 8 DSU SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" HCU diff --git a/opendbc/generator/toyota/lexus_rx_hybrid_2017_pt.dbc b/opendbc/generator/toyota/lexus_rx_hybrid_2017_pt.dbc new file mode 100644 index 00000000000000..2c0a4809918306 --- /dev/null +++ b/opendbc/generator/toyota/lexus_rx_hybrid_2017_pt.dbc @@ -0,0 +1,30 @@ +CM_ "IMPORT _toyota_2017.dbc" + +BO_ 550 BRAKE_MODULE: 8 XXX + SG_ BRAKE_PRESSURE : 0|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_POSITION : 16|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_PRESSED : 37|1@0+ (1,0) [0|1] "" XXX + +BO_ 581 GAS_PEDAL: 5 XXX + SG_ GAS_PEDAL : 23|8@0+ (0.005,0) [0|1] "" XXX + +BO_ 608 STEER_TORQUE_SENSOR: 8 XXX + SG_ STEER_TORQUE_EPS : 47|16@0- (0.73,0) [-20000|20000] "" XXX + SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX + SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 610 EPS_STATUS: 5 EPS + SG_ STATE : 3|4@0+ (1,0) [0|15] "" XXX + SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 956 GEAR_PACKET: 8 XXX + SG_ GEAR : 13|6@0+ (1,0) [0|63] "" XXX + +CM_ SG_ 550 BRAKE_PRESSURE "seems prop to pedal force"; +CM_ SG_ 550 BRAKE_POSITION "seems proportional to pedal displacement, unclear the max value of 0x1c8"; +CM_ SG_ 581 GAS_PEDAL "it seems slightly filtered"; +VAL_ 610 STATE 5 "override" 3 "enabled" 1 "disabled"; +VAL_ 610 LKA_STATE 50 "temporary_fault"; +VAL_ 956 GEAR 0 "D" 1 "S" 8 "N" 16 "R" 32 "P"; diff --git a/opendbc/generator/toyota/toyota_rav4_hybrid_2017_pt.dbc b/opendbc/generator/toyota/toyota_rav4_hybrid_2017_pt.dbc index fb62c09fd3e1c1..2c0a4809918306 100644 --- a/opendbc/generator/toyota/toyota_rav4_hybrid_2017_pt.dbc +++ b/opendbc/generator/toyota/toyota_rav4_hybrid_2017_pt.dbc @@ -5,7 +5,7 @@ BO_ 550 BRAKE_MODULE: 8 XXX SG_ BRAKE_POSITION : 16|9@0+ (1,0) [0|511] "" XXX SG_ BRAKE_PRESSED : 37|1@0+ (1,0) [0|1] "" XXX -BO_ 581 GAS_PEDAL: 8 XXX +BO_ 581 GAS_PEDAL: 5 XXX SG_ GAS_PEDAL : 23|8@0+ (0.005,0) [0|1] "" XXX BO_ 608 STEER_TORQUE_SENSOR: 8 XXX diff --git a/opendbc/lexus_rx_hybrid_2017_pt_generated.dbc b/opendbc/lexus_rx_hybrid_2017_pt_generated.dbc new file mode 100644 index 00000000000000..abc28528dc4ac1 --- /dev/null +++ b/opendbc/lexus_rx_hybrid_2017_pt_generated.dbc @@ -0,0 +1,210 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT" +CM_ "Imported file _toyota_2017.dbc starts here" +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX DSU HCU EPS IPAS + +BO_ 36 KINEMATICS: 8 XXX + SG_ ACCEL_Y : 33|10@0+ (1,-512) [0|65535] "" XXX + SG_ YAW_RATE : 1|10@0+ (1,-512) [0|65535] "" XXX + SG_ STEERING_TORQUE : 17|10@0+ (1,-512) [0|65535] "" XXX + +BO_ 166 BRAKE: 8 XXX + SG_ BRAKE_AMOUNT : 7|8@0+ (1,0) [0|255] "" XXX + SG_ BRAKE_PEDAL : 23|8@0+ (1,0) [0|255] "" XXX + +BO_ 170 WHEEL_SPEEDS: 8 XXX + SG_ WHEEL_SPEED_FR : 7|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_FL : 23|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_RR : 39|16@0+ (0.01,-67.67) [0|250] "kph" XXX + SG_ WHEEL_SPEED_RL : 55|16@0+ (0.01,-67.67) [0|250] "kph" XXX + +BO_ 180 SPEED: 8 XXX + SG_ ENCODER : 39|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + SG_ SPEED : 47|16@0+ (0.01,0) [0|250] "kph" XXX + +BO_ 466 PCM_CRUISE: 8 XXX + SG_ GAS_RELEASED : 4|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL_ON : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ACCEL_NET : 23|16@0- (0.001,0) [-20|20] "m/s2" XXX + SG_ CRUISE_STATE : 55|4@0+ (1,0) [0|15] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 552 ACCELEROMETER: 8 XXX + SG_ ACCEL_Z : 22|15@0- (1,0) [0|32767] "" XXX + SG_ ACCEL_X : 6|15@0- (0.001,0) [-20|20] "m/s2" XXX + +BO_ 560 BRAKE_MODULE2: 7 XXX + SG_ BRAKE_PRESSED : 26|1@0+ (1,0) [0|1] "" XXX + +BO_ 614 STEERING_IPAS: 8 IPAS + SG_ STATE : 7|4@0+ (1,0) [0|15] "" XXX + SG_ ANGLE : 3|12@0- (1,0) [0|16777215] "" XXX + SG_ SET_ME_X10 : 23|8@0+ (1,0) [0|255] "" XXX + SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|255] "" XXX + SG_ DIRECTION_CMD : 38|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_X00 : 55|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 643 PRE_COLLISION: 8 XXX + +BO_ 740 STEERING_LKA: 5 XXX + SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX + SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX + SG_ COUNTER : 6|6@0+ (1,0) [0|63] "" XXX + SG_ SET_ME_1 : 7|1@0+ (1,0) [0|1] "" XXX + SG_ STEER_TORQUE_CMD : 15|16@0- (1,0) [0|65535] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 742 LEAD_INFO: 8 DSU + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" HCU + SG_ LEAD_REL_SPEED : 23|12@0- (0.025,0) [-100|100] "m/s" HCU + SG_ LEAD_LONG_DIST : 7|13@0+ (0.05,0) [0|300] "m" HCU + +BO_ 835 ACC_CONTROL: 8 DSU + SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU + +BO_ 1556 STEERING_LEVERS: 8 XXX + SG_ TURN_SIGNALS : 29|2@0+ (1,0) [0|3] "" XXX + +BO_ 37 STEER_ANGLE_SENSOR: 8 XXX + SG_ STEER_ANGLE : 3|12@0- (1.5,0) [-500|500] "deg" XXX + SG_ STEER_FRACTION : 39|4@0- (0.1,0) [-0.7|0.7] "deg" XXX + SG_ STEER_RATE : 35|12@0- (1,0) [-2000|2000] "deg/s" XXX + +BO_ 467 PCM_CRUISE_2: 8 XXX + SG_ MAIN_ON : 15|1@0+ (1,0) [0|1] "" XXX + SG_ LOW_SPEED_LOCKOUT : 14|2@0+ (1,0) [0|3] "kph" XXX + SG_ SET_SPEED : 23|8@0+ (1,0) [0|255] "kph" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 921 PCM_CRUISE_SM: 8 XXX + SG_ MAIN_ON : 4|1@0+ (1,0) [0|1] "" XXX + SG_ CRUISE_CONTROL_STATE : 11|4@0+ (1,0) [0|15] "" XXX + SG_ UI_SET_SPEED : 31|8@0+ (1,0) [0|255] "" XXX + +BO_ 951 ESP_CONTROL: 8 ESP + SG_ TC_DISABLED : 13|1@0+ (1,0) [0|1] "" XXX + SG_ BRAKE_LIGHTS_ACC : 18|1@0+ (1,0) [0|1] "" XXX + +BO_ 1041 ACC_HUD: 8 DSU + SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX + +BO_ 1042 LKAS_HUD: 8 XXX + SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX + SG_ RIGHT_LINE : 3|2@0+ (1,0) [0|3] "" XXX + SG_ LEFT_LINE : 5|2@0+ (1,0) [0|3] "" XXX + SG_ SET_ME_1 : 7|2@0+ (1,0) [0|3] "" XXX + SG_ LDA_ALERT : 9|2@0+ (1,0) [0|3] "" XXX + SG_ TWO_BEEPS : 12|1@0+ (1,0) [0|1] "" XXX + SG_ ADJUSTING_CAMERA : 13|1@0+ (1,0) [0|1] "" XXX + SG_ LDA_MALFUNCTION : 15|1@0+ (1,0) [0|1] "" XXX + SG_ REPEATED_BEEPS : 32|1@0+ (1,0) [0|1] "" XXX + +BO_ 1553 UI_SEETING: 8 XXX + SG_ UNITS : 26|2@0+ (1,0) [0|3] "" XXX + +BO_ 1568 SEATS_DOORS: 8 XXX + SG_ SEATBELT_DRIVER_UNLATCHED : 62|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FL : 45|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RL : 42|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_RR : 43|1@0+ (1,0) [0|1] "" XXX + SG_ DOOR_OPEN_FR : 44|1@0+ (1,0) [0|1] "" XXX + +BO_ 1570 LIGHT_STALK: 8 SCM + SG_ AUTO_HIGH_BEAM : 37|1@0+ (1,0) [0|1] "" XXX + +CM_ SG_ 36 ACCEL_Y "unit is tbd"; +CM_ SG_ 36 YAW_RATE "verify"; +CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd"; +CM_ SG_ 466 ACCEL_NET "net acceleration produced by the system, given ACCEL_CMD, road grade and other factors"; +CM_ SG_ 560 BRAKE_PRESSED "another brake pressed?"; +CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel"; +CM_ SG_ 608 STEER_TORQUE_DRIVER "driver torque"; +CM_ SG_ 608 STEER_OVERRIDE "set when driver torque exceeds a certain value"; +CM_ SG_ 614 ANGLE "set to measured angle when ipas control isn't active"; +CM_ SG_ 37 STEER_FRACTION "1/15th of the signal STEER_ANGLE, which is 1.5 deg; note that 0x8 is never set"; +CM_ SG_ 37 STEER_RATE "factor is tbd"; +CM_ SG_ 467 SET_SPEED "43 kph are shown as 28mph, so conversion isnt perfect"; +CM_ SG_ 467 LOW_SPEED_LOCKOUT "in low speed lockout, system would always disengage below 28mph"; +CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit"; +CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces"; +CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts"; +VAL_ 466 CRUISE_STATE 8 "active" 7 "standstill" 1 "off" ; +VAL_ 467 LOW_SPEED_LOCKOUT 2 "low speed locked" 1 "ok" ; +VAL_ 614 STATE 3 "enabled" 1 "disabled"; +VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left"; +VAL_ 1553 UNITS 1 "km" 2 "miles"; +VAL_ 1556 TURN_SIGNALS 3 "none" 2 "right" 1 "left" ; +VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none"; +VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none"; +VAL_ 1042 RIGHT_LINE 3 "orange" 2 "double" 1 "solid" 0 "none"; +VAL_ 1042 LEFT_LINE 3 "orange" 2 "double" 1 "solid" 0 "none"; +VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted"; + +CM_ "CHFFR_METRIC 37 STEER_ANGLE STEER_ANGLE 0.36 180"; + +CM_ "lexus_rx_hybrid_2017_pt.dbc starts here" + +BO_ 550 BRAKE_MODULE: 8 XXX + SG_ BRAKE_PRESSURE : 0|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_POSITION : 16|9@0+ (1,0) [0|511] "" XXX + SG_ BRAKE_PRESSED : 37|1@0+ (1,0) [0|1] "" XXX + +BO_ 581 GAS_PEDAL: 5 XXX + SG_ GAS_PEDAL : 23|8@0+ (0.005,0) [0|1] "" XXX + +BO_ 608 STEER_TORQUE_SENSOR: 8 XXX + SG_ STEER_TORQUE_EPS : 47|16@0- (0.73,0) [-20000|20000] "" XXX + SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX + SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX + +BO_ 610 EPS_STATUS: 5 EPS + SG_ STATE : 3|4@0+ (1,0) [0|15] "" XXX + SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX + +BO_ 956 GEAR_PACKET: 8 XXX + SG_ GEAR : 13|6@0+ (1,0) [0|63] "" XXX + +CM_ SG_ 550 BRAKE_PRESSURE "seems prop to pedal force"; +CM_ SG_ 550 BRAKE_POSITION "seems proportional to pedal displacement, unclear the max value of 0x1c8"; +CM_ SG_ 581 GAS_PEDAL "it seems slightly filtered"; +VAL_ 610 STATE 5 "override" 3 "enabled" 1 "disabled"; +VAL_ 610 LKA_STATE 50 "temporary_fault"; +VAL_ 956 GEAR 0 "D" 1 "S" 8 "N" 16 "R" 32 "P"; diff --git a/opendbc/toyota_corolla_2017_pt_generated.dbc b/opendbc/toyota_corolla_2017_pt_generated.dbc index 18d758120dec63..c1be02aada038c 100644 --- a/opendbc/toyota_corolla_2017_pt_generated.dbc +++ b/opendbc/toyota_corolla_2017_pt_generated.dbc @@ -82,13 +82,13 @@ BO_ 614 STEERING_IPAS: 8 IPAS BO_ 643 PRE_COLLISION: 8 XXX -BO_ 740 STEERING_LKA: 8 XXX +BO_ 740 STEERING_LKA: 5 XXX SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX - SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX SG_ COUNTER : 6|6@0+ (1,0) [0|63] "" XXX SG_ SET_ME_1 : 7|1@0+ (1,0) [0|1] "" XXX SG_ STEER_TORQUE_CMD : 15|16@0- (1,0) [0|65535] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX BO_ 742 LEAD_INFO: 8 DSU SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" HCU diff --git a/opendbc/toyota_prius_2017_pt_generated.dbc b/opendbc/toyota_prius_2017_pt_generated.dbc index bb5e0df32ba1ab..ec72752baa0e1d 100644 --- a/opendbc/toyota_prius_2017_pt_generated.dbc +++ b/opendbc/toyota_prius_2017_pt_generated.dbc @@ -82,13 +82,13 @@ BO_ 614 STEERING_IPAS: 8 IPAS BO_ 643 PRE_COLLISION: 8 XXX -BO_ 740 STEERING_LKA: 8 XXX +BO_ 740 STEERING_LKA: 5 XXX SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX - SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX SG_ COUNTER : 6|6@0+ (1,0) [0|63] "" XXX SG_ SET_ME_1 : 7|1@0+ (1,0) [0|1] "" XXX SG_ STEER_TORQUE_CMD : 15|16@0- (1,0) [0|65535] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX BO_ 742 LEAD_INFO: 8 DSU SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" HCU diff --git a/opendbc/toyota_rav4_2017_pt_generated.dbc b/opendbc/toyota_rav4_2017_pt_generated.dbc index df47a58b8a0a9f..3301bc0c6ded9e 100644 --- a/opendbc/toyota_rav4_2017_pt_generated.dbc +++ b/opendbc/toyota_rav4_2017_pt_generated.dbc @@ -82,13 +82,13 @@ BO_ 614 STEERING_IPAS: 8 IPAS BO_ 643 PRE_COLLISION: 8 XXX -BO_ 740 STEERING_LKA: 8 XXX +BO_ 740 STEERING_LKA: 5 XXX SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX - SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX SG_ COUNTER : 6|6@0+ (1,0) [0|63] "" XXX SG_ SET_ME_1 : 7|1@0+ (1,0) [0|1] "" XXX SG_ STEER_TORQUE_CMD : 15|16@0- (1,0) [0|65535] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX BO_ 742 LEAD_INFO: 8 DSU SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" HCU diff --git a/opendbc/toyota_rav4_hybrid_2017_pt_generated.dbc b/opendbc/toyota_rav4_hybrid_2017_pt_generated.dbc index f02b231317a721..cca97d041d9c75 100644 --- a/opendbc/toyota_rav4_hybrid_2017_pt_generated.dbc +++ b/opendbc/toyota_rav4_hybrid_2017_pt_generated.dbc @@ -82,13 +82,13 @@ BO_ 614 STEERING_IPAS: 8 IPAS BO_ 643 PRE_COLLISION: 8 XXX -BO_ 740 STEERING_LKA: 8 XXX +BO_ 740 STEERING_LKA: 5 XXX SG_ LKA_STATE : 31|8@0+ (1,0) [0|255] "" XXX - SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX SG_ STEER_REQUEST : 0|1@0+ (1,0) [0|1] "" XXX SG_ COUNTER : 6|6@0+ (1,0) [0|63] "" XXX SG_ SET_ME_1 : 7|1@0+ (1,0) [0|1] "" XXX SG_ STEER_TORQUE_CMD : 15|16@0- (1,0) [0|65535] "" XXX + SG_ CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX BO_ 742 LEAD_INFO: 8 DSU SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" HCU @@ -185,7 +185,7 @@ BO_ 550 BRAKE_MODULE: 8 XXX SG_ BRAKE_POSITION : 16|9@0+ (1,0) [0|511] "" XXX SG_ BRAKE_PRESSED : 37|1@0+ (1,0) [0|1] "" XXX -BO_ 581 GAS_PEDAL: 8 XXX +BO_ 581 GAS_PEDAL: 5 XXX SG_ GAS_PEDAL : 23|8@0+ (0.005,0) [0|1] "" XXX BO_ 608 STEER_TORQUE_SENSOR: 8 XXX diff --git a/panda/VERSION b/panda/VERSION index 6df8b1143050c4..ef6a92d3044403 100644 --- a/panda/VERSION +++ b/panda/VERSION @@ -1 +1 @@ -v1.0.6 \ No newline at end of file +v1.0.7 \ No newline at end of file diff --git a/selfdrive/boardd/boardd.cc b/selfdrive/boardd/boardd.cc index 29ae70f4b9b00e..b472857300de00 100644 --- a/selfdrive/boardd/boardd.cc +++ b/selfdrive/boardd/boardd.cc @@ -451,6 +451,7 @@ void _pigeon_send(const char *dat, int len) { memcpy(&a[1], &dat[i], ll); pthread_mutex_lock(&usb_lock); err = libusb_bulk_transfer(dev_handle, 2, a, ll+1, &sent, TIMEOUT); + if (err < 0) { handle_usb_issue(err, __func__); } assert(err == 0); assert(sent == ll+1); //hexdump(a, ll+1); @@ -460,20 +461,24 @@ void _pigeon_send(const char *dat, int len) { void pigeon_set_power(int power) { pthread_mutex_lock(&usb_lock); - libusb_control_transfer(dev_handle, 0xc0, 0xd9, power, 0, NULL, 0, TIMEOUT); + int err = libusb_control_transfer(dev_handle, 0xc0, 0xd9, power, 0, NULL, 0, TIMEOUT); + if (err < 0) { handle_usb_issue(err, __func__); } pthread_mutex_unlock(&usb_lock); } void pigeon_set_baud(int baud) { + int err; pthread_mutex_lock(&usb_lock); - libusb_control_transfer(dev_handle, 0xc0, 0xe2, 1, 0, NULL, 0, TIMEOUT); - libusb_control_transfer(dev_handle, 0xc0, 0xe4, 1, baud/300, NULL, 0, TIMEOUT); + err = libusb_control_transfer(dev_handle, 0xc0, 0xe2, 1, 0, NULL, 0, TIMEOUT); + if (err < 0) { handle_usb_issue(err, __func__); } + err = libusb_control_transfer(dev_handle, 0xc0, 0xe4, 1, baud/300, NULL, 0, TIMEOUT); + if (err < 0) { handle_usb_issue(err, __func__); } pthread_mutex_unlock(&usb_lock); } void pigeon_init() { usleep(1000*1000); - LOGW("pigeon start"); + LOGW("grey panda start"); // power off pigeon pigeon_set_power(0); @@ -513,7 +518,7 @@ void pigeon_init() { pigeon_send("\xB5\x62\x06\x01\x03\x00\x01\x07\x01\x13\x51"); pigeon_send("\xB5\x62\x06\x01\x03\x00\x02\x15\x01\x22\x70"); - LOGW("pigeon is ready to fly"); + LOGW("grey panda is ready to fly"); } @@ -551,6 +556,7 @@ void *pigeon_thread(void *crap) { while (alen < 0xfc0) { pthread_mutex_lock(&usb_lock); int len = libusb_control_transfer(dev_handle, 0xc0, 0xe0, 1, 0, dat+alen, 0x40, TIMEOUT); + if (len < 0) { handle_usb_issue(len, __func__); } pthread_mutex_unlock(&usb_lock); if (len <= 0) break; diff --git a/selfdrive/can/common.h b/selfdrive/can/common.h index 6c4db60496fe1e..2741e3971570d1 100644 --- a/selfdrive/can/common.h +++ b/selfdrive/can/common.h @@ -8,6 +8,8 @@ #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0])) +unsigned int honda_checksum(unsigned int address, uint64_t d, int l); +unsigned int toyota_checksum(unsigned int address, uint64_t d, int l); struct SignalPackValue { const char* name; diff --git a/selfdrive/can/libdbc_py.py b/selfdrive/can/libdbc_py.py index 4914dca6b25c99..7495c88adc331e 100644 --- a/selfdrive/can/libdbc_py.py +++ b/selfdrive/can/libdbc_py.py @@ -67,7 +67,7 @@ void* can_init(int bus, const char* dbc_name, size_t num_message_options, const MessageParseOptions* message_options, - size_t num_signal_options, const SignalParseOptions* signal_options); + size_t num_signal_options, const SignalParseOptions* signal_options, bool sendcan); void can_update(void* can, uint64_t sec, bool wait); @@ -77,8 +77,7 @@ void* canpack_init(const char* dbc_name); -uint64_t canpack_pack(void* inst, uint32_t address, size_t num_vals, const SignalPackValue *vals); - +uint64_t canpack_pack(void* inst, uint32_t address, size_t num_vals, const SignalPackValue *vals, int counter); """) libdbc = ffi.dlopen(libdbc_fn) diff --git a/selfdrive/can/packer.cc b/selfdrive/can/packer.cc index 3eddc6aeef79a3..2443f10f7156cb 100644 --- a/selfdrive/can/packer.cc +++ b/selfdrive/can/packer.cc @@ -5,6 +5,7 @@ #include #include #include +#include #include "common.h" @@ -12,70 +13,104 @@ namespace { -class CANPacker { -public: - CANPacker(const std::string& dbc_name) { - dbc = dbc_lookup(dbc_name); - assert(dbc); - - for (int i=0; inum_msgs; i++) { - const Msg* msg = &dbc->msgs[i]; - for (int j=0; jnum_sigs; j++) { - const Signal* sig = &msg->sigs[j]; - signal_lookup[std::make_pair(msg->address, std::string(sig->name))] = *sig; + uint64_t set_value(uint64_t ret, Signal sig, int64_t ival){ + uint64_t mask = ((1ULL << sig.b2)-1) << sig.bo; + uint64_t dat = (ival & ((1ULL << sig.b2)-1)) << sig.bo; + ret &= ~mask; + ret |= dat; + return ret; + } + + class CANPacker { + public: + CANPacker(const std::string& dbc_name) { + dbc = dbc_lookup(dbc_name); + assert(dbc); + + for (int i=0; inum_msgs; i++) { + const Msg* msg = &dbc->msgs[i]; + message_lookup[msg->address] = *msg; + for (int j=0; jnum_sigs; j++) { + const Signal* sig = &msg->sigs[j]; + signal_lookup[std::make_pair(msg->address, std::string(sig->name))] = *sig; + } } } - } - uint64_t pack(uint32_t address, const std::vector &signals) { - uint64_t ret = 0; - for (const auto& sigval : signals) { - std::string name = std::string(sigval.name); - double value = sigval.value; + uint64_t pack(uint32_t address, const std::vector &signals, int counter) { + uint64_t ret = 0; + for (const auto& sigval : signals) { + std::string name = std::string(sigval.name); + double value = sigval.value; + + auto sig_it = signal_lookup.find(std::make_pair(address, name)); + if (sig_it == signal_lookup.end()) { + WARN("undefined signal %s - %d\n", name.c_str(), address); + continue; + } + auto sig = sig_it->second; + + int64_t ival = (int64_t)(round((value - sig.offset) / sig.factor)); + if (ival < 0) { + ival = (1ULL << sig.b2) + ival; + } + + ret = set_value(ret, sig, ival); + } + + if (counter >= 0){ + auto sig_it = signal_lookup.find(std::make_pair(address, "COUNTER")); + if (sig_it == signal_lookup.end()) { + WARN("COUNTER not defined\n"); + return ret; + } + auto sig = sig_it->second; - auto sig_it = signal_lookup.find(make_pair(address, name)); - if (sig_it == signal_lookup.end()) { - WARN("undefined signal %s", name.c_str()); - continue; + if (sig.type != SignalType::HONDA_COUNTER){ + WARN("COUNTER signal type not valid\n"); + } + + ret = set_value(ret, sig, counter); } - auto sig = sig_it->second; - int64_t ival = (int64_t)((value - sig.offset) / sig.factor); - if (ival < 0) { - WARN("signed pack unsupported right now"); - continue; + auto sig_it = signal_lookup.find(std::make_pair(address, "CHECKSUM")); + if (sig_it != signal_lookup.end()) { + auto sig = sig_it->second; + if (sig.type == SignalType::HONDA_CHECKSUM){ + unsigned int chksm = honda_checksum(address, ret, message_lookup[address].size); + ret = set_value(ret, sig, chksm); + } + else if (sig.type == SignalType::TOYOTA_CHECKSUM){ + unsigned int chksm = toyota_checksum(address, ret, message_lookup[address].size); + ret = set_value(ret, sig, chksm); + } else { + WARN("CHECKSUM signal type not valid\n"); + } } - uint64_t mask = ((1ULL << sig.b2)-1) << sig.bo; - uint64_t dat = (ival & ((1ULL << sig.b2)-1)) << sig.bo; - ret &= ~mask; - ret |= dat; + return ret; } - return ret; - } - -private: - const DBC *dbc = NULL; - std::map, Signal> signal_lookup; -}; + private: + const DBC *dbc = NULL; + std::map, Signal> signal_lookup; + std::map message_lookup; + }; } extern "C" { + void* canpack_init(const char* dbc_name) { + CANPacker *ret = new CANPacker(std::string(dbc_name)); + return (void*)ret; + } -void* canpack_init(const char* dbc_name) { - CANPacker *ret = new CANPacker(std::string(dbc_name)); - return (void*)ret; -} - -uint64_t canpack_pack(void* inst, uint32_t address, size_t num_vals, const SignalPackValue *vals) { - CANPacker *cp = (CANPacker*)inst; + uint64_t canpack_pack(void* inst, uint32_t address, size_t num_vals, const SignalPackValue *vals, int counter, bool checksum) { + CANPacker *cp = (CANPacker*)inst; - return cp->pack(address, std::vector(vals, vals+num_vals)); -} + return cp->pack(address, std::vector(vals, vals+num_vals), counter); + } } - diff --git a/selfdrive/can/packer.py b/selfdrive/can/packer.py index 81458f59aeaffa..5ea6e3449eac7e 100644 --- a/selfdrive/can/packer.py +++ b/selfdrive/can/packer.py @@ -1,13 +1,26 @@ import struct +import numbers from selfdrive.can.libdbc_py import libdbc, ffi class CANPacker(object): def __init__(self, dbc_name): self.packer = libdbc.canpack_init(dbc_name) + self.dbc = libdbc.dbc_lookup(dbc_name) self.sig_names = {} + self.name_to_address_and_size = {} + self.address_to_size = {} - def pack(self, addr, values): + num_msgs = self.dbc[0].num_msgs + for i in range(num_msgs): + msg = self.dbc[0].msgs[i] + + name = ffi.string(msg.name) + address = msg.address + self.name_to_address_and_size[name] = (address, msg.size) + self.address_to_size[address] = msg.size + + def pack(self, addr, values, counter): # values: [(signal_name, signal_value)] values_thing = [] @@ -22,10 +35,19 @@ def pack(self, addr, values): values_c = ffi.new("SignalPackValue[]", values_thing) - return libdbc.canpack_pack(self.packer, addr, len(values_thing), values_c) + return libdbc.canpack_pack(self.packer, addr, len(values_thing), values_c, counter) + + def pack_bytes(self, addr, values, counter=-1): + if isinstance(addr, numbers.Number): + size = self.address_to_size[addr] + else: + addr, size = self.name_to_address_and_size[addr] + r = struct.pack(">Q", self.pack(addr, values, counter)) + return addr, r[:size] - def pack_bytes(self, addr, values): - return struct.pack(">Q", self.pack(addr, values)) + def make_can_msg(self, addr, bus, values, counter=-1): + addr, msg = self.pack_bytes(addr, values, counter) + return [addr, 0, msg, bus] if __name__ == "__main__": diff --git a/selfdrive/can/parser.cc b/selfdrive/can/parser.cc index 828f95a939987b..a32844fea473ac 100644 --- a/selfdrive/can/parser.cc +++ b/selfdrive/can/parser.cc @@ -27,19 +27,6 @@ #define MAX_BAD_COUNTER 5 -namespace { - -uint64_t read_u64_be(const uint8_t* v) { - return (((uint64_t)v[0] << 56) - | ((uint64_t)v[1] << 48) - | ((uint64_t)v[2] << 40) - | ((uint64_t)v[3] << 32) - | ((uint64_t)v[4] << 24) - | ((uint64_t)v[5] << 16) - | ((uint64_t)v[6] << 8) - | (uint64_t)v[7]); -} - unsigned int honda_checksum(unsigned int address, uint64_t d, int l) { d >>= ((8-l)*8); // remove padding d >>= 4; // remove checksum @@ -60,10 +47,24 @@ unsigned int toyota_checksum(unsigned int address, uint64_t d, int l) { unsigned int s = l; while (address) { s += address & 0xff; address >>= 8; } while (d) { s += d & 0xff; d >>= 8; } - + return s & 0xFF; } +namespace { + +uint64_t read_u64_be(const uint8_t* v) { + return (((uint64_t)v[0] << 56) + | ((uint64_t)v[1] << 48) + | ((uint64_t)v[2] << 40) + | ((uint64_t)v[3] << 32) + | ((uint64_t)v[4] << 24) + | ((uint64_t)v[5] << 16) + | ((uint64_t)v[6] << 8) + | (uint64_t)v[7]); +} + + struct MessageState { uint32_t address; unsigned int size; @@ -99,7 +100,7 @@ struct MessageState { return false; } } else if (sig.type == SignalType::TOYOTA_CHECKSUM) { - // DEBUG("CHECKSUM %d %d %018llX - %lld vs %d\n", address, size, dat, tmp, toyota_checksum(address, dat, size)); + // INFO("CHECKSUM %d %d %018llX - %lld vs %d\n", address, size, dat, tmp, toyota_checksum(address, dat, size)); if (toyota_checksum(address, dat, size) != tmp) { INFO("%X CHECKSUM FAIL\n", address); @@ -140,13 +141,19 @@ class CANParser { public: CANParser(int abus, const std::string& dbc_name, const std::vector &options, - const std::vector &sigoptions) + const std::vector &sigoptions, + bool sendcan) : bus(abus) { // connect to can on 8006 context = zmq_ctx_new(); subscriber = zmq_socket(context, ZMQ_SUB); zmq_setsockopt(subscriber, ZMQ_SUBSCRIBE, "", 0); - zmq_connect(subscriber, "tcp://127.0.0.1:8006"); + + if (sendcan) { + zmq_connect(subscriber, "tcp://127.0.0.1:8017"); + } else { + zmq_connect(subscriber, "tcp://127.0.0.1:8006"); + } dbc = dbc_lookup(dbc_name); assert(dbc); @@ -274,7 +281,7 @@ class CANParser { // extract the messages capnp::FlatArrayMessageReader cmsg(amsg); cereal::Event::Reader event = cmsg.getRoot(); - + auto cans = event.getCan(); UpdateCans(sec, cans); @@ -290,7 +297,7 @@ class CANParser { for (const auto& kv : message_states) { const auto& state = kv.second; if (sec != 0 && state.seen != sec) continue; - + for (int i=0; i(message_options, message_options+num_message_options) - : std::vector{}), - (signal_options ? std::vector(signal_options, signal_options+num_signal_options) - : std::vector{})); + (message_options ? std::vector(message_options, message_options+num_message_options) + : std::vector{}), + (signal_options ? std::vector(signal_options, signal_options+num_signal_options) + : std::vector{}), sendcan); return (void*)ret; } @@ -376,7 +384,7 @@ int main(int argc, char** argv) { {0x30c, 0}, }, std::vector{ - // sig_name, sig_address, default + // sig_name, sig_address, default {0x158, "XMISSION_SPEED", 0}, {0x1d0, "WHEEL_SPEED_FL", 0}, {0x1d0, "WHEEL_SPEED_FR", 0}, diff --git a/selfdrive/can/parser.py b/selfdrive/can/parser.py index c15fe59e4437f2..13603b78813bdb 100644 --- a/selfdrive/can/parser.py +++ b/selfdrive/can/parser.py @@ -1,4 +1,3 @@ -import os import time from collections import defaultdict import numbers @@ -6,7 +5,7 @@ from selfdrive.can.libdbc_py import libdbc, ffi class CANParser(object): - def __init__(self, dbc_name, signals, checks=[], bus=0): + def __init__(self, dbc_name, signals, checks=[], bus=0, sendcan=False): self.can_valid = True self.vl = defaultdict(dict) self.ts = defaultdict(dict) @@ -56,12 +55,12 @@ def __init__(self, dbc_name, signals, checks=[], bus=0): message_options_c = ffi.new("MessageParseOptions[]", [ { - 'address': address, + 'address': msg_address, 'check_frequency': freq, - } for address, freq in message_options.iteritems()]) + } for msg_address, freq in message_options.iteritems()]) self.can = libdbc.can_init(bus, dbc_name, len(message_options_c), message_options_c, - len(signal_options_c), signal_options_c) + len(signal_options_c), signal_options_c, sendcan) self.p_can_valid = ffi.new("bool*") diff --git a/selfdrive/can/process_dbc.py b/selfdrive/can/process_dbc.py index 9acf125ab4df28..c3cb480992502d 100755 --- a/selfdrive/can/process_dbc.py +++ b/selfdrive/can/process_dbc.py @@ -26,11 +26,28 @@ if can_dbc.name.startswith("honda") or can_dbc.name.startswith("acura"): checksum_type = "honda" + checksum_size = 4 elif can_dbc.name.startswith("toyota"): checksum_type = "toyota" + checksum_size = 8 else: checksum_type = None +for address, msg_name, msg_size, sigs in msgs: + for sig in sigs: + if checksum_type is not None and sig.name == "CHECKSUM": + if sig.size != checksum_size: + sys.exit("CHECKSUM is not %d bits longs %s" % (checksum_size, msg_name)) + if checksum_type == "honda" and sig.start_bit % 8 != 3: + sys.exit("CHECKSUM starts at wrong bit %s" % msg_name) + if checksum_type == "toyota" and sig.start_bit % 8 != 7: + sys.exit("CHECKSUM starts at wrong bit %s" % msg_name) + if checksum_type == "honda" and sig.name == "COUNTER": + if sig.size != 2: + sys.exit("COUNTER is not 2 bits longs %s" % msg_name) + if sig.start_bit % 8 != 5: + sys.exit("COUNTER starts at wrong bit %s" % msg_name) + # Fail on duplicate messgae names c = Counter([msg_name for address, msg_name, msg_size, sigs in msgs]) diff --git a/selfdrive/car/__init__.py b/selfdrive/car/__init__.py index c5668bcdffa057..8b85dbd4a73ba0 100644 --- a/selfdrive/car/__init__.py +++ b/selfdrive/car/__init__.py @@ -1,5 +1,4 @@ import os -from cereal import car from common.realtime import sec_since_boot from common.fingerprints import eliminate_incompatible_cars, all_known_cars @@ -27,11 +26,13 @@ HONDA.ACURA_ILX: HondaInterface, HONDA.CRV: HondaInterface, HONDA.ODYSSEY: HondaInterface, + HONDA.ACURA_RDX: HondaInterface, TOYOTA.PRIUS: ToyotaInterface, TOYOTA.RAV4: ToyotaInterface, TOYOTA.RAV4H: ToyotaInterface, TOYOTA.COROLLA: ToyotaInterface, + TOYOTA.LEXUS_RXH: ToyotaInterface, "simulator2": Sim2Interface, "mock": MockInterface @@ -62,7 +63,8 @@ def fingerprint(logcan, timeout): # message has elapsed, exit. Toyota needs higher time_fingerprint, since DSU does not # broadcast immediately if len(candidate_cars) == 1 and st is not None: - time_fingerprint = 1.0 if "TOYOTA" in candidate_cars[0] else 0.1 + # TODO: better way to decide to wait more if Toyota + time_fingerprint = 1.0 if ("TOYOTA" in candidate_cars[0] or "LEXUS" in candidate_cars[0]) else 0.1 if (ts-st) > time_fingerprint: break diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py index 5372a44de41836..c1b8d7b3db9591 100644 --- a/selfdrive/car/honda/carcontroller.py +++ b/selfdrive/car/honda/carcontroller.py @@ -2,7 +2,6 @@ import os from selfdrive.boardd.boardd import can_list_to_can_capnp from selfdrive.controls.lib.drive_helpers import rate_limit -from common.realtime import sec_since_boot from common.numpy_fast import clip from . import hondacan from .values import AH @@ -115,13 +114,12 @@ def update(self, sendcan, enabled, CS, frame, actuators, \ # **** process the car messages **** # *** compute control surfaces *** - tt = sec_since_boot() GAS_MAX = 1004 BRAKE_MAX = 1024/4 if CS.CP.carFingerprint in (CAR.CIVIC, CAR.ODYSSEY): - is_fw_modified = os.getenv("DONGLE_ID") in ['b0f5a01cf604185c'] + is_fw_modified = os.getenv("DONGLE_ID") in ['99c94dc769b5d96e'] STEER_MAX = 0x1FFF if is_fw_modified else 0x1000 - elif CS.crv: + elif CS.CP.carFingerprint in (CAR.CRV, CAR.ACURA_RDX): STEER_MAX = 0x3e8 # CR-V only uses 12-bits and requires a lower value (max value from energee) else: STEER_MAX = 0xF00 diff --git a/selfdrive/car/honda/carstate.py b/selfdrive/car/honda/carstate.py index 4d896a1e174742..374dfa343158d7 100644 --- a/selfdrive/car/honda/carstate.py +++ b/selfdrive/car/honda/carstate.py @@ -1,7 +1,5 @@ import os -from cereal import car from common.numpy_fast import interp -import selfdrive.messaging as messaging from selfdrive.can.parser import CANParser from selfdrive.config import Conversions as CV from common.kalman.simple_kalman import KF1D @@ -23,7 +21,7 @@ def parse_gear_shifter(can_gear_shifter, car_fingerprint): return "drive" elif can_gear_shifter == 0xa: return "sport" - elif car_fingerprint in (CAR.CIVIC, CAR.CRV): + elif car_fingerprint in (CAR.CIVIC, CAR.CRV, CAR.ACURA_RDX): if can_gear_shifter == 0x4: return "neutral" elif can_gear_shifter == 0x8: @@ -115,10 +113,12 @@ def get_can_signals(CP): elif CP.carFingerprint == CAR.CRV: dbc_f = 'honda_crv_touring_2016_can_generated.dbc' signals += [("MAIN_ON", "SCM_BUTTONS", 0)] + elif CP.carFingerprint == CAR.ACURA_RDX: + dbc_f = 'acura_rdx_2018_can_generated.dbc' + signals += [("MAIN_ON", "SCM_BUTTONS", 0)] elif CP.carFingerprint == CAR.ODYSSEY: dbc_f = 'honda_odyssey_exl_2018_generated.dbc' - signals += [("CAR_GAS", "GAS_PEDAL_2", 0), - ("MAIN_ON", "SCM_FEEDBACK", 0), + signals += [("MAIN_ON", "SCM_FEEDBACK", 0), ("EPB_STATE", "EPB_STATUS", 0), ("BRAKE_HOLD_ACTIVE", "VSA_STATUS", 0)] checks += [("EPB_STATUS", 50)] @@ -235,6 +235,7 @@ def update(self, cp): else: self.park_brake = 0 # TODO self.brake_hold = 0 # TODO + self.main_on = cp.vl["SCM_BUTTONS"]['MAIN_ON'] self.cruise_speed_offset = calc_cruise_offset(cp.vl["CRUISE_PARAMS"]['CRUISE_SPEED_OFFSET'], self.v_ego) @@ -242,12 +243,16 @@ def update(self, cp): self.pedal_gas = cp.vl["POWERTRAIN_DATA"]['PEDAL_GAS'] # crv doesn't include cruise control - if self.CP.carFingerprint != CAR.CRV: - self.car_gas = cp.vl["GAS_PEDAL_2"]['CAR_GAS'] - else: + if self.CP.carFingerprint in (CAR.CRV, CAR.ODYSSEY, CAR.ACURA_RDX): self.car_gas = self.pedal_gas + else: + self.car_gas = cp.vl["GAS_PEDAL_2"]['CAR_GAS'] - self.steer_override = abs(cp.vl["STEER_STATUS"]['STEER_TORQUE_SENSOR']) > 1200 + #rdx has different steer override threshold + if self.CP.carFingerprint in (CAR.ACURA_RDX): + self.steer_override = abs(cp.vl["STEER_STATUS"]['STEER_TORQUE_SENSOR']) > 400 + else: + self.steer_override = abs(cp.vl["STEER_STATUS"]['STEER_TORQUE_SENSOR']) > 1200 self.steer_torque_driver = cp.vl["STEER_STATUS"]['STEER_TORQUE_SENSOR'] # brake switch has shown some single time step noise, so only considered when @@ -270,7 +275,6 @@ def update(self, cp): if __name__ == '__main__': import zmq import time - from selfdrive.services import service_list context = zmq.Context() class CarParams(object): diff --git a/selfdrive/car/honda/hondacan.py b/selfdrive/car/honda/hondacan.py index 81ae038099c050..0f9544be1a098a 100644 --- a/selfdrive/car/honda/hondacan.py +++ b/selfdrive/car/honda/hondacan.py @@ -49,11 +49,10 @@ def create_gas_command(gas_amount, idx): msg = struct.pack("!H", gas_amount) return make_can_msg(0x200, msg, idx, 0) - def create_steering_control(apply_steer, car_fingerprint, idx): """Creates a CAN message for the Honda DBC STEERING_CONTROL.""" commands = [] - if car_fingerprint == CAR.CRV: + if car_fingerprint in (CAR.CRV, CAR.ACURA_RDX): msg_0x194 = struct.pack("!h", apply_steer << 4) + ("\x80" if apply_steer != 0 else "\x00") commands.append(make_can_msg(0x194, msg_0x194, idx, 0)) else: @@ -80,7 +79,6 @@ def create_ui_commands(pcm_speed, hud, car_fingerprint, idx): commands.append(make_can_msg(0x39f, msg_0x39f, idx, 0)) return commands - def create_radar_commands(v_ego, car_fingerprint, idx): """Creates an iterable of CAN messages for the radar system.""" commands = [] @@ -97,6 +95,9 @@ def create_radar_commands(v_ego, car_fingerprint, idx): elif car_fingerprint == CAR.CRV: msg_0x301 = "\x00\x00\x50\x02\x51\x00\x00" commands.append(make_can_msg(0x300, msg_0x300, idx, 1)) + elif car_fingerprint == CAR.ACURA_RDX: + msg_0x301 = "\x0f\x57\x4f\x02\x5a\x00\x00" + commands.append(make_can_msg(0x300, msg_0x300, idx, 1)) elif car_fingerprint == CAR.ODYSSEY: msg_0x301 = "\x00\x00\x56\x02\x55\x00\x00" commands.append(make_can_msg(0x300, msg_0x300, idx, 1)) diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index e6725cb4491bbe..a573b3f23a9531 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -158,7 +158,7 @@ def get_params(candidate, fingerprint): ret.centerToFront = centerToFront_civic ret.steerRatio = 13.0 # Civic at comma has modified steering FW, so different tuning for the Neo in that car - is_fw_modified = os.getenv("DONGLE_ID") in ['b0f5a01cf604185c'] + is_fw_modified = os.getenv("DONGLE_ID") in ['99c94dc769b5d96e'] ret.steerKp, ret.steerKi = [0.4, 0.12] if is_fw_modified else [0.8, 0.24] ret.longitudinalKpBP = [0., 5., 35.] @@ -172,7 +172,7 @@ def get_params(candidate, fingerprint): ret.centerToFront = ret.wheelbase * 0.37 ret.steerRatio = 15.3 # Acura at comma has modified steering FW, so different tuning for the Neo in that car - is_fw_modified = os.getenv("DONGLE_ID") in ['cb38263377b873ee'] + is_fw_modified = os.getenv("DONGLE_ID") in ['85a6c74d4ad9c310'] ret.steerKp, ret.steerKi = [0.4, 0.12] if is_fw_modified else [0.8, 0.24] ret.longitudinalKpBP = [0., 5., 35.] @@ -191,6 +191,18 @@ def get_params(candidate, fingerprint): ret.longitudinalKpV = [1.2, 0.8, 0.5] ret.longitudinalKiBP = [0., 35.] ret.longitudinalKiV = [0.18, 0.12] + elif candidate == CAR.ACURA_RDX: + stop_and_go = False + ret.mass = 3935./2.205 + std_cargo + ret.wheelbase = 2.68 + ret.centerToFront = ret.wheelbase * 0.38 + ret.steerRatio = 15.0 + ret.steerKp, ret.steerKi = 0.8, 0.24 + + ret.longitudinalKpBP = [0., 5., 35.] + ret.longitudinalKpV = [1.2, 0.8, 0.5] + ret.longitudinalKiBP = [0., 35.] + ret.longitudinalKiV = [0.18, 0.12] elif candidate == CAR.ODYSSEY: stop_and_go = False ret.mass = 4354./2.205 + std_cargo diff --git a/selfdrive/car/honda/radar_interface.py b/selfdrive/car/honda/radar_interface.py index fb2a68693711f7..7cf4c7d61c83f7 100755 --- a/selfdrive/car/honda/radar_interface.py +++ b/selfdrive/car/honda/radar_interface.py @@ -1,6 +1,5 @@ #!/usr/bin/env python import os -import numpy as np from selfdrive.can.parser import CANParser diff --git a/selfdrive/car/mock/interface.py b/selfdrive/car/mock/interface.py index 4f55800c3fc123..3db6eb65e12d65 100755 --- a/selfdrive/car/mock/interface.py +++ b/selfdrive/car/mock/interface.py @@ -1,14 +1,9 @@ #!/usr/bin/env python -import os -import time import zmq -from common.realtime import sec_since_boot -import common.numpy_fast as np from cereal import car from selfdrive.config import Conversions as CV from selfdrive.services import service_list import selfdrive.messaging as messaging -from selfdrive.controls.lib.drive_helpers import EventTypes as ET, create_event # mocked car interface to work with chffrplus TS = 0.01 # 100Hz @@ -110,7 +105,6 @@ def update(self, c): ret.steeringAngle = curvature * self.CP.steerRatio * self.CP.wheelbase * CV.RAD_TO_DEG events = [] - #events.append(create_event('passive', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE])) ret.events = events return ret.as_reader() diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index f762d0fd651575..3fd19f94676179 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -1,14 +1,10 @@ -from common.numpy_fast import clip, interp -from common.realtime import sec_since_boot +from common.numpy_fast import clip from selfdrive.boardd.boardd import can_list_to_can_capnp -from selfdrive.controls.lib.drive_helpers import rate_limit from selfdrive.car.toyota.toyotacan import make_can_msg, create_video_target,\ create_steer_command, create_ui_command, \ create_ipas_steer_command, create_accel_command, \ create_fcw_command from selfdrive.car.toyota.values import ECU, STATIC_MSGS -from common.fingerprints import TOYOTA as CAR - ACCEL_HYST_GAP = 0.02 # don't change accel command for small oscilalitons within this value ACCEL_MAX = 1500 # 1.5 m/s2 @@ -82,7 +78,6 @@ def update(self, sendcan, enabled, CS, frame, actuators, pcm_cancel_cmd, hud_alert, audible_alert): # *** compute control surfaces *** - ts = sec_since_boot() # steer torque is converted back to CAN reference (positive when steering right) apply_accel = actuators.gas - actuators.brake diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py index 4444ead5f5ee2a..24fc85239cf85f 100644 --- a/selfdrive/car/toyota/carstate.py +++ b/selfdrive/car/toyota/carstate.py @@ -1,5 +1,4 @@ import os -import selfdrive.messaging as messaging from common.fingerprints import TOYOTA as CAR from selfdrive.can.parser import CANParser from selfdrive.config import Conversions as CV @@ -20,7 +19,8 @@ def parse_gear_shifter(can_gear, car_fingerprint): return "drive" elif can_gear == 0x4: return "brake" - elif car_fingerprint in [CAR.RAV4, CAR.RAV4H, CAR.COROLLA]: + elif car_fingerprint in [CAR.RAV4, CAR.RAV4H, + CAR.LEXUS_RXH, CAR.COROLLA]: if can_gear == 0x20: return "park" elif can_gear == 0x10: @@ -45,6 +45,8 @@ def get_can_parser(CP): dbc_f = 'toyota_rav4_2017_pt_generated.dbc' elif CP.carFingerprint == CAR.COROLLA: dbc_f = 'toyota_corolla_2017_pt_generated.dbc' + elif CP.carFingerprint == CAR.LEXUS_RXH: + dbc_f = 'lexus_rx_hybrid_2017_pt_generated.dbc' signals = [ # sig_name, sig_address, default diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 20cf8e8db0c387..53cfbb180a5d88 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -1,11 +1,7 @@ #!/usr/bin/env python -import os from common.realtime import sec_since_boot -import common.numpy_fast as np from cereal import car from selfdrive.config import Conversions as CV -from selfdrive.services import service_list -import selfdrive.messaging as messaging from selfdrive.controls.lib.drive_helpers import EventTypes as ET, create_event from selfdrive.controls.lib.vehicle_model import VehicleModel from selfdrive.car.toyota.carstate import CarState, get_can_parser @@ -79,34 +75,44 @@ def get_params(candidate, fingerprint): if candidate == CAR.PRIUS: ret.safetyParam = 66 # see conversion factor for STEER_TORQUE_EPS in dbc file ret.wheelbase = 2.70 - ret.steerRatio = 14.5 #TODO: find exact value for Prius + ret.steerRatio = 14.5 # TODO: find exact value for Prius ret.mass = 3045./2.205 + std_cargo + ret.steerKp, ret.steerKi = 0.6, 0.05 + ret.steerKf = 0.00006 # full torque for 10 deg at 80mph means 0.00007818594 + ret.steerRateCost = 2. elif candidate in [CAR.RAV4, CAR.RAV4H]: ret.safetyParam = 73 # see conversion factor for STEER_TORQUE_EPS in dbc file ret.wheelbase = 2.65 ret.steerRatio = 14.5 # Rav4 2017 ret.mass = 3650./2.205 + std_cargo # mean between normal and hybrid + ret.steerKp, ret.steerKi = 0.6, 0.05 + ret.steerKf = 0.00006 # full torque for 10 deg at 80mph means 0.00007818594 + ret.steerRateCost = 1. elif candidate == CAR.COROLLA: ret.safetyParam = 100 # see conversion factor for STEER_TORQUE_EPS in dbc file ret.wheelbase = 2.70 ret.steerRatio = 17.8 ret.mass = 2860./2.205 + std_cargo # mean between normal and hybrid - - ret.centerToFront = ret.wheelbase * 0.44 - - if candidate == CAR.COROLLA: ret.steerKp, ret.steerKi = 0.2, 0.05 ret.steerKf = 0.00003 # full torque for 20 deg at 80mph means 0.00007818594 - else: - ret.steerKp, ret.steerKi = 0.6, 0.05 + ret.steerRateCost = 1. + elif candidate == CAR.LEXUS_RXH: + ret.safetyParam = 100 # see conversion factor for STEER_TORQUE_EPS in dbc file + ret.wheelbase = 2.79 + ret.steerRatio = 16. # official specs say 14.8, but it does not seem right + ret.mass = 4481./2.205 + std_cargo # mean between min and max + ret.steerKp, ret.steerKi = 0.6, 0.1 ret.steerKf = 0.00006 # full torque for 10 deg at 80mph means 0.00007818594 + ret.steerRateCost = .8 + + ret.centerToFront = ret.wheelbase * 0.44 ret.longPidDeadzoneBP = [0., 9.] ret.longPidDeadzoneV = [0., .15] # min speed to enable ACC. if car can do stop and go, then set enabling speed # to a negative value, so it won't matter. - if candidate in [CAR.PRIUS, CAR.RAV4H]: # rav4 hybrid can do stop and go + if candidate in [CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH]: # rav4 hybrid can do stop and go ret.minEnableSpeed = -1. elif candidate in [CAR.RAV4, CAR.COROLLA]: # TODO: hack ICE to do stop and go ret.minEnableSpeed = 19. * CV.MPH_TO_MS @@ -154,17 +160,11 @@ def get_params(candidate, fingerprint): ret.longitudinalKiBP = [0., 35.] ret.longitudinalKiV = [0.54, 0.36] - if candidate in [CAR.PRIUS]: - ret.steerRateCost = 2. - elif candidate in [CAR.RAV4, CAR.RAV4H, CAR.COROLLA]: - ret.steerRateCost = 1. - return ret # returns a car.CarState def update(self, c): # ******************* do can recv ******************* - can_pub_main = [] canMonoTimes = [] self.cp.update(int(sec_since_boot() * 1e9), False) @@ -189,7 +189,7 @@ def update(self, c): ret.gearShifter = self.CS.gear_shifter # gas pedal - ret.gas = self.CS.car_gas / 256.0 + ret.gas = self.CS.car_gas ret.gasPressed = self.CS.pedal_gas > 0 # brake pedal diff --git a/selfdrive/car/toyota/radar_interface.py b/selfdrive/car/toyota/radar_interface.py index cd60925d0b8431..c06f8b809f8e91 100755 --- a/selfdrive/car/toyota/radar_interface.py +++ b/selfdrive/car/toyota/radar_interface.py @@ -1,6 +1,5 @@ #!/usr/bin/env python import os -import numpy as np from selfdrive.can.parser import CANParser from cereal import car from common.realtime import sec_since_boot @@ -14,7 +13,6 @@ def _create_radard_can_parser(): dbc_f = 'toyota_prius_2017_adas.dbc' msg_n = len(RADAR_MSGS) - msg_last = RADAR_MSGS[-1] signals = zip(['LONG_DIST'] * msg_n + ['NEW_TRACK'] * msg_n + ['LAT_DIST'] * msg_n + ['REL_SPEED'] * msg_n + ['VALID'] * msg_n, RADAR_MSGS * 5, @@ -45,7 +43,7 @@ def update(self): while 1: tm = int(sec_since_boot() * 1e9) updated_messages.update(self.rcp.update(tm, True)) - # TODO: use msg_last + # TODO: do not hardcode last msg if 0x21f in updated_messages: break diff --git a/selfdrive/car/toyota/toyotacan.py b/selfdrive/car/toyota/toyotacan.py index 812032f8dca574..c4c64e45c1c6d0 100644 --- a/selfdrive/car/toyota/toyotacan.py +++ b/selfdrive/car/toyota/toyotacan.py @@ -1,6 +1,4 @@ import struct -import common.numpy_fast as np -from selfdrive.config import Conversions as CV # *** Toyota specific *** @@ -9,21 +7,21 @@ def fix(msg, addr): checksum = 0 idh = (addr & 0xff00) >> 8 idl = (addr & 0xff) - + checksum = idh + idl + len(msg) + 1 for d_byte in msg: checksum += ord(d_byte) - + #return msg + chr(checksum & 0xFF) return msg + struct.pack("B", checksum & 0xFF) - - + + def make_can_msg(addr, dat, alt, cks=False): if cks: dat = fix(dat, addr) return [addr, 0, dat, alt] - - + + def create_video_target(frame, addr): counter = frame & 0xff msg = struct.pack("!BBBBBBB", counter, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00) @@ -42,7 +40,7 @@ def create_ipas_steer_command(steer): move = 0x40 mode = 0x30 if steer else 0x10 - + steer_h = (steer & 0xF00) >> 8 steer_l = steer & 0xff @@ -56,11 +54,11 @@ def create_steer_command(steer, raw_cnt): counter = ((raw_cnt & 0x3f) << 1) | 0x80 if steer != 0: counter |= 1 - + # hud # 00 => Regular # 40 => Actively Steering (with beep) - # 80 => Actively Steering (without beep) + # 80 => Actively Steering (without beep) hud = 0x00 msg = struct.pack("!BhB", counter, steer, hud) @@ -86,6 +84,6 @@ def create_fcw_command(fcw): def create_ui_command(steer, sound1, sound2): - msg = struct.pack("!BBBBBBBB", 0x54, 0x04 + steer + (sound2<<4), 0x0C, 0x00, + msg = struct.pack("!BBBBBBBB", 0x54, 0x04 + steer + (sound2<<4), 0x0C, 0x00, sound1, 0x2C, 0x38, 0x02) return make_can_msg(0x412, msg, 0, False) diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index 212b45b7af2a1c..937e32209cb58d 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -7,48 +7,48 @@ class ECU: # addr: (ecu, cars, bus, 1/freq*100, vl) -STATIC_MSGS = [(0x141, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 1, 2, '\x00\x00\x00\x46'), - (0x128, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 1, 3, '\xf4\x01\x90\x83\x00\x37'), - - (0x292, ECU.APGS, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 3, '\x00\x00\x00\x00\x00\x00\x00\x9e'), - (0x283, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 3, '\x00\x00\x00\x00\x00\x00\x8c'), - (0x2E6, ECU.DSU, (CAR.PRIUS, CAR.RAV4H), 0, 3, '\xff\xf8\x00\x08\x7f\xe0\x00\x4e'), - (0x2E7, ECU.DSU, (CAR.PRIUS, CAR.RAV4H), 0, 3, '\xa8\x9c\x31\x9c\x00\x00\x00\x02'), - - (0x240, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 1, 5, '\x00\x10\x01\x00\x10\x01\x00'), - (0x241, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 1, 5, '\x00\x10\x01\x00\x10\x01\x00'), - (0x244, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 1, 5, '\x00\x10\x01\x00\x10\x01\x00'), - (0x245, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 1, 5, '\x00\x10\x01\x00\x10\x01\x00'), - (0x248, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 1, 5, '\x00\x00\x00\x00\x00\x00\x01'), - (0x344, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 5, '\x00\x00\x01\x00\x00\x00\x00\x50'), - - (0x160, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 1, 7, '\x00\x00\x08\x12\x01\x31\x9c\x51'), - (0x161, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 1, 7, '\x00\x1e\x00\x00\x00\x80\x07'), - - (0x32E, ECU.APGS, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 20, '\x00\x00\x00\x00\x00\x00\x00\x00'), - (0x33E, ECU.DSU, (CAR.PRIUS, CAR.RAV4H), 0, 20, '\x0f\xff\x26\x40\x00\x1f\x00'), - (0x365, ECU.DSU, (CAR.PRIUS, CAR.RAV4H), 0, 20, '\x00\x00\x00\x80\x03\x00\x08'), +STATIC_MSGS = [(0x141, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 1, 2, '\x00\x00\x00\x46'), + (0x128, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 1, 3, '\xf4\x01\x90\x83\x00\x37'), + + (0x292, ECU.APGS, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 3, '\x00\x00\x00\x00\x00\x00\x00\x9e'), + (0x283, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 3, '\x00\x00\x00\x00\x00\x00\x8c'), + (0x2E6, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 3, '\xff\xf8\x00\x08\x7f\xe0\x00\x4e'), + (0x2E7, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 3, '\xa8\x9c\x31\x9c\x00\x00\x00\x02'), + + (0x240, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 1, 5, '\x00\x10\x01\x00\x10\x01\x00'), + (0x241, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 1, 5, '\x00\x10\x01\x00\x10\x01\x00'), + (0x244, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 1, 5, '\x00\x10\x01\x00\x10\x01\x00'), + (0x245, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 1, 5, '\x00\x10\x01\x00\x10\x01\x00'), + (0x248, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 1, 5, '\x00\x00\x00\x00\x00\x00\x01'), + (0x344, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 5, '\x00\x00\x01\x00\x00\x00\x00\x50'), + + (0x160, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 1, 7, '\x00\x00\x08\x12\x01\x31\x9c\x51'), + (0x161, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 1, 7, '\x00\x1e\x00\x00\x00\x80\x07'), + + (0x32E, ECU.APGS, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 20, '\x00\x00\x00\x00\x00\x00\x00\x00'), + (0x33E, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 20, '\x0f\xff\x26\x40\x00\x1f\x00'), + (0x365, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 20, '\x00\x00\x00\x80\x03\x00\x08'), (0x365, ECU.DSU, (CAR.RAV4, CAR.COROLLA), 0, 20, '\x00\x00\x00\x80\xfc\x00\x08'), - (0x366, ECU.DSU, (CAR.PRIUS, CAR.RAV4H), 0, 20, '\x00\x00\x4d\x82\x40\x02\x00'), + (0x366, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 0, 20, '\x00\x00\x4d\x82\x40\x02\x00'), (0x366, ECU.DSU, (CAR.RAV4, CAR.COROLLA), 0, 20, '\x00\x72\x07\xff\x09\xfe\x00'), - (0x367, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 40, '\x06\x00'), + (0x367, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 40, '\x06\x00'), - (0x414, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 100, '\x00\x00\x00\x00\x00\x00\x17\x00'), - (0x489, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 100, '\x00\x00\x00\x00\x00\x00\x00'), - (0x48a, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 100, '\x00\x00\x00\x00\x00\x00\x00'), - (0x48b, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 100, '\x66\x06\x08\x0a\x02\x00\x00\x00'), - (0x4d3, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 100, '\x1C\x00\x00\x01\x00\x00\x00\x00'), - (0x130, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 1, 100, '\x00\x00\x00\x00\x00\x00\x38'), - (0x466, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4), 1, 100, '\x20\x20\xAD'), + (0x414, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 100, '\x00\x00\x00\x00\x00\x00\x17\x00'), + (0x489, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 100, '\x00\x00\x00\x00\x00\x00\x00'), + (0x48a, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 100, '\x00\x00\x00\x00\x00\x00\x00'), + (0x48b, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 100, '\x66\x06\x08\x0a\x02\x00\x00\x00'), + (0x4d3, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 100, '\x1C\x00\x00\x01\x00\x00\x00\x00'), + (0x130, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 1, 100, '\x00\x00\x00\x00\x00\x00\x38'), + (0x466, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4), 1, 100, '\x20\x20\xAD'), (0x466, ECU.CAM, (CAR.COROLLA), 1, 100, '\x24\x20\xB1'), - (0x396, ECU.APGS, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 100, '\xBD\x00\x00\x00\x60\x0F\x02\x00'), - (0x43A, ECU.APGS, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 100, '\x84\x00\x00\x00\x00\x00\x00\x00'), - (0x43B, ECU.APGS, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 100, '\x00\x00\x00\x00\x00\x00\x00\x00'), - (0x497, ECU.APGS, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 100, '\x00\x00\x00\x00\x00\x00\x00\x00'), - (0x4CC, ECU.APGS, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 100, '\x0D\x00\x00\x00\x00\x00\x00\x00'), - (0x4CB, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.RAV4, CAR.COROLLA), 0, 100, '\x0c\x00\x00\x00\x00\x00\x00\x00'), - (0x470, ECU.DSU, (CAR.PRIUS, CAR.RAV4H), 1, 100, '\x00\x00\x02\x7a'), + (0x396, ECU.APGS, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 100, '\xBD\x00\x00\x00\x60\x0F\x02\x00'), + (0x43A, ECU.APGS, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 100, '\x84\x00\x00\x00\x00\x00\x00\x00'), + (0x43B, ECU.APGS, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 100, '\x00\x00\x00\x00\x00\x00\x00\x00'), + (0x497, ECU.APGS, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 100, '\x00\x00\x00\x00\x00\x00\x00\x00'), + (0x4CC, ECU.APGS, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 100, '\x0D\x00\x00\x00\x00\x00\x00\x00'), + (0x4CB, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA), 0, 100, '\x0c\x00\x00\x00\x00\x00\x00\x00'), + (0x470, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH), 1, 100, '\x00\x00\x02\x7a'), ] diff --git a/selfdrive/common/version.h b/selfdrive/common/version.h index b5ca9cccd47a63..348ff45913417a 100644 --- a/selfdrive/common/version.h +++ b/selfdrive/common/version.h @@ -1 +1 @@ -#define COMMA_VERSION "0.4.1-openpilot" +#define COMMA_VERSION "0.4.2-openpilot" diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 729eabf8b59015..483868aa371547 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -73,7 +73,7 @@ def data_sample(CI, CC, thermal, calibration, health, poller, cal_status, overte overtemp_proc = any(t > 950 for t in (td.thermal.cpu0, td.thermal.cpu1, td.thermal.cpu2, td.thermal.cpu3, td.thermal.mem, td.thermal.gpu)) - overtemp_bat = td.thermal.bat > 50000 # 50c + overtemp_bat = td.thermal.bat > 60000 # 60c overtemp = overtemp_proc or overtemp_bat # under 15% of space free no enable allowed diff --git a/selfdrive/controls/lib/latcontrol.py b/selfdrive/controls/lib/latcontrol.py index 1feec0f5647a0a..74020a59204465 100644 --- a/selfdrive/controls/lib/latcontrol.py +++ b/selfdrive/controls/lib/latcontrol.py @@ -94,9 +94,9 @@ def update(self, active, v_ego, angle_steers, steer_override, d_poly, angle_offs output_steer = 0.0 self.pid.reset() else: - dt = min(cur_time - self.angle_steers_des_time, _DT_MPC + _DT) + _DT # no greater than dt mpc + dt, to prevent too high extraps # TODO: ideally we should interp, but for tuning reasons we keep the mpc solution # constant for 0.05s. + #dt = min(cur_time - self.angle_steers_des_time, _DT_MPC + _DT) + _DT # no greater than dt mpc + dt, to prevent too high extraps #self.angle_steers_des = self.angle_steers_des_prev + (dt / _DT_MPC) * (self.angle_steers_des_mpc - self.angle_steers_des_prev) self.angle_steers_des = self.angle_steers_des_mpc steers_max = get_steer_max(VM.CP, v_ego) diff --git a/selfdrive/controls/lib/longcontrol.py b/selfdrive/controls/lib/longcontrol.py index 0257898f692ecd..d6a7cc76900d8a 100644 --- a/selfdrive/controls/lib/longcontrol.py +++ b/selfdrive/controls/lib/longcontrol.py @@ -1,6 +1,4 @@ -import numpy as np from common.numpy_fast import clip, interp -from selfdrive.config import Conversions as CV from selfdrive.controls.lib.pid import PIController STOPPING_EGO_SPEED = 0.5 diff --git a/selfdrive/controls/lib/planner.py b/selfdrive/controls/lib/planner.py index 1772325a5702d6..219ba42eed2609 100755 --- a/selfdrive/controls/lib/planner.py +++ b/selfdrive/controls/lib/planner.py @@ -7,7 +7,6 @@ from collections import defaultdict from common.realtime import sec_since_boot -from common.params import Params from common.numpy_fast import interp import selfdrive.messaging as messaging from selfdrive.swaglog import cloudlog diff --git a/selfdrive/controls/lib/radar_helpers.py b/selfdrive/controls/lib/radar_helpers.py index 6dbb72c5c40972..0fa226bc951eec 100644 --- a/selfdrive/controls/lib/radar_helpers.py +++ b/selfdrive/controls/lib/radar_helpers.py @@ -1,6 +1,5 @@ import os import sys -import math import platform import numpy as np diff --git a/selfdrive/controls/radard.py b/selfdrive/controls/radard.py index f02fb79e1baf58..4ffe15cb0e715e 100755 --- a/selfdrive/controls/radard.py +++ b/selfdrive/controls/radard.py @@ -1,8 +1,6 @@ #!/usr/bin/env python -import os import zmq import numpy as np -import numpy.matlib import importlib from collections import defaultdict from fastcluster import linkage_vector @@ -16,7 +14,7 @@ from selfdrive.swaglog import cloudlog from cereal import car from common.params import Params -from common.realtime import sec_since_boot, set_realtime_priority, Ratekeeper +from common.realtime import set_realtime_priority, Ratekeeper from common.kalman.ekf import EKF, SimpleSensor DEBUG = False diff --git a/selfdrive/debug/can_printer.py b/selfdrive/debug/can_printer.py index 115b54ea60f4ea..75a5ea698db53f 100755 --- a/selfdrive/debug/can_printer.py +++ b/selfdrive/debug/can_printer.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import os import sys -import struct from collections import defaultdict from common.realtime import sec_since_boot import zmq diff --git a/selfdrive/debug/get_fingerprint.py b/selfdrive/debug/get_fingerprint.py index c4b1e9835dd2c4..97476cc61d9518 100755 --- a/selfdrive/debug/get_fingerprint.py +++ b/selfdrive/debug/get_fingerprint.py @@ -19,7 +19,8 @@ while True: lc = messaging.recv_sock(logcan, True) for c in lc.can: - if c.src == 0: + # read also msgs sent by EON on CAN bus 0x80 + if c.src%0x80 == 0: msgs[c.address] = len(c.dat) fingerprint = ', '.join("%d: %d" % v for v in sorted(msgs.items())) diff --git a/selfdrive/debug/getframes/getframes.py b/selfdrive/debug/getframes/getframes.py index 498716faf1dbee..8ab2811d54d575 100755 --- a/selfdrive/debug/getframes/getframes.py +++ b/selfdrive/debug/getframes/getframes.py @@ -1,9 +1,7 @@ #!/usr/bin/env python import os -import time import subprocess from cffi import FFI -import ctypes import numpy as np diff --git a/selfdrive/debug/test_carcontroller.py b/selfdrive/debug/test_carcontroller.py deleted file mode 100755 index d672cfb3d3c371..00000000000000 --- a/selfdrive/debug/test_carcontroller.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env python -import time -import numpy as np -import zmq -from evdev import InputDevice -from select import select - -from cereal import car -from common.realtime import Ratekeeper - -import selfdrive.messaging as messaging -from selfdrive.services import service_list -from selfdrive.car import get_car - - -if __name__ == "__main__": - # ***** connect to joystick ***** - # we use a Mad Catz V.1 - dev = InputDevice("/dev/input/event8") - print dev - - button_values = [0]*7 - axis_values = [0.0, 0.0, 0.0] - - # ***** connect to car ***** - context = zmq.Context() - logcan = messaging.sub_sock(context, service_list['can'].port) - sendcan = messaging.pub_sock(context, service_list['sendcan'].port) - - CI, CP = get_car(logcan, sendcan) - CC = car.CarControl.new_message() - - rk = Ratekeeper(100) - - while 1: - # **** handle joystick **** - r, w, x = select([dev], [], [], 0.0) - if dev in r: - for event in dev.read(): - # button event - if event.type == 1: - btn = event.code - 288 - if btn >= 0 and btn < 7: - button_values[btn] = int(event.value) - - # axis move event - if event.type == 3: - if event.code < 3: - if event.code == 2: - axis_values[event.code] = np.clip((255-int(event.value))/250.0, 0.0, 1.0) - else: - DEADZONE = 5 - if event.value-DEADZONE < 128 and event.value+DEADZONE > 128: - event.value = 128 - axis_values[event.code] = np.clip((int(event.value)-128)/120.0, -1.0, 1.0) - - print axis_values, button_values - # **** handle car **** - - CS = CI.update(CC) - #print CS - CC = car.CarControl.new_message() - - - CC.enabled = True - - CC.gas = float(np.clip(-axis_values[1], 0, 1.0)) - CC.brake = float(np.clip(axis_values[1], 0, 1.0)) - CC.steeringTorque = float(-axis_values[0]) - - CC.hudControl.speedVisible = bool(button_values[1]) - CC.hudControl.lanesVisible = bool(button_values[2]) - CC.hudControl.leadVisible = bool(button_values[3]) - - CC.cruiseControl.override = bool(button_values[0]) - CC.cruiseControl.cancel = bool(button_values[-1]) - - CC.hudControl.setSpeed = float(axis_values[2] * 100.0) - - # TODO: test alerts - CC.hudControl.visualAlert = "none" - CC.hudControl.audibleAlert = "none" - - #print CC - - if not CI.apply(CC): - print "CONTROLS FAILED" - - rk.keep_time() - - - diff --git a/selfdrive/debug/test_carstate.py b/selfdrive/debug/test_carstate.py deleted file mode 100755 index 98d2f7fc154427..00000000000000 --- a/selfdrive/debug/test_carstate.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python -import os -import zmq -from cereal import car - -import selfdrive.messaging as messaging -from selfdrive.services import service_list - -from selfdrive.car import get_car - -def bpressed(CS, btype): - for b in CS.buttonEvents: - if b.type == btype: - return True - return False - -def test_loop(): - context = zmq.Context() - logcan = messaging.sub_sock(context, service_list['can'].port) - - CI, CP = get_car(logcan) - - state = 0 - - states = [ - "'seatbeltNotLatched' in CS.errors", - "CS.gasPressed", - "CS.brakePressed", - "CS.steeringPressed", - "bpressed(CS, 'leftBlinker')", - "bpressed(CS, 'rightBlinker')", - "bpressed(CS, 'cancel')", - "bpressed(CS, 'accelCruise')", - "bpressed(CS, 'decelCruise')", - "bpressed(CS, 'altButton1')", - "'doorOpen' in CS.errors", - "False"] - - while 1: - CC = car.CarControl.new_message() - # read CAN - CS = CI.update(CC) - - while eval(states[state]) == True: - state += 1 - - print "IN STATE %d: waiting for %s" % (state, states[state]) - #print CS - -if __name__ == "__main__": - test_loop() - diff --git a/selfdrive/loggerd/loggerd b/selfdrive/loggerd/loggerd index d4f35f05833511..df38b2bfd7e317 100755 Binary files a/selfdrive/loggerd/loggerd and b/selfdrive/loggerd/loggerd differ diff --git a/selfdrive/manager.py b/selfdrive/manager.py index 1d90cca83f57a3..c374f2ef9abe8b 100755 --- a/selfdrive/manager.py +++ b/selfdrive/manager.py @@ -1,8 +1,6 @@ #!/usr/bin/env python2.7 - import os import sys -import time import fcntl import errno import signal @@ -53,7 +51,6 @@ sys.path.append(os.path.join(BASEDIR, "pyextra")) os.environ['BASEDIR'] = BASEDIR -import usb1 import zmq from setproctitle import setproctitle from smbus2 import SMBus @@ -250,15 +247,19 @@ def manager_init(): if "-private" in subprocess.check_output(["git", "config", "--get", "remote.origin.url"]): upstream = "origin/master" else: - upstream = "origin/release" + if 'chffrplus' in version: + upstream = "origin/release" + else: + upstream = "origin/release2" + dirty = subprocess.call(["git", "diff-index", "--quiet", upstream, "--"]) != 0 cloudlog.info("dirty is %d" % dirty) if not dirty: os.environ['CLEAN'] = '1' - cloudlog.bind_global(dongle_id=dongle_id, version=version, dirty=dirty) + cloudlog.bind_global(dongle_id=dongle_id, version=version, dirty=dirty, is_eon=EON) crash.bind_user(id=dongle_id) - crash.bind_extra(version=version, dirty=dirty) + crash.bind_extra(version=version, dirty=dirty, is_eon=EON) os.umask(0) try: @@ -463,7 +464,7 @@ def manager_thread(): if passive and not ignition_seen: should_start = should_start or passive_starter.update(started_ts, location) - # with 2% left, we killall, otherwise the phone is bricked + # with 2% left, we killall, otherwise the phone will take a long time to boot should_start = should_start and avail > 0.02 # require usb power @@ -471,9 +472,10 @@ def manager_thread(): should_start = should_start and accepted_terms and (not do_uninstall) - # if any CPU gets above 107 or the battery gets above 53, kill all processes - # controls will warn with CPU above 95 or battery above 50 - if max_temp > 107.0 or msg.thermal.bat >= 53000: + # if any CPU gets above 107 or the battery gets above 63, kill all processes + # controls will warn with CPU above 95 or battery above 60 + if max_temp > 107.0 or msg.thermal.bat >= 63000: + # TODO: Add a better warning when this is happening should_start = False if should_start: @@ -554,7 +556,7 @@ def update_apks(): cloudlog.info("installed apks %s" % (str(installed), )) for app in installed.iterkeys(): - + apk_path = os.path.join(BASEDIR, "apk/"+app+".apk") if not os.path.exists(apk_path): apk_path = os.path.join(BASEDIR, "apk/external/out/"+app+".apk") diff --git a/selfdrive/registration.py b/selfdrive/registration.py index ff522a12e379ee..d444ded20a8133 100644 --- a/selfdrive/registration.py +++ b/selfdrive/registration.py @@ -1,4 +1,3 @@ -import os import json import subprocess diff --git a/selfdrive/sensord/gpsd b/selfdrive/sensord/gpsd index d33c881179bc70..c4fd9158750f8b 100755 Binary files a/selfdrive/sensord/gpsd and b/selfdrive/sensord/gpsd differ diff --git a/selfdrive/sensord/sensord b/selfdrive/sensord/sensord index bc3396ada48a63..75fd6cc6e199f5 100755 Binary files a/selfdrive/sensord/sensord and b/selfdrive/sensord/sensord differ diff --git a/selfdrive/test/plant/maneuver.py b/selfdrive/test/plant/maneuver.py index af370ea7b6c370..1564aac51deca6 100644 --- a/selfdrive/test/plant/maneuver.py +++ b/selfdrive/test/plant/maneuver.py @@ -1,5 +1,3 @@ -import os -from enum import Enum from maneuverplots import ManeuverPlot from plant import Plant import numpy as np @@ -31,7 +29,6 @@ def evaluate(self): ) last_live100 = None - event_queue = sorted(self.cruise_button_presses, key=lambda a: a[1])[::-1] plot = ManeuverPlot(self.title) buttons_sorted = sorted(self.cruise_button_presses, key=lambda a: a[1]) diff --git a/selfdrive/test/plant/maneuverplots.py b/selfdrive/test/plant/maneuverplots.py index c0bbf6ef94f8f0..36b3e5bf8372e0 100644 --- a/selfdrive/test/plant/maneuverplots.py +++ b/selfdrive/test/plant/maneuverplots.py @@ -63,7 +63,7 @@ def add_data(self, time, gas, brake, steer_torque, distance, speed, def write_plot(self, path, maneuver_name): - title = self.title or maneuver_name + # title = self.title or maneuver_name # TODO: Missing plots from the old one: # long_control_state # proportional_gb, intergral_gb diff --git a/selfdrive/test/plant/plant.py b/selfdrive/test/plant/plant.py index 28eceeb161d93a..1c97cea4b80530 100755 --- a/selfdrive/test/plant/plant.py +++ b/selfdrive/test/plant/plant.py @@ -11,7 +11,6 @@ from selfdrive.config import Conversions as CV import selfdrive.messaging as messaging from selfdrive.services import service_list -from selfdrive.config import CruiseButtons from selfdrive.car.honda.hondacan import fix from common.fingerprints import HONDA as CAR from selfdrive.car.honda.carstate import get_can_signals @@ -20,7 +19,6 @@ from selfdrive.car.honda.old_can_parser import CANParser from selfdrive.car.honda.interface import CarInterface -from cereal import car from common.dbc import dbc honda = dbc(os.path.join(DBC_PATH, "honda_civic_touring_2016_can_generated.dbc")) @@ -38,8 +36,7 @@ def car_plant(pos, speed, grade, gas, brake): speed_base = power_peak/force_peak rolling_res = 0.01 g = 9.81 - wheel_r = 0.31 - frontal_area = 2.2 + #frontal_area = 2.2 TODO: use it! air_density = 1.225 gas_to_peak_linear_slope = 3.33 brake_to_peak_linear_slope = 0.3 @@ -191,7 +188,6 @@ def step(self, v_lead=0.0, cruise_buttons=None, grade=0.0, publish_model = True) # ******** run the car ******** speed, acceleration = car_plant(self.distance_prev, self.speed_prev, grade, gas, brake) - standstill = (speed == 0) distance = self.distance_prev + speed * self.ts speed = self.speed_prev + self.ts * acceleration if speed <= 0: @@ -208,7 +204,6 @@ def step(self, v_lead=0.0, cruise_buttons=None, grade=0.0, publish_model = True) else: d_rel = 200. v_rel = 0. - a_rel = 0 lateral_pos_rel = 0. # print at 5hz @@ -312,10 +307,6 @@ def step(self, v_lead=0.0, cruise_buttons=None, grade=0.0, publish_model = True) def plant_thread(rate=100): plant = Plant(rate) while 1: - if plant.rk.frame%100 >= 20 and plant.rk.frame%100 <= 25: - cruise_buttons = CruiseButtons.RES_ACCEL - else: - cruise_buttons = 0 plant.step() if __name__ == "__main__": diff --git a/selfdrive/test/test_openpilot.py b/selfdrive/test/test_openpilot.py index 81fd2042a9435f..0a825e3a34cb1b 100644 --- a/selfdrive/test/test_openpilot.py +++ b/selfdrive/test/test_openpilot.py @@ -4,7 +4,6 @@ from common.testing import phone_only from selfdrive.manager import manager_init, manager_prepare from selfdrive.manager import start_managed_process, kill_managed_process, get_running -from selfdrive.config import CruiseButtons from functools import wraps import time diff --git a/selfdrive/visiond/visiond b/selfdrive/visiond/visiond index 96396d8d0c0eb4..2a8b8e1ef0fded 100755 Binary files a/selfdrive/visiond/visiond and b/selfdrive/visiond/visiond differ