diff --git a/.gitignore b/.gitignore
index 5877ee1169..09e8fbde7c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,3 +43,6 @@ openpilot
notebooks
xx
+.coverage*
+htmlcov
+
diff --git a/Pipfile b/Pipfile
index 4519727b9a..888275b2d1 100644
--- a/Pipfile
+++ b/Pipfile
@@ -7,6 +7,7 @@ verify_ssl = true
opencv-python= "==3.4.2.17"
PyQt5 = "*"
ipython = "*"
+networkx = "*"
azure-common = "*"
azure-nspkg = "*"
azure-storage-blob = "*"
@@ -99,6 +100,7 @@ gast = "==0.2.2"
matplotlib = "*"
dictdiffer = "*"
aenum = "*"
+coverage = "*"
[packages]
overpy = {git = "https://github.com/commaai/python-overpy.git",ref = "f86529af402d4642e1faeb146671c40284007323"}
@@ -135,7 +137,7 @@ Flask = "*"
PyJWT = "*"
"Jinja2" = "*"
nose = "*"
-pyflakes = "*"
+flake8 = "*"
pylint = "*"
pycryptodome = "*"
pillow = "*"
diff --git a/Pipfile.lock b/Pipfile.lock
index 0d410dcaea..c99cbdfa5b 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
- "sha256": "b684c418bc2eb803f0d3e173e0c9b2776eedd27c51d80b6fe58cf7588f35563d"
+ "sha256": "5bcd9143fb723dcf4cbecdc3fa38c325e706d67073dab42fb3d966619ee591df"
},
"pipfile-spec": 6,
"requires": {
@@ -16,20 +16,13 @@
]
},
"default": {
- "asn1crypto": {
- "hashes": [
- "sha256:d02bf8ea1b964a5ff04ac7891fe3a39150045d1e5e4fe99273ba677d11b92a04",
- "sha256:f822954b90c4c44f002e2cd46d636ab630f1fe4df22c816a82b66505c404eb2a"
- ],
- "version": "==1.0.0"
- },
"astroid": {
"hashes": [
- "sha256:98c665ad84d10b18318c5ab7c3d203fe11714cbad2a4aef4f44651f415392754",
- "sha256:b7546ffdedbf7abcfbff93cd1de9e9980b1ef744852689decc5aeada324238c6"
+ "sha256:09a3fba616519311f1af8a461f804b68f0370e100c9264a035aa7846d7852e33",
+ "sha256:5a79c9b4bd6c4be777424593f957c996e20beb5f74e0bc332f47713c6f675efe"
],
"markers": "python_version >= '3.5'",
- "version": "==2.3.1"
+ "version": "==2.3.2"
},
"atomicwrites": {
"hashes": [
@@ -48,37 +41,39 @@
},
"cffi": {
"hashes": [
- "sha256:041c81822e9f84b1d9c401182e174996f0bae9991f33725d059b771744290774",
- "sha256:046ef9a22f5d3eed06334d01b1e836977eeef500d9b78e9ef693f9380ad0b83d",
- "sha256:066bc4c7895c91812eff46f4b1c285220947d4aa46fa0a2651ff85f2afae9c90",
- "sha256:066c7ff148ae33040c01058662d6752fd73fbc8e64787229ea8498c7d7f4041b",
- "sha256:2444d0c61f03dcd26dbf7600cf64354376ee579acad77aef459e34efcb438c63",
- "sha256:300832850b8f7967e278870c5d51e3819b9aad8f0a2c8dbe39ab11f119237f45",
- "sha256:34c77afe85b6b9e967bd8154e3855e847b70ca42043db6ad17f26899a3df1b25",
- "sha256:46de5fa00f7ac09f020729148ff632819649b3e05a007d286242c4882f7b1dc3",
- "sha256:4aa8ee7ba27c472d429b980c51e714a24f47ca296d53f4d7868075b175866f4b",
- "sha256:4d0004eb4351e35ed950c14c11e734182591465a33e960a4ab5e8d4f04d72647",
- "sha256:4e3d3f31a1e202b0f5a35ba3bc4eb41e2fc2b11c1eff38b362de710bcffb5016",
- "sha256:50bec6d35e6b1aaeb17f7c4e2b9374ebf95a8975d57863546fa83e8d31bdb8c4",
- "sha256:55cad9a6df1e2a1d62063f79d0881a414a906a6962bc160ac968cc03ed3efcfb",
- "sha256:5662ad4e4e84f1eaa8efce5da695c5d2e229c563f9d5ce5b0113f71321bcf753",
- "sha256:59b4dc008f98fc6ee2bb4fd7fc786a8d70000d058c2bbe2698275bc53a8d3fa7",
- "sha256:73e1ffefe05e4ccd7bcea61af76f36077b914f92b76f95ccf00b0c1b9186f3f9",
- "sha256:a1f0fd46eba2d71ce1589f7e50a9e2ffaeb739fb2c11e8192aa2b45d5f6cc41f",
- "sha256:a2e85dc204556657661051ff4bab75a84e968669765c8a2cd425918699c3d0e8",
- "sha256:a5457d47dfff24882a21492e5815f891c0ca35fefae8aa742c6c263dac16ef1f",
- "sha256:a8dccd61d52a8dae4a825cdbb7735da530179fea472903eb871a5513b5abbfdc",
- "sha256:ae61af521ed676cf16ae94f30fe202781a38d7178b6b4ab622e4eec8cefaff42",
- "sha256:b012a5edb48288f77a63dba0840c92d0504aa215612da4541b7b42d849bc83a3",
- "sha256:d2c5cfa536227f57f97c92ac30c8109688ace8fa4ac086d19d0af47d134e2909",
- "sha256:d42b5796e20aacc9d15e66befb7a345454eef794fdb0737d1af593447c6c8f45",
- "sha256:dee54f5d30d775f525894d67b1495625dd9322945e7fee00731952e0368ff42d",
- "sha256:e070535507bd6aa07124258171be2ee8dfc19119c28ca94c9dfb7efd23564512",
- "sha256:e1ff2748c84d97b065cc95429814cdba39bcbd77c9c85c89344b317dc0d9cbff",
- "sha256:ed851c75d1e0e043cbf5ca9a8e1b13c4c90f3fbd863dacb01c0808e2b5204201"
- ],
- "index": "pypi",
- "version": "==1.12.3"
+ "sha256:00d890313797d9fe4420506613384b43099ad7d2b905c0752dbcc3a6f14d80fa",
+ "sha256:0cf9e550ac6c5e57b713437e2f4ac2d7fd0cd10336525a27224f5fc1ec2ee59a",
+ "sha256:0ea23c9c0cdd6778146a50d867d6405693ac3b80a68829966c98dd5e1bbae400",
+ "sha256:193697c2918ecdb3865acf6557cddf5076bb39f1f654975e087b67efdff83365",
+ "sha256:1ae14b542bf3b35e5229439c35653d2ef7d8316c1fffb980f9b7647e544baa98",
+ "sha256:1e389e069450609c6ffa37f21f40cce36f9be7643bbe5051ab1de99d5a779526",
+ "sha256:263242b6ace7f9cd4ea401428d2d45066b49a700852334fd55311bde36dcda14",
+ "sha256:33142ae9807665fa6511cfa9857132b2c3ee6ddffb012b3f0933fc11e1e830d5",
+ "sha256:364f8404034ae1b232335d8c7f7b57deac566f148f7222cef78cf8ae28ef764e",
+ "sha256:47368f69fe6529f8f49a5d146ddee713fc9057e31d61e8b6dc86a6a5e38cecc1",
+ "sha256:4895640844f17bec32943995dc8c96989226974dfeb9dd121cc45d36e0d0c434",
+ "sha256:558b3afef987cf4b17abd849e7bedf64ee12b28175d564d05b628a0f9355599b",
+ "sha256:5ba86e1d80d458b338bda676fd9f9d68cb4e7a03819632969cf6d46b01a26730",
+ "sha256:63424daa6955e6b4c70dc2755897f5be1d719eabe71b2625948b222775ed5c43",
+ "sha256:6381a7d8b1ebd0bc27c3bc85bc1bfadbb6e6f756b4d4db0aa1425c3719ba26b4",
+ "sha256:6381ab708158c4e1639da1f2a7679a9bbe3e5a776fc6d1fd808076f0e3145331",
+ "sha256:6fd58366747debfa5e6163ada468a90788411f10c92597d3b0a912d07e580c36",
+ "sha256:728ec653964655d65408949b07f9b2219df78badd601d6c49e28d604efe40599",
+ "sha256:7cfcfda59ef1f95b9f729c56fe8a4041899f96b72685d36ef16a3440a0f85da8",
+ "sha256:819f8d5197c2684524637f940445c06e003c4a541f9983fd30d6deaa2a5487d8",
+ "sha256:825ecffd9574557590e3225560a8a9d751f6ffe4a49e3c40918c9969b93395fa",
+ "sha256:9009e917d8f5ef780c2626e29b6bc126f4cb2a4d43ca67aa2b40f2a5d6385e78",
+ "sha256:9c77564a51d4d914ed5af096cd9843d90c45b784b511723bd46a8a9d09cf16fc",
+ "sha256:a19089fa74ed19c4fe96502a291cfdb89223a9705b1d73b3005df4256976142e",
+ "sha256:a40ed527bffa2b7ebe07acc5a3f782da072e262ca994b4f2085100b5a444bbb2",
+ "sha256:bb75ba21d5716abc41af16eac1145ab2e471deedde1f22c6f99bd9f995504df0",
+ "sha256:e22a00c0c81ffcecaf07c2bfb3672fa372c50e2bd1024ffee0da191c1b27fc71",
+ "sha256:e55b5a746fb77f10c83e8af081979351722f6ea48facea79d470b3731c7b2891",
+ "sha256:ec2fa3ee81707a5232bf2dfbd6623fdb278e070d596effc7e2d788f2ada71a05",
+ "sha256:fd82eb4694be712fcae03c717ca2e0fc720657ac226b80bbb597e971fc6928c2"
+ ],
+ "index": "pypi",
+ "version": "==1.13.1"
},
"chardet": {
"hashes": [
@@ -108,25 +103,30 @@
},
"cryptography": {
"hashes": [
- "sha256:24b61e5fcb506424d3ec4e18bca995833839bf13c59fc43e530e488f28d46b8c",
- "sha256:25dd1581a183e9e7a806fe0543f485103232f940fcfc301db65e630512cce643",
- "sha256:3452bba7c21c69f2df772762be0066c7ed5dc65df494a1d53a58b683a83e1216",
- "sha256:41a0be220dd1ed9e998f5891948306eb8c812b512dc398e5a01846d855050799",
- "sha256:5751d8a11b956fbfa314f6553d186b94aa70fdb03d8a4d4f1c82dcacf0cbe28a",
- "sha256:5f61c7d749048fa6e3322258b4263463bfccefecb0dd731b6561cb617a1d9bb9",
- "sha256:72e24c521fa2106f19623a3851e9f89ddfdeb9ac63871c7643790f872a305dfc",
- "sha256:7b97ae6ef5cba2e3bb14256625423413d5ce8d1abb91d4f29b6d1a081da765f8",
- "sha256:961e886d8a3590fd2c723cf07be14e2a91cf53c25f02435c04d39e90780e3b53",
- "sha256:96d8473848e984184b6728e2c9d391482008646276c3ff084a1bd89e15ff53a1",
- "sha256:ae536da50c7ad1e002c3eee101871d93abdc90d9c5f651818450a0d3af718609",
- "sha256:b0db0cecf396033abb4a93c95d1602f268b3a68bb0a9cc06a7cff587bb9a7292",
- "sha256:cfee9164954c186b191b91d4193989ca994703b2fff406f71cf454a2d3c7327e",
- "sha256:e6347742ac8f35ded4a46ff835c60e68c22a536a8ae5c4422966d06946b6d4c6",
- "sha256:f27d93f0139a3c056172ebb5d4f9056e770fdf0206c2f422ff2ebbad142e09ed",
- "sha256:f57b76e46a58b63d1c6375017f4564a28f19a5ca912691fd2e4261b3414b618d"
- ],
- "index": "pypi",
- "version": "==2.7"
+ "sha256:02079a6addc7b5140ba0825f542c0869ff4df9a69c360e339ecead5baefa843c",
+ "sha256:1df22371fbf2004c6f64e927668734070a8953362cd8370ddd336774d6743595",
+ "sha256:369d2346db5934345787451504853ad9d342d7f721ae82d098083e1f49a582ad",
+ "sha256:3cda1f0ed8747339bbdf71b9f38ca74c7b592f24f65cdb3ab3765e4b02871651",
+ "sha256:44ff04138935882fef7c686878e1c8fd80a723161ad6a98da31e14b7553170c2",
+ "sha256:4b1030728872c59687badcca1e225a9103440e467c17d6d1730ab3d2d64bfeff",
+ "sha256:58363dbd966afb4f89b3b11dfb8ff200058fbc3b947507675c19ceb46104b48d",
+ "sha256:6ec280fb24d27e3d97aa731e16207d58bd8ae94ef6eab97249a2afe4ba643d42",
+ "sha256:7270a6c29199adc1297776937a05b59720e8a782531f1f122f2eb8467f9aab4d",
+ "sha256:73fd30c57fa2d0a1d7a49c561c40c2f79c7d6c374cc7750e9ac7c99176f6428e",
+ "sha256:7f09806ed4fbea8f51585231ba742b58cbcfbfe823ea197d8c89a5e433c7e912",
+ "sha256:90df0cc93e1f8d2fba8365fb59a858f51a11a394d64dbf3ef844f783844cc793",
+ "sha256:971221ed40f058f5662a604bd1ae6e4521d84e6cad0b7b170564cc34169c8f13",
+ "sha256:a518c153a2b5ed6b8cc03f7ae79d5ffad7315ad4569b2d5333a13c38d64bd8d7",
+ "sha256:b0de590a8b0979649ebeef8bb9f54394d3a41f66c5584fff4220901739b6b2f0",
+ "sha256:b43f53f29816ba1db8525f006fa6f49292e9b029554b3eb56a189a70f2a40879",
+ "sha256:d31402aad60ed889c7e57934a03477b572a03af7794fa8fb1780f21ea8f6551f",
+ "sha256:de96157ec73458a7f14e3d26f17f8128c959084931e8997b9e655a39c8fde9f9",
+ "sha256:df6b4dca2e11865e6cfbfb708e800efb18370f5a46fd601d3755bc7f85b3a8a2",
+ "sha256:ecadccc7ba52193963c0475ac9f6fa28ac01e01349a2ca48509667ef41ffd2cf",
+ "sha256:fb81c17e0ebe3358486cd8cc3ad78adbae58af12fc2bf2bc0bb84e8090fa5ce8"
+ ],
+ "index": "pypi",
+ "version": "==2.8"
},
"cython": {
"hashes": [
@@ -162,6 +162,22 @@
"index": "pypi",
"version": "==0.29.13"
},
+ "entrypoints": {
+ "hashes": [
+ "sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19",
+ "sha256:c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451"
+ ],
+ "markers": "python_version >= '2.7'",
+ "version": "==0.3"
+ },
+ "flake8": {
+ "hashes": [
+ "sha256:19241c1cbc971b9962473e4438a2ca19749a7dd002dd1a946eaba171b4114548",
+ "sha256:8e9dfa3cecb2400b3738a42c54c3043e821682b9c840b0448c0503f781130696"
+ ],
+ "index": "pypi",
+ "version": "==3.7.8"
+ },
"flask": {
"hashes": [
"sha256:13f9f196f330c7c2c5d7a5cf91af894110ca0215ac051b5844701f2bfd934d52",
@@ -211,11 +227,11 @@
},
"jinja2": {
"hashes": [
- "sha256:065c4f02ebe7f7cf559e49ee5a95fb800a9e4528727aec6f24402a5374c65013",
- "sha256:14dd6caf1527abb21f08f86c784eac40853ba93edb79552aa1e4b8aef1b61c7b"
+ "sha256:74320bb91f31270f9551d46522e33af46a80c3d619f4a4bf42b3164d30b5911f",
+ "sha256:9fe95f19286cfefaa917656583d020be14e7859c6b0252588391e47db34527de"
],
"index": "pypi",
- "version": "==2.10.1"
+ "version": "==2.10.3"
},
"json-rpc": {
"hashes": [
@@ -319,25 +335,30 @@
},
"numpy": {
"hashes": [
- "sha256:05dbfe72684cc14b92568de1bc1f41e5f62b00f714afc9adee42f6311738091f",
- "sha256:0d82cb7271a577529d07bbb05cb58675f2deb09772175fab96dc8de025d8ac05",
- "sha256:10132aa1fef99adc85a905d82e8497a580f83739837d7cbd234649f2e9b9dc58",
- "sha256:12322df2e21f033a60c80319c25011194cd2a21294cc66fee0908aeae2c27832",
- "sha256:16f19b3aa775dddc9814e02a46b8e6ae6a54ed8cf143962b4e53f0471dbd7b16",
- "sha256:3d0b0989dd2d066db006158de7220802899a1e5c8cf622abe2d0bd158fd01c2c",
- "sha256:438a3f0e7b681642898fd7993d38e2bf140a2d1eafaf3e89bb626db7f50db355",
- "sha256:5fd214f482ab53f2cea57414c5fb3e58895b17df6e6f5bca5be6a0bb6aea23bb",
- "sha256:73615d3edc84dd7c4aeb212fa3748fb83217e00d201875a47327f55363cef2df",
- "sha256:7bd355ad7496f4ce1d235e9814ec81ee3d28308d591c067ce92e49f745ba2c2f",
- "sha256:7d077f2976b8f3de08a0dcf5d72083f4af5411e8fddacd662aae27baa2601196",
- "sha256:a4092682778dc48093e8bda8d26ee8360153e2047826f95a3f5eae09f0ae3abf",
- "sha256:b458de8624c9f6034af492372eb2fee41a8e605f03f4732f43fc099e227858b2",
- "sha256:e70fc8ff03a961f13363c2c95ef8285e0cf6a720f8271836f852cc0fa64e97c8",
- "sha256:ee8e9d7cad5fe6dde50ede0d2e978d81eafeaa6233fb0b8719f60214cf226578",
- "sha256:f4a4f6aba148858a5a5d546a99280f71f5ee6ec8182a7d195af1a914195b21a2"
- ],
- "index": "pypi",
- "version": "==1.17.2"
+ "sha256:0b0dd8f47fb177d00fa6ef2d58783c4f41ad3126b139c91dd2f7c4b3fdf5e9a5",
+ "sha256:25ffe71f96878e1da7e014467e19e7db90ae7d4e12affbc73101bcf61785214e",
+ "sha256:26efd7f7d755e6ca966a5c0ac5a930a87dbbaab1c51716ac26a38f42ecc9bc4b",
+ "sha256:28b1180c758abf34a5c3fea76fcee66a87def1656724c42bb14a6f9717a5bdf7",
+ "sha256:2e418f0a59473dac424f888dd57e85f77502a593b207809211c76e5396ae4f5c",
+ "sha256:30c84e3a62cfcb9e3066f25226e131451312a044f1fe2040e69ce792cb7de418",
+ "sha256:4650d94bb9c947151737ee022b934b7d9a845a7c76e476f3e460f09a0c8c6f39",
+ "sha256:4dd830a11e8724c9c9379feed1d1be43113f8bcce55f47ea7186d3946769ce26",
+ "sha256:4f2a2b279efde194877aff1f76cf61c68e840db242a5c7169f1ff0fd59a2b1e2",
+ "sha256:62d22566b3e3428dfc9ec972014c38ed9a4db4f8969c78f5414012ccd80a149e",
+ "sha256:669795516d62f38845c7033679c648903200980d68935baaa17ac5c7ae03ae0c",
+ "sha256:75fcd60d682db3e1f8fbe2b8b0c6761937ad56d01c1dc73edf4ef2748d5b6bc4",
+ "sha256:9395b0a41e8b7e9a284e3be7060db9d14ad80273841c952c83a5afc241d2bd98",
+ "sha256:9e37c35fc4e9410093b04a77d11a34c64bf658565e30df7cbe882056088a91c1",
+ "sha256:a0678793096205a4d784bd99f32803ba8100f639cf3b932dc63b21621390ea7e",
+ "sha256:b46554ad4dafb2927f88de5a1d207398c5385edbb5c84d30b3ef187c4a3894d8",
+ "sha256:c867eeccd934920a800f65c6068acdd6b87e80d45cd8c8beefff783b23cdc462",
+ "sha256:dd0667f5be56fb1b570154c2c0516a528e02d50da121bbbb2cbb0b6f87f59bc2",
+ "sha256:de2b1c20494bdf47f0160bd88ed05f5e48ae5dc336b8de7cfade71abcc95c0b9",
+ "sha256:f1df7b2b7740dd777571c732f98adb5aad5450aee32772f1b39249c8a50386f6",
+ "sha256:ffca69e29079f7880c5392bf675eb8b4146479d976ae1924d01cd92b04cccbcc"
+ ],
+ "index": "pypi",
+ "version": "==1.17.3"
},
"overpy": {
"git": "https://github.com/commaai/python-overpy.git",
@@ -346,39 +367,44 @@
},
"pillow": {
"hashes": [
- "sha256:00fdeb23820f30e43bba78eb9abb00b7a937a655de7760b2e09101d63708b64e",
- "sha256:01f948e8220c85eae1aa1a7f8edddcec193918f933fb07aaebe0bfbbcffefbf1",
- "sha256:08abf39948d4b5017a137be58f1a52b7101700431f0777bec3d897c3949f74e6",
- "sha256:099a61618b145ecb50c6f279666bbc398e189b8bc97544ae32b8fcb49ad6b830",
- "sha256:2c1c61546e73de62747e65807d2cc4980c395d4c5600ecb1f47a650c6fa78c79",
- "sha256:2ed9c4f694861642401f27dc3cb99772be67cd190e84845c749dae0a06c3bfae",
- "sha256:338581b30b908e111be578f0297255f6b57a51358cd16fa0e6f664c9a1f88bff",
- "sha256:38c7d48a21cd06fdeee93987147b9b1c55b73b4cfcbf83240568bfbd5adee447",
- "sha256:43fd026f613c8e48a25eba1a92f4d2ad7f3903c95d8c33a11611a7717d2ab654",
- "sha256:4548236844327a718ce3bb182ab32a16fa2050c61e334e959f554cac052fb0df",
- "sha256:5090857876c58885cfa388dc649e5db30aae98a068c26f3fd0ac9d7d9a4d9572",
- "sha256:5bbba34f97a26a93f5e8dec469ca4ddd712451418add43da946dbaed7f7a98d2",
- "sha256:65a28969a025a0eb4594637b6103201dc4ed2a9508bdab56ac33e43e3081c404",
- "sha256:892bb52b70bd5ea9dbbc3ac44f38e84f5a04e9d8b1bff48159d96cb795b81159",
- "sha256:8a9becd5cbd5062f973bcd2e7bc79483af310222de112b6541f8af1f93a3cc42",
- "sha256:972a7aaeb7c4a2795b52eef52ee991ef040b31009f36deca6207a986607b55f3",
- "sha256:97b119c436bfa96a92ac2ca525f7025836d4d4e64b1c9f9eff8dbaf3ff1d86f3",
- "sha256:9ba37698e242223f8053cc158f130aee046a96feacbeab65893dbe94f5530118",
- "sha256:b1b0e1f626a0f079c0d3696db70132fb1f29aa87c66aecb6501a9b8be64ce9f7",
- "sha256:c14c1224fd1a5be2733530d648a316974dbbb3c946913562c6005a76f21ca042",
- "sha256:c79a8546c48ae6465189e54e3245a97ddf21161e33ff7eaa42787353417bb2b6",
- "sha256:ceb76935ac4ebdf6d7bc845482a4450b284c6ccfb281e34da51d510658ab34d8",
- "sha256:e22bffaad04b4d16e1c091baed7f2733fc1ebb91e0c602abf1b6834d17158b1f",
- "sha256:ec883b8e44d877bda6f94a36313a1c6063f8b1997aa091628ae2f34c7f97c8d5",
- "sha256:f1baa54d50ec031d1a9beb89974108f8f2c0706f49798f4777df879df0e1adb6",
- "sha256:f53a5385932cda1e2c862d89460992911a89768c65d176ff8c50cddca4d29bed"
- ],
- "index": "pypi",
- "version": "==6.2.0"
+ "sha256:047d9473cf68af50ac85f8ee5d5f21a60f849bc17d348da7fc85711287a75031",
+ "sha256:0f66dc6c8a3cc319561a633b6aa82c44107f12594643efa37210d8c924fc1c71",
+ "sha256:12c9169c4e8fe0a7329e8658c7e488001f6b4c8e88740e76292c2b857af2e94c",
+ "sha256:248cffc168896982f125f5c13e9317c059f74fffdb4152893339f3be62a01340",
+ "sha256:27faf0552bf8c260a5cee21a76e031acaea68babb64daf7e8f2e2540745082aa",
+ "sha256:285edafad9bc60d96978ed24d77cdc0b91dace88e5da8c548ba5937c425bca8b",
+ "sha256:384b12c9aa8ef95558abdcb50aada56d74bc7cc131dd62d28c2d0e4d3aadd573",
+ "sha256:38950b3a707f6cef09cd3cbb142474357ad1a985ceb44d921bdf7b4647b3e13e",
+ "sha256:4aad1b88933fd6dc2846552b89ad0c74ddbba2f0884e2c162aa368374bf5abab",
+ "sha256:4ac6148008c169603070c092e81f88738f1a0c511e07bd2bb0f9ef542d375da9",
+ "sha256:4deb1d2a45861ae6f0b12ea0a786a03d19d29edcc7e05775b85ec2877cb54c5e",
+ "sha256:59aa2c124df72cc75ed72c8d6005c442d4685691a30c55321e00ed915ad1a291",
+ "sha256:5a47d2123a9ec86660fe0e8d0ebf0aa6bc6a17edc63f338b73ea20ba11713f12",
+ "sha256:5cc901c2ab9409b4b7ac7b5bcc3e86ac14548627062463da0af3b6b7c555a871",
+ "sha256:6c1db03e8dff7b9f955a0fb9907eb9ca5da75b5ce056c0c93d33100a35050281",
+ "sha256:7ce80c0a65a6ea90ef9c1f63c8593fcd2929448613fc8da0adf3e6bfad669d08",
+ "sha256:809c19241c14433c5d6135e1b6c72da4e3b56d5c865ad5736ab99af8896b8f41",
+ "sha256:83792cb4e0b5af480588601467c0764242b9a483caea71ef12d22a0d0d6bdce2",
+ "sha256:846fa202bd7ee0f6215c897a1d33238ef071b50766339186687bd9b7a6d26ac5",
+ "sha256:9f5529fc02009f96ba95bea48870173426879dc19eec49ca8e08cd63ecd82ddb",
+ "sha256:a423c2ea001c6265ed28700df056f75e26215fd28c001e93ef4380b0f05f9547",
+ "sha256:ac4428094b42907aba5879c7c000d01c8278d451a3b7cccd2103e21f6397ea75",
+ "sha256:b1ae48d87f10d1384e5beecd169c77502fcc04a2c00a4c02b85f0a94b419e5f9",
+ "sha256:bf4e972a88f8841d8fdc6db1a75e0f8d763e66e3754b03006cbc3854d89f1cb1",
+ "sha256:c6414f6aad598364aaf81068cabb077894eb88fed99c6a65e6e8217bab62ae7a",
+ "sha256:c710fcb7ee32f67baf25aa9ffede4795fd5d93b163ce95fdc724383e38c9df96",
+ "sha256:c7be4b8a09852291c3c48d3c25d1b876d2494a0a674980089ac9d5e0d78bd132",
+ "sha256:c9e5ffb910b14f090ac9c38599063e354887a5f6d7e6d26795e916b4514f2c1a",
+ "sha256:e0697b826da6c2472bb6488db4c0a7fa8af0d52fa08833ceb3681358914b14e5",
+ "sha256:e9a3edd5f714229d41057d56ac0f39ad9bdba6767e8c888c951869f0bdd129b0"
+ ],
+ "index": "pypi",
+ "version": "==6.2.1"
},
"psutil": {
"hashes": [
"sha256:028a1ec3c6197eadd11e7b46e8cc2f0720dc18ac6d7aabdb8e8c0d6c9704f000",
+ "sha256:12542c3642909f4cd1928a2fba59e16fa27e47cbeea60928ebb62a8cbd1ce123",
"sha256:503e4b20fa9d3342bcf58191bbc20a4a5ef79ca7df8972e6197cc14c5513e73d",
"sha256:863a85c1c0a5103a12c05a35e59d336e1d665747e531256e061213e2e90f63f3",
"sha256:954f782608bfef9ae9f78e660e065bd8ffcfaea780f9f2c8a133bb7cb9e826d7",
@@ -398,6 +424,14 @@
"index": "pypi",
"version": "==0.6.4"
},
+ "pycodestyle": {
+ "hashes": [
+ "sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56",
+ "sha256:e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c"
+ ],
+ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
+ "version": "==2.5.0"
+ },
"pycparser": {
"hashes": [
"sha256:a988718abfad80b6b157acce7bf130a30876d27603738ac39f140993246b25b3"
@@ -443,7 +477,7 @@
"sha256:17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0",
"sha256:d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2"
],
- "index": "pypi",
+ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
"version": "==2.1.1"
},
"pyjwt": {
@@ -456,11 +490,11 @@
},
"pylint": {
"hashes": [
- "sha256:7edbae11476c2182708063ac387a8f97c760d9cfe36a5ede0ca996f90cf346c8",
- "sha256:844ce067788028c1a35086a5c66bc5e599ddd851841c41d6ee1623b36774d9f2"
+ "sha256:7b76045426c650d2b0f02fc47c14d7934d17898779da95288a74c2a7ec440702",
+ "sha256:856476331f3e26598017290fd65bebe81c960e806776f324093a46b76fb2d1c0"
],
"index": "pypi",
- "version": "==2.4.2"
+ "version": "==2.4.3"
},
"pyserial": {
"hashes": [
@@ -585,20 +619,25 @@
},
"typed-ast": {
"hashes": [
+ "sha256:1170afa46a3799e18b4c977777ce137bb53c7485379d9706af8a59f2ea1aa161",
"sha256:18511a0b3e7922276346bcb47e2ef9f38fb90fd31cb9223eed42c85d1312344e",
"sha256:262c247a82d005e43b5b7f69aff746370538e176131c32dda9cb0f324d27141e",
"sha256:2b907eb046d049bcd9892e3076c7a6456c93a25bebfe554e931620c90e6a25b0",
"sha256:354c16e5babd09f5cb0ee000d54cfa38401d8b8891eefa878ac772f827181a3c",
+ "sha256:48e5b1e71f25cfdef98b013263a88d7145879fbb2d5185f2a0c79fa7ebbeae47",
"sha256:4e0b70c6fc4d010f8107726af5fd37921b666f5b31d9331f0bd24ad9a088e631",
"sha256:630968c5cdee51a11c05a30453f8cd65e0cc1d2ad0d9192819df9978984529f4",
"sha256:66480f95b8167c9c5c5c87f32cf437d585937970f3fc24386f313a4c97b44e34",
"sha256:71211d26ffd12d63a83e079ff258ac9d56a1376a25bc80b1cdcdf601b855b90b",
+ "sha256:7954560051331d003b4e2b3eb822d9dd2e376fa4f6d98fee32f452f52dd6ebb2",
+ "sha256:838997f4310012cf2e1ad3803bce2f3402e9ffb71ded61b5ee22617b3a7f6b6e",
"sha256:95bd11af7eafc16e829af2d3df510cecfd4387f6453355188342c3e79a2ec87a",
"sha256:bc6c7d3fa1325a0c6613512a093bc2a2a15aeec350451cbdf9e1d4bffe3e3233",
"sha256:cc34a6f5b426748a507dd5d1de4c1978f2eb5626d51326e43280941206c209e1",
"sha256:d755f03c1e4a51e9b24d899561fec4ccaf51f210d52abdf8c07ee2849b212a36",
"sha256:d7c45933b1bdfaf9f36c579671fec15d25b06c8398f113dab64c18ed1adda01d",
"sha256:d896919306dd0aa22d0132f62a1b78d11aaf4c9fc5b3410d3c666b818191630a",
+ "sha256:fdc1c9bbf79510b76408840e009ed65958feba92a88833cdceecff93ae8fff66",
"sha256:ffde2fbfad571af120fcbfbbc61c72469e72f550d676c3342492a9dfdefb8f12"
],
"markers": "python_version < '3.8' and implementation_name == 'cpython'",
@@ -645,9 +684,9 @@
"develop": {
"absl-py": {
"hashes": [
- "sha256:0ce45920056fbbb66f52fcee7408ba6311da19f55589b2b3aab9f8af92a0e1f2"
+ "sha256:d9129186431e150d7fe455f1cb1ecbb92bb5dba9da9bc3ef7b012d98c4db2526"
],
- "version": "==0.8.0"
+ "version": "==0.8.1"
},
"aenum": {
"hashes": [
@@ -666,13 +705,6 @@
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
"version": "==2.5.1"
},
- "asn1crypto": {
- "hashes": [
- "sha256:d02bf8ea1b964a5ff04ac7891fe3a39150045d1e5e4fe99273ba677d11b92a04",
- "sha256:f822954b90c4c44f002e2cd46d636ab630f1fe4df22c816a82b66505c404eb2a"
- ],
- "version": "==1.0.0"
- },
"astor": {
"hashes": [
"sha256:0e41295809baf43ae8303350e031aff81ae52189b6f881f36d623fa8b2f1960e",
@@ -683,19 +715,19 @@
},
"astroid": {
"hashes": [
- "sha256:98c665ad84d10b18318c5ab7c3d203fe11714cbad2a4aef4f44651f415392754",
- "sha256:b7546ffdedbf7abcfbff93cd1de9e9980b1ef744852689decc5aeada324238c6"
+ "sha256:09a3fba616519311f1af8a461f804b68f0370e100c9264a035aa7846d7852e33",
+ "sha256:5a79c9b4bd6c4be777424593f957c996e20beb5f74e0bc332f47713c6f675efe"
],
"markers": "python_version >= '3.5'",
- "version": "==2.3.1"
+ "version": "==2.3.2"
},
"attrs": {
"hashes": [
- "sha256:ec20e7a4825331c1b5ebf261d111e16fa9612c1f7a5e1f884f12bd53a664dfd2",
- "sha256:f913492e1663d3c36f502e5e9ba6cd13cf19d7fab50aa13239e420fef95e1396"
+ "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
+ "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"
],
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
- "version": "==19.2.0"
+ "version": "==19.3.0"
},
"azure-common": {
"hashes": [
@@ -800,18 +832,18 @@
},
"boto3": {
"hashes": [
- "sha256:4189e1ffed768bd0efd754a0abedebce19495ba2aa6b2f5e20f29ba80f81f9cb",
- "sha256:fa4e28166922feeb9b7b56134c1acc817a1bca36284a0035bc08a3dab1853a9f"
+ "sha256:7fc97cb2c9cdff905e950750c8e8b23b872a84696158a28852355dc4b712ba3a",
+ "sha256:818c56a317c176142dbf1dca3f5b4366c80460c6cc3c4efe22f0bde736571283"
],
"index": "pypi",
- "version": "==1.9.242"
+ "version": "==1.10.2"
},
"botocore": {
"hashes": [
- "sha256:7af52e0aabaf4ba045e1a5832308e70e1ea4b499b71624857f09aed2ba5e667c",
- "sha256:dd62d63bcd3176c92775c52d3e879288f89bf0ac0039df14ea31f25d693acd6d"
+ "sha256:8223485841ef4731a5d4943a733295ba69d0005c4ae64c468308cc07f6960d39",
+ "sha256:f8e12dc6e536ea512f0ad25b74e7eecdf5d9e09ae92b5de236b535bee7804d5b"
],
- "version": "==1.12.242"
+ "version": "==1.13.2"
},
"celery": {
"hashes": [
@@ -830,37 +862,39 @@
},
"cffi": {
"hashes": [
- "sha256:041c81822e9f84b1d9c401182e174996f0bae9991f33725d059b771744290774",
- "sha256:046ef9a22f5d3eed06334d01b1e836977eeef500d9b78e9ef693f9380ad0b83d",
- "sha256:066bc4c7895c91812eff46f4b1c285220947d4aa46fa0a2651ff85f2afae9c90",
- "sha256:066c7ff148ae33040c01058662d6752fd73fbc8e64787229ea8498c7d7f4041b",
- "sha256:2444d0c61f03dcd26dbf7600cf64354376ee579acad77aef459e34efcb438c63",
- "sha256:300832850b8f7967e278870c5d51e3819b9aad8f0a2c8dbe39ab11f119237f45",
- "sha256:34c77afe85b6b9e967bd8154e3855e847b70ca42043db6ad17f26899a3df1b25",
- "sha256:46de5fa00f7ac09f020729148ff632819649b3e05a007d286242c4882f7b1dc3",
- "sha256:4aa8ee7ba27c472d429b980c51e714a24f47ca296d53f4d7868075b175866f4b",
- "sha256:4d0004eb4351e35ed950c14c11e734182591465a33e960a4ab5e8d4f04d72647",
- "sha256:4e3d3f31a1e202b0f5a35ba3bc4eb41e2fc2b11c1eff38b362de710bcffb5016",
- "sha256:50bec6d35e6b1aaeb17f7c4e2b9374ebf95a8975d57863546fa83e8d31bdb8c4",
- "sha256:55cad9a6df1e2a1d62063f79d0881a414a906a6962bc160ac968cc03ed3efcfb",
- "sha256:5662ad4e4e84f1eaa8efce5da695c5d2e229c563f9d5ce5b0113f71321bcf753",
- "sha256:59b4dc008f98fc6ee2bb4fd7fc786a8d70000d058c2bbe2698275bc53a8d3fa7",
- "sha256:73e1ffefe05e4ccd7bcea61af76f36077b914f92b76f95ccf00b0c1b9186f3f9",
- "sha256:a1f0fd46eba2d71ce1589f7e50a9e2ffaeb739fb2c11e8192aa2b45d5f6cc41f",
- "sha256:a2e85dc204556657661051ff4bab75a84e968669765c8a2cd425918699c3d0e8",
- "sha256:a5457d47dfff24882a21492e5815f891c0ca35fefae8aa742c6c263dac16ef1f",
- "sha256:a8dccd61d52a8dae4a825cdbb7735da530179fea472903eb871a5513b5abbfdc",
- "sha256:ae61af521ed676cf16ae94f30fe202781a38d7178b6b4ab622e4eec8cefaff42",
- "sha256:b012a5edb48288f77a63dba0840c92d0504aa215612da4541b7b42d849bc83a3",
- "sha256:d2c5cfa536227f57f97c92ac30c8109688ace8fa4ac086d19d0af47d134e2909",
- "sha256:d42b5796e20aacc9d15e66befb7a345454eef794fdb0737d1af593447c6c8f45",
- "sha256:dee54f5d30d775f525894d67b1495625dd9322945e7fee00731952e0368ff42d",
- "sha256:e070535507bd6aa07124258171be2ee8dfc19119c28ca94c9dfb7efd23564512",
- "sha256:e1ff2748c84d97b065cc95429814cdba39bcbd77c9c85c89344b317dc0d9cbff",
- "sha256:ed851c75d1e0e043cbf5ca9a8e1b13c4c90f3fbd863dacb01c0808e2b5204201"
- ],
- "index": "pypi",
- "version": "==1.12.3"
+ "sha256:00d890313797d9fe4420506613384b43099ad7d2b905c0752dbcc3a6f14d80fa",
+ "sha256:0cf9e550ac6c5e57b713437e2f4ac2d7fd0cd10336525a27224f5fc1ec2ee59a",
+ "sha256:0ea23c9c0cdd6778146a50d867d6405693ac3b80a68829966c98dd5e1bbae400",
+ "sha256:193697c2918ecdb3865acf6557cddf5076bb39f1f654975e087b67efdff83365",
+ "sha256:1ae14b542bf3b35e5229439c35653d2ef7d8316c1fffb980f9b7647e544baa98",
+ "sha256:1e389e069450609c6ffa37f21f40cce36f9be7643bbe5051ab1de99d5a779526",
+ "sha256:263242b6ace7f9cd4ea401428d2d45066b49a700852334fd55311bde36dcda14",
+ "sha256:33142ae9807665fa6511cfa9857132b2c3ee6ddffb012b3f0933fc11e1e830d5",
+ "sha256:364f8404034ae1b232335d8c7f7b57deac566f148f7222cef78cf8ae28ef764e",
+ "sha256:47368f69fe6529f8f49a5d146ddee713fc9057e31d61e8b6dc86a6a5e38cecc1",
+ "sha256:4895640844f17bec32943995dc8c96989226974dfeb9dd121cc45d36e0d0c434",
+ "sha256:558b3afef987cf4b17abd849e7bedf64ee12b28175d564d05b628a0f9355599b",
+ "sha256:5ba86e1d80d458b338bda676fd9f9d68cb4e7a03819632969cf6d46b01a26730",
+ "sha256:63424daa6955e6b4c70dc2755897f5be1d719eabe71b2625948b222775ed5c43",
+ "sha256:6381a7d8b1ebd0bc27c3bc85bc1bfadbb6e6f756b4d4db0aa1425c3719ba26b4",
+ "sha256:6381ab708158c4e1639da1f2a7679a9bbe3e5a776fc6d1fd808076f0e3145331",
+ "sha256:6fd58366747debfa5e6163ada468a90788411f10c92597d3b0a912d07e580c36",
+ "sha256:728ec653964655d65408949b07f9b2219df78badd601d6c49e28d604efe40599",
+ "sha256:7cfcfda59ef1f95b9f729c56fe8a4041899f96b72685d36ef16a3440a0f85da8",
+ "sha256:819f8d5197c2684524637f940445c06e003c4a541f9983fd30d6deaa2a5487d8",
+ "sha256:825ecffd9574557590e3225560a8a9d751f6ffe4a49e3c40918c9969b93395fa",
+ "sha256:9009e917d8f5ef780c2626e29b6bc126f4cb2a4d43ca67aa2b40f2a5d6385e78",
+ "sha256:9c77564a51d4d914ed5af096cd9843d90c45b784b511723bd46a8a9d09cf16fc",
+ "sha256:a19089fa74ed19c4fe96502a291cfdb89223a9705b1d73b3005df4256976142e",
+ "sha256:a40ed527bffa2b7ebe07acc5a3f782da072e262ca994b4f2085100b5a444bbb2",
+ "sha256:bb75ba21d5716abc41af16eac1145ab2e471deedde1f22c6f99bd9f995504df0",
+ "sha256:e22a00c0c81ffcecaf07c2bfb3672fa372c50e2bd1024ffee0da191c1b27fc71",
+ "sha256:e55b5a746fb77f10c83e8af081979351722f6ea48facea79d470b3731c7b2891",
+ "sha256:ec2fa3ee81707a5232bf2dfbd6623fdb278e070d596effc7e2d788f2ada71a05",
+ "sha256:fd82eb4694be712fcae03c717ca2e0fc720657ac226b80bbb597e971fc6928c2"
+ ],
+ "index": "pypi",
+ "version": "==1.13.1"
},
"chardet": {
"hashes": [
@@ -885,27 +919,70 @@
"index": "pypi",
"version": "==0.8.2"
},
+ "coverage": {
+ "hashes": [
+ "sha256:08907593569fe59baca0bf152c43f3863201efb6113ecb38ce7e97ce339805a6",
+ "sha256:0be0f1ed45fc0c185cfd4ecc19a1d6532d72f86a2bac9de7e24541febad72650",
+ "sha256:141f08ed3c4b1847015e2cd62ec06d35e67a3ac185c26f7635f4406b90afa9c5",
+ "sha256:19e4df788a0581238e9390c85a7a09af39c7b539b29f25c89209e6c3e371270d",
+ "sha256:23cc09ed395b03424d1ae30dcc292615c1372bfba7141eb85e11e50efaa6b351",
+ "sha256:245388cda02af78276b479f299bbf3783ef0a6a6273037d7c60dc73b8d8d7755",
+ "sha256:331cb5115673a20fb131dadd22f5bcaf7677ef758741312bee4937d71a14b2ef",
+ "sha256:386e2e4090f0bc5df274e720105c342263423e77ee8826002dcffe0c9533dbca",
+ "sha256:3a794ce50daee01c74a494919d5ebdc23d58873747fa0e288318728533a3e1ca",
+ "sha256:60851187677b24c6085248f0a0b9b98d49cba7ecc7ec60ba6b9d2e5574ac1ee9",
+ "sha256:63a9a5fc43b58735f65ed63d2cf43508f462dc49857da70b8980ad78d41d52fc",
+ "sha256:6b62544bb68106e3f00b21c8930e83e584fdca005d4fffd29bb39fb3ffa03cb5",
+ "sha256:6ba744056423ef8d450cf627289166da65903885272055fb4b5e113137cfa14f",
+ "sha256:7494b0b0274c5072bddbfd5b4a6c6f18fbbe1ab1d22a41e99cd2d00c8f96ecfe",
+ "sha256:826f32b9547c8091679ff292a82aca9c7b9650f9fda3e2ca6bf2ac905b7ce888",
+ "sha256:93715dffbcd0678057f947f496484e906bf9509f5c1c38fc9ba3922893cda5f5",
+ "sha256:9a334d6c83dfeadae576b4d633a71620d40d1c379129d587faa42ee3e2a85cce",
+ "sha256:af7ed8a8aa6957aac47b4268631fa1df984643f07ef00acd374e456364b373f5",
+ "sha256:bf0a7aed7f5521c7ca67febd57db473af4762b9622254291fbcbb8cd0ba5e33e",
+ "sha256:bf1ef9eb901113a9805287e090452c05547578eaab1b62e4ad456fcc049a9b7e",
+ "sha256:c0afd27bc0e307a1ffc04ca5ec010a290e49e3afbe841c5cafc5c5a80ecd81c9",
+ "sha256:dd579709a87092c6dbee09d1b7cfa81831040705ffa12a1b248935274aee0437",
+ "sha256:df6712284b2e44a065097846488f66840445eb987eb81b3cc6e4149e7b6982e1",
+ "sha256:e07d9f1a23e9e93ab5c62902833bf3e4b1f65502927379148b6622686223125c",
+ "sha256:e2ede7c1d45e65e209d6093b762e98e8318ddeff95317d07a27a2140b80cfd24",
+ "sha256:e4ef9c164eb55123c62411f5936b5c2e521b12356037b6e1c2617cef45523d47",
+ "sha256:eca2b7343524e7ba246cab8ff00cab47a2d6d54ada3b02772e908a45675722e2",
+ "sha256:eee64c616adeff7db37cc37da4180a3a5b6177f5c46b187894e633f088fb5b28",
+ "sha256:ef824cad1f980d27f26166f86856efe11eff9912c4fed97d3804820d43fa550c",
+ "sha256:efc89291bd5a08855829a3c522df16d856455297cf35ae827a37edac45f466a7",
+ "sha256:fa964bae817babece5aa2e8c1af841bebb6d0b9add8e637548809d040443fee0",
+ "sha256:ff37757e068ae606659c28c3bd0d923f9d29a85de79bf25b2b34b148473b5025"
+ ],
+ "index": "pypi",
+ "version": "==4.5.4"
+ },
"cryptography": {
"hashes": [
- "sha256:24b61e5fcb506424d3ec4e18bca995833839bf13c59fc43e530e488f28d46b8c",
- "sha256:25dd1581a183e9e7a806fe0543f485103232f940fcfc301db65e630512cce643",
- "sha256:3452bba7c21c69f2df772762be0066c7ed5dc65df494a1d53a58b683a83e1216",
- "sha256:41a0be220dd1ed9e998f5891948306eb8c812b512dc398e5a01846d855050799",
- "sha256:5751d8a11b956fbfa314f6553d186b94aa70fdb03d8a4d4f1c82dcacf0cbe28a",
- "sha256:5f61c7d749048fa6e3322258b4263463bfccefecb0dd731b6561cb617a1d9bb9",
- "sha256:72e24c521fa2106f19623a3851e9f89ddfdeb9ac63871c7643790f872a305dfc",
- "sha256:7b97ae6ef5cba2e3bb14256625423413d5ce8d1abb91d4f29b6d1a081da765f8",
- "sha256:961e886d8a3590fd2c723cf07be14e2a91cf53c25f02435c04d39e90780e3b53",
- "sha256:96d8473848e984184b6728e2c9d391482008646276c3ff084a1bd89e15ff53a1",
- "sha256:ae536da50c7ad1e002c3eee101871d93abdc90d9c5f651818450a0d3af718609",
- "sha256:b0db0cecf396033abb4a93c95d1602f268b3a68bb0a9cc06a7cff587bb9a7292",
- "sha256:cfee9164954c186b191b91d4193989ca994703b2fff406f71cf454a2d3c7327e",
- "sha256:e6347742ac8f35ded4a46ff835c60e68c22a536a8ae5c4422966d06946b6d4c6",
- "sha256:f27d93f0139a3c056172ebb5d4f9056e770fdf0206c2f422ff2ebbad142e09ed",
- "sha256:f57b76e46a58b63d1c6375017f4564a28f19a5ca912691fd2e4261b3414b618d"
- ],
- "index": "pypi",
- "version": "==2.7"
+ "sha256:02079a6addc7b5140ba0825f542c0869ff4df9a69c360e339ecead5baefa843c",
+ "sha256:1df22371fbf2004c6f64e927668734070a8953362cd8370ddd336774d6743595",
+ "sha256:369d2346db5934345787451504853ad9d342d7f721ae82d098083e1f49a582ad",
+ "sha256:3cda1f0ed8747339bbdf71b9f38ca74c7b592f24f65cdb3ab3765e4b02871651",
+ "sha256:44ff04138935882fef7c686878e1c8fd80a723161ad6a98da31e14b7553170c2",
+ "sha256:4b1030728872c59687badcca1e225a9103440e467c17d6d1730ab3d2d64bfeff",
+ "sha256:58363dbd966afb4f89b3b11dfb8ff200058fbc3b947507675c19ceb46104b48d",
+ "sha256:6ec280fb24d27e3d97aa731e16207d58bd8ae94ef6eab97249a2afe4ba643d42",
+ "sha256:7270a6c29199adc1297776937a05b59720e8a782531f1f122f2eb8467f9aab4d",
+ "sha256:73fd30c57fa2d0a1d7a49c561c40c2f79c7d6c374cc7750e9ac7c99176f6428e",
+ "sha256:7f09806ed4fbea8f51585231ba742b58cbcfbfe823ea197d8c89a5e433c7e912",
+ "sha256:90df0cc93e1f8d2fba8365fb59a858f51a11a394d64dbf3ef844f783844cc793",
+ "sha256:971221ed40f058f5662a604bd1ae6e4521d84e6cad0b7b170564cc34169c8f13",
+ "sha256:a518c153a2b5ed6b8cc03f7ae79d5ffad7315ad4569b2d5333a13c38d64bd8d7",
+ "sha256:b0de590a8b0979649ebeef8bb9f54394d3a41f66c5584fff4220901739b6b2f0",
+ "sha256:b43f53f29816ba1db8525f006fa6f49292e9b029554b3eb56a189a70f2a40879",
+ "sha256:d31402aad60ed889c7e57934a03477b572a03af7794fa8fb1780f21ea8f6551f",
+ "sha256:de96157ec73458a7f14e3d26f17f8128c959084931e8997b9e655a39c8fde9f9",
+ "sha256:df6b4dca2e11865e6cfbfb708e800efb18370f5a46fd601d3755bc7f85b3a8a2",
+ "sha256:ecadccc7ba52193963c0475ac9f6fa28ac01e01349a2ca48509667ef41ffd2cf",
+ "sha256:fb81c17e0ebe3358486cd8cc3ad78adbae58af12fc2bf2bc0bb84e8090fa5ce8"
+ ],
+ "index": "pypi",
+ "version": "==2.8"
},
"cycler": {
"hashes": [
@@ -1050,10 +1127,10 @@
},
"future": {
"hashes": [
- "sha256:67045236dcfd6816dc439556d009594abf643e5eb48992e36beac09c2ca659b8"
+ "sha256:858e38522e8fd0d3ce8f0c1feaf0603358e366d5403209674c7b617fa0c24093"
],
"index": "pypi",
- "version": "==0.17.1"
+ "version": "==0.18.1"
},
"futures": {
"hashes": [
@@ -1150,40 +1227,56 @@
},
"grpcio": {
"hashes": [
- "sha256:0302331e014fc4bac028b6ad480b33f7abfe20b9bdcca7be417124dda8f22115",
- "sha256:0aa0cce9c5eb1261b32173a20ed42b51308d55ce28ecc2021e868b3cb90d9503",
- "sha256:0c83947575300499adbc308e986d754e7f629be0bdd9bea1ffdd5cf76e1f1eff",
- "sha256:0ca26ff968d45efd4ef73447c4d4b34322ea8c7d06fbb6907ce9e5db78f1bbcb",
- "sha256:0cf80a7955760c2498f8821880242bb657d70998065ff0d2a082de5ffce230a7",
- "sha256:0d40706e57d9833fe0e023a08b468f33940e8909affa12547874216d36bba208",
- "sha256:11872069156de34c6f3f9a1deb46cc88bc35dfde88262c4c73eb22b39b16fc55",
- "sha256:16065227faae0ab0abf1789bfb92a2cd2ab5da87630663f93f8178026da40e0d",
- "sha256:1e33778277685f6fabb22539136269c87c029e39b6321ef1a639b756a1c0a408",
- "sha256:2b16be15b1ae656bc7a36642b8c7045be2dde2048bb4b67478003e9d9db8022a",
- "sha256:3701dfca3ada27ceef0d17f728ce9dfef155ed20c57979c2b05083082258c6c1",
- "sha256:41912ecaf482abf2de74c69f509878f99223f5dd6b2de1a09c955afd4de3cf9b",
- "sha256:4332cbd20544fe7406910137590f38b5b3a1f6170258e038652cf478c639430f",
- "sha256:44068ecbdc6467c2bff4d8198816c8a2701b6dd1ec16078fceb6adc7c1f577d6",
- "sha256:53115960e37059420e2d16a4b04b00dd2ab3b6c3c67babd01ffbfdcd7881a69b",
- "sha256:6e7027bcd4070414751e2a5e60706facb98a1fc636497c9bac5442fe37b8ae6b",
- "sha256:6ff57fb2f07b7226b5bec89e8e921ea9bd220f35f11e094f2ba38f09eecd49c6",
- "sha256:73240e244d7644654bbda1f309f4911748b6a1804b7a8897ddbe8a04c90f7407",
- "sha256:785234bbc469bc75e26c868789a2080ffb30bd6e93930167797729889ad06b0b",
- "sha256:82f9d3c7f91d2d1885631335c003c5d45ae1cd69cc0bc4893f21fef50b8151bc",
- "sha256:86bdc2a965510658407a1372eb61f0c92f763fdfb2795e4d038944da4320c950",
- "sha256:95e925b56676a55e6282b3de80a1cbad5774072159779c61eac02791dface049",
- "sha256:96673bb4f14bd3263613526d1e7e33fdb38a9130e3ce87bf52314965706e1900",
- "sha256:970014205e76920484679035b6fb4b16e02fc977e5aac4d22025da849c79dab9",
- "sha256:ace5e8bf11a1571f855f5dab38a9bd34109b6c9bc2864abf24a597598c7e3695",
- "sha256:ad375f03eb3b9cb75a24d91eab8609e134d34605f199efc41e20dd642bdac855",
- "sha256:b819c4c7dcf0de76788ce5f95daad6d4e753d6da2b6a5f84e5bb5b5ce95fddc4",
- "sha256:c17943fd340cbd906db49f3f03c7545e5a66b617e8348b2c7a0d2c759d216af1",
- "sha256:d21247150dea86dabd3b628d8bc4b563036db3d332b3f4db3c5b1b0b122cb4f6",
- "sha256:d4d500a7221116de9767229ff5dd10db91f789448d85befb0adf5a37b0cd83b5",
- "sha256:e2a942a3cfccbbca21a90c144867112698ef36486345c285da9e98c466f22b22",
- "sha256:e983273dca91cb8a5043bc88322eb48e2b8d4e4998ff441a1ee79ced89db3909"
- ],
- "version": "==1.24.1"
+ "sha256:01cb705eafba1108e2a947ba0457da4f6a1e8142c729fc61702b5fdd11009eb1",
+ "sha256:0b5a79e29f167d3cd06faad6b15babbc2661066daaacf79373c3a8e67ca1fca1",
+ "sha256:1097a61a0e97b3580642e6e1460a3a1f1ba1815e2a70d6057173bcc495417076",
+ "sha256:13970e665a4ec4cec7d067d7d3504a0398c657d91d26c581144ad9044e429c9a",
+ "sha256:1557817cea6e0b87fad2a3e20da385170efb03a313db164e8078955add2dfa1b",
+ "sha256:1b0fb036a2f9dd93d9a35c57c26420eeb4b571fcb14b51cddf5b1e73ea5d882b",
+ "sha256:24d9e58d08e8cd545d8a3247a18654aff0e5e60414701696a8098fbb0d792b75",
+ "sha256:2c38b586163d2b91567fe5e6d9e7798f792012365adc838a64b66b22dce3f4d4",
+ "sha256:2df3ab4348507de60e1cbf75196403df1b9b4c4d4dc5bd11ac4eb63c46f691c7",
+ "sha256:32f70f7c90454ea568b868af2e96616743718d9233d23f62407e98caed81dfbf",
+ "sha256:3af2a49d576820045c9c880ff29a5a96d020fe31b35d248519bfc6ccb8be4eac",
+ "sha256:4ff7d63800a63db031ebac6a6f581ae84877c959401c24c28f2cc51fd36c47ad",
+ "sha256:502aaa8be56f0ae69cda66bc27e1fb5531ceaa27ca515ec3c34f6178b1297180",
+ "sha256:55358ce3ec283222e435f7dbc6603521438458f3c65f7c1cb33b8dabf56d70d8",
+ "sha256:5583b01c67f85fa64a2c3fb085e5517c88b9c1500a2cce12d473cd99d0ed2e49",
+ "sha256:58d9a5557d3eb7b734a3cea8b16c891099a522b3953a45a30bd4c034f75fc913",
+ "sha256:5911f042c4ab177757eec5bcb4e2e9a2e823d888835d24577321bf55f02938fa",
+ "sha256:5e16ea922f4e5017c04fd94e2639b1006e03097e9dd0cbb7a1c852af3ea8bf2e",
+ "sha256:656e19d3f1b9050ee01b457f92838a9679d7cf84c995f708780f44484048705e",
+ "sha256:6a1435449a82008c451c7e1a82a834387b9108f9a8d27910f86e7c482f5568e9",
+ "sha256:6ff02ca6cbed0ddb76e93ba0f8beb6a8c77d83a84eb7cafe2ae3399a8b9d69ea",
+ "sha256:76de68f60102f333bf4817f38e81ecbee68b850f5a5da9f355235e948ac40981",
+ "sha256:7c6d7ddd50fc6548ea1dfe09c62509c4f95b8b40082287747be05aa8feb15ee2",
+ "sha256:836b9d29507de729129e363276fe7c7d6a34c7961e0f155787025552b15d22c0",
+ "sha256:869242b2baf8a888a4fe0548f86abc47cb4b48bdfd76ae62d6456e939c202e65",
+ "sha256:8954b24bd08641d906ee50b2d638efc76df893fbd0913149b80484fd0eac40c9",
+ "sha256:8cdea65d1abb2e698420db8daf20c8d272fbd9d96a51b26a713c1c76f237d181",
+ "sha256:90161840b4fe9636f91ed0d3ea1e7e615e488cbea4e77594c889e5f3d7a776db",
+ "sha256:90fb6316b4d7d36700c40db4335902b78dcae13b5466673c21fd3b08a3c1b0c6",
+ "sha256:91b34f58db2611c9a93ecf751028f97fba1f06e65f49b38f272f6aa5d2977331",
+ "sha256:9474944a96a33eb8734fa8dc5805403d57973a3526204a5e1c1780d02e0572b6",
+ "sha256:9a36275db2a4774ac16c6822e7af816ee048071d5030b4c035fd53942b361935",
+ "sha256:9cbe26e2976b994c5f7c2d35a63354674d6ca0ce62f5b513f078bf63c1745229",
+ "sha256:9eaeabb3c0eecd6ddd0c16767fd12d130e2cebb8c2618f959a278b1ff336ddc3",
+ "sha256:a2bc7e10ebcf4be503ae427f9887e75c0cc24e88ce467a8e6eaca6bd2862406e",
+ "sha256:a5b42e6292ba51b8e67e09fc256963ba4ca9c04026de004d2fe59cc17e3c3776",
+ "sha256:bd6ec1233c86c0b9bb5d03ec30dbe3ffbfa53335790320d99a7ae9018c5450f2",
+ "sha256:bef57530816af54d66b1f4c70a8f851f320cb6f84d4b5a0b422b0e9811ea4e59",
+ "sha256:c146a63eaadc6589b732780061f3c94cd0574388d372baccbb3c1597a9ebdb7a",
+ "sha256:c2efd3b130dc639d615b6f58980e1bfd1b177ad821f30827afa5001aa30ddd48",
+ "sha256:c888b18f7392e6cc79a33a803e7ebd7890ac3318f571fca6b356526f35b53b12",
+ "sha256:ca30721fda297ae22f16bc37aa7ed244970ddfdcb98247570cdd26daaad4665e",
+ "sha256:cf5f5340dd682ab034baa52f423a0f91326489c262ac9617fa06309ec05880e9",
+ "sha256:d0726aa0d9b57c56985db5952e90fb1033a317074f2877db5307cdd6eede1564",
+ "sha256:df442945b2dd6f8ae0e20b403e0fd4548cd5c2aad69200047cc3251257b78f65",
+ "sha256:e08e758c31919d167c0867539bd3b2441629ef00aa595e3ea2b635273659f40a",
+ "sha256:e4864339deeeaefaad34dd3a432ee618a039fca28efb292949c855e00878203c",
+ "sha256:f4cd049cb94d9f517b1cab5668a3b345968beba093bc79a637e671000b3540ec"
+ ],
+ "version": "==1.24.3"
},
"gunicorn": {
"hashes": [
@@ -1258,11 +1351,11 @@
},
"imageio": {
"hashes": [
- "sha256:1a2bbbb7cd38161340fa3b14d806dfbf914abf3ee6fd4592af2afb87d049f209",
- "sha256:42e65aadfc3d57a1043615c92bdf6319b67589e49a0aae2b985b82144aceacad"
+ "sha256:c9763e5c187ecf74091c845626b0bdcc6130a20a0de7a86ae0108e2b5335ed3f",
+ "sha256:f44eb231b9df485874f2ffd22dfd0c3c711e7de076516b9374edea5c65bc67ae"
],
"index": "pypi",
- "version": "==2.5.0"
+ "version": "==2.6.1"
},
"importlib-metadata": {
"hashes": [
@@ -1281,11 +1374,11 @@
},
"ipykernel": {
"hashes": [
- "sha256:167c3ef08450f5e060b76c749905acb0e0fbef9365899377a4a1eae728864383",
- "sha256:b503913e0b4cce7ed2de965457dfb2edd633e8234161a60e23f2fe2161345d12"
+ "sha256:1a7def9c986f1ee018c1138d16951932d4c9d4da01dad45f9d34e9899565a22f",
+ "sha256:b368ad13edb71fa2db367a01e755a925d7f75ed5e09fbd3f06c85e7a8ef108a8"
],
"index": "pypi",
- "version": "==5.1.2"
+ "version": "==5.1.3"
},
"ipython": {
"hashes": [
@@ -1335,11 +1428,11 @@
},
"jinja2": {
"hashes": [
- "sha256:065c4f02ebe7f7cf559e49ee5a95fb800a9e4528727aec6f24402a5374c65013",
- "sha256:14dd6caf1527abb21f08f86c784eac40853ba93edb79552aa1e4b8aef1b61c7b"
+ "sha256:74320bb91f31270f9551d46522e33af46a80c3d619f4a4bf42b3164d30b5911f",
+ "sha256:9fe95f19286cfefaa917656583d020be14e7859c6b0252588391e47db34527de"
],
"index": "pypi",
- "version": "==2.10.1"
+ "version": "==2.10.3"
},
"jmespath": {
"hashes": [
@@ -1365,10 +1458,10 @@
},
"jsonschema": {
"hashes": [
- "sha256:5f9c0a719ca2ce14c5de2fd350a64fd2d13e8539db29836a86adc990bb1a068f",
- "sha256:8d4a2b7b6c2237e0199c8ea1a6d3e05bf118e289ae2b9d7ba444182a2959560d"
+ "sha256:2fa0684276b6333ff3c0b1b27081f4b2305f0a36cf702a23db50edb141893c3f",
+ "sha256:94c0a13b4a0616458b42529091624e66700a17f847453e52279e35509a5b7631"
],
- "version": "==3.0.2"
+ "version": "==3.1.1"
},
"jupyter": {
"hashes": [
@@ -1381,11 +1474,11 @@
},
"jupyter-client": {
"hashes": [
- "sha256:6a6d415c62179728f6d9295b37356d8f6833e9e01c2b6e1901dc555571f57b21",
- "sha256:f406f214f9daa92be110d5b83d62f3451ffc73d3522db7350f0554683533ab18"
+ "sha256:60e6faec1031d63df57f1cc671ed673dced0ed420f4377ea33db37b1c188b910",
+ "sha256:d0c077c9aaa4432ad485e7733e4d91e48f87b4f4bab7d283d42bb24cbbba0a0f"
],
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
- "version": "==5.3.3"
+ "version": "==5.3.4"
},
"jupyter-console": {
"hashes": [
@@ -1397,11 +1490,11 @@
},
"jupyter-core": {
"hashes": [
- "sha256:2c6e7c1e9f2ac45b5c2ceea5730bc9008d92fe59d0725eac57b04c0edfba24f7",
- "sha256:f4fa22d6cf25f34807c995f22d2923693575c70f02557bcbfbe59bd5ec8d8b84"
+ "sha256:464769f7387d7a62a2403d067f1ddc616655b7f77f5d810c0dd62cb54bfd0fb9",
+ "sha256:a183e0ec2e8f6adddf62b0a3fc6a2237e3e0056d381e536d3e7c7ecc3067e244"
],
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
- "version": "==4.5.0"
+ "version": "==4.6.1"
},
"keras-applications": {
"hashes": [
@@ -1596,13 +1689,6 @@
],
"version": "==0.6.1"
},
- "meld3": {
- "hashes": [
- "sha256:1efda676264490db2e30bfb81b27a918cc6d9c2de6d609491aa43410b9537eb9",
- "sha256:a78cdcb6c0342b7ac82d900b584bd918ef72f86b60cdbf04754f840c070eb20c"
- ],
- "version": "==2.0.0"
- },
"mistune": {
"hashes": [
"sha256:59a3429db53c50b5c6bcc8a07f8848cb00d7dc8bdb431a4ab41920d201d4756e",
@@ -1672,10 +1758,11 @@
},
"networkx": {
"hashes": [
- "sha256:8311ddef63cf5c5c5e7c1d0212dd141d9a1fe3f474915281b73597ed5f1d4e3d"
+ "sha256:cdfbf698749a5014bf2ed9db4a07a5295df1d3a53bf80bf3cbd61edf9df05fa1",
+ "sha256:f8f4ff0b6f96e4f9b16af6b84622597b5334bf9cae8cf9b2e42e7985d5c95c64"
],
- "markers": "python_version >= '3.5'",
- "version": "==2.3"
+ "index": "pypi",
+ "version": "==2.4"
},
"nose": {
"hashes": [
@@ -1704,25 +1791,30 @@
},
"numpy": {
"hashes": [
- "sha256:05dbfe72684cc14b92568de1bc1f41e5f62b00f714afc9adee42f6311738091f",
- "sha256:0d82cb7271a577529d07bbb05cb58675f2deb09772175fab96dc8de025d8ac05",
- "sha256:10132aa1fef99adc85a905d82e8497a580f83739837d7cbd234649f2e9b9dc58",
- "sha256:12322df2e21f033a60c80319c25011194cd2a21294cc66fee0908aeae2c27832",
- "sha256:16f19b3aa775dddc9814e02a46b8e6ae6a54ed8cf143962b4e53f0471dbd7b16",
- "sha256:3d0b0989dd2d066db006158de7220802899a1e5c8cf622abe2d0bd158fd01c2c",
- "sha256:438a3f0e7b681642898fd7993d38e2bf140a2d1eafaf3e89bb626db7f50db355",
- "sha256:5fd214f482ab53f2cea57414c5fb3e58895b17df6e6f5bca5be6a0bb6aea23bb",
- "sha256:73615d3edc84dd7c4aeb212fa3748fb83217e00d201875a47327f55363cef2df",
- "sha256:7bd355ad7496f4ce1d235e9814ec81ee3d28308d591c067ce92e49f745ba2c2f",
- "sha256:7d077f2976b8f3de08a0dcf5d72083f4af5411e8fddacd662aae27baa2601196",
- "sha256:a4092682778dc48093e8bda8d26ee8360153e2047826f95a3f5eae09f0ae3abf",
- "sha256:b458de8624c9f6034af492372eb2fee41a8e605f03f4732f43fc099e227858b2",
- "sha256:e70fc8ff03a961f13363c2c95ef8285e0cf6a720f8271836f852cc0fa64e97c8",
- "sha256:ee8e9d7cad5fe6dde50ede0d2e978d81eafeaa6233fb0b8719f60214cf226578",
- "sha256:f4a4f6aba148858a5a5d546a99280f71f5ee6ec8182a7d195af1a914195b21a2"
- ],
- "index": "pypi",
- "version": "==1.17.2"
+ "sha256:0b0dd8f47fb177d00fa6ef2d58783c4f41ad3126b139c91dd2f7c4b3fdf5e9a5",
+ "sha256:25ffe71f96878e1da7e014467e19e7db90ae7d4e12affbc73101bcf61785214e",
+ "sha256:26efd7f7d755e6ca966a5c0ac5a930a87dbbaab1c51716ac26a38f42ecc9bc4b",
+ "sha256:28b1180c758abf34a5c3fea76fcee66a87def1656724c42bb14a6f9717a5bdf7",
+ "sha256:2e418f0a59473dac424f888dd57e85f77502a593b207809211c76e5396ae4f5c",
+ "sha256:30c84e3a62cfcb9e3066f25226e131451312a044f1fe2040e69ce792cb7de418",
+ "sha256:4650d94bb9c947151737ee022b934b7d9a845a7c76e476f3e460f09a0c8c6f39",
+ "sha256:4dd830a11e8724c9c9379feed1d1be43113f8bcce55f47ea7186d3946769ce26",
+ "sha256:4f2a2b279efde194877aff1f76cf61c68e840db242a5c7169f1ff0fd59a2b1e2",
+ "sha256:62d22566b3e3428dfc9ec972014c38ed9a4db4f8969c78f5414012ccd80a149e",
+ "sha256:669795516d62f38845c7033679c648903200980d68935baaa17ac5c7ae03ae0c",
+ "sha256:75fcd60d682db3e1f8fbe2b8b0c6761937ad56d01c1dc73edf4ef2748d5b6bc4",
+ "sha256:9395b0a41e8b7e9a284e3be7060db9d14ad80273841c952c83a5afc241d2bd98",
+ "sha256:9e37c35fc4e9410093b04a77d11a34c64bf658565e30df7cbe882056088a91c1",
+ "sha256:a0678793096205a4d784bd99f32803ba8100f639cf3b932dc63b21621390ea7e",
+ "sha256:b46554ad4dafb2927f88de5a1d207398c5385edbb5c84d30b3ef187c4a3894d8",
+ "sha256:c867eeccd934920a800f65c6068acdd6b87e80d45cd8c8beefff783b23cdc462",
+ "sha256:dd0667f5be56fb1b570154c2c0516a528e02d50da121bbbb2cbb0b6f87f59bc2",
+ "sha256:de2b1c20494bdf47f0160bd88ed05f5e48ae5dc336b8de7cfade71abcc95c0b9",
+ "sha256:f1df7b2b7740dd777571c732f98adb5aad5450aee32772f1b39249c8a50386f6",
+ "sha256:ffca69e29079f7880c5392bf675eb8b4146479d976ae1924d01cd92b04cccbcc"
+ ],
+ "index": "pypi",
+ "version": "==1.17.3"
},
"opencv-python": {
"hashes": [
@@ -1794,24 +1886,28 @@
},
"pandas": {
"hashes": [
- "sha256:18d91a9199d1dfaa01ad645f7540370ba630bdcef09daaf9edf45b4b1bca0232",
- "sha256:3f26e5da310a0c0b83ea50da1fd397de2640b02b424aa69be7e0784228f656c9",
- "sha256:4182e32f4456d2c64619e97c58571fa5ca0993d1e8c2d9ca44916185e1726e15",
- "sha256:426e590e2eb0e60f765271d668a30cf38b582eaae5ec9b31229c8c3c10c5bc21",
- "sha256:5eb934a8f0dc358f0e0cdf314072286bbac74e4c124b64371395e94644d5d919",
- "sha256:717928808043d3ea55b9bcde636d4a52d2236c246f6df464163a66ff59980ad8",
- "sha256:8145f97c5ed71827a6ec98ceaef35afed1377e2d19c4078f324d209ff253ecb5",
- "sha256:8744c84c914dcc59cbbb2943b32b7664df1039d99e834e1034a3372acb89ea4d",
- "sha256:c1ac1d9590d0c9314ebf01591bd40d4c03d710bfc84a3889e5263c97d7891dee",
- "sha256:cb2e197b7b0687becb026b84d3c242482f20cbb29a9981e43604eb67576da9f6",
- "sha256:d4001b71ad2c9b84ff18b182cea22b7b6cbf624216da3ea06fb7af28d1f93165",
- "sha256:d8930772adccb2882989ab1493fa74bd87d47c8ac7417f5dd3dd834ba8c24dc9",
- "sha256:dfbb0173ee2399bc4ed3caf2d236e5c0092f948aafd0a15fbe4a0e77ee61a958",
- "sha256:eebfbba048f4fa8ac711b22c78516e16ff8117d05a580e7eeef6b0c2be554c18",
- "sha256:f1b21bc5cf3dbea53d33615d1ead892dfdae9d7052fa8898083bec88be20dcd2"
+ "sha256:0f484f43658a72e7d586a74978259657839b5bd31b903e963bb1b1491ab51775",
+ "sha256:0ffc6f9e20e77f3a7dc8baaad9c7fd25b858b084d3a2d8ce877bc3ea804e0636",
+ "sha256:23e0eac646419c3057f15eb96ab821964848607bf1d4ea5a82f26565986ec5e9",
+ "sha256:27c0603b15b5c6fa24885253bbe49a0c289381e7759385c59308ba4f0b166cf1",
+ "sha256:397fe360643fffc5b26b41efdf608647e3334a618d185a07976cd2dc51c90bce",
+ "sha256:3dbb3aa41c01504255bff2bd56944bdb915f6c9ce4bac7e2868efbace0b2a639",
+ "sha256:4e07c63247c59d61c6ebdbbb50196143cec6c5044403510c4e1a9d31854a83d6",
+ "sha256:4fa6d9235c6d2fecbeca82c3d326abd255866cafbfd37f66a0e826544e619760",
+ "sha256:56cb88b3876363d410a9d7724f43641ff164e2c9902d3266a648213e2efd5e6d",
+ "sha256:7ce1be1614455f83710b9a5dc1fc602a755bdddbe4dda1d41515062923a37bbf",
+ "sha256:ae1c96ffdeec376895e533107e0b0f9da16225a2184fbb24a5abc866769db75e",
+ "sha256:b6f27c9231be8a23de846f2302373991467dd8e397a4804d2614e8c5aa8d5a90",
+ "sha256:c6056067f894f9355bedcd168dd740aa849908d41c0a74756f6e38f203e941b3",
+ "sha256:ca91a19d1f0a280874a24dca44aadce42da7f3a7edb7e9ab7c7baad8febee2be",
+ "sha256:cbe4985f5c82a173f8cff6b7fe92d551addf99fb4ea9ff4eb4b1fe606bb098ec",
+ "sha256:e3e9893bfe80a8b8e6d56d36ebb7afe1df77db7b4068a6e2ef3636a91f6f1caa",
+ "sha256:e7b218e8711910dac3fed0d19376cd1ef0e386be5175965d332fd0c65d02a43b",
+ "sha256:ec48d18b8b63a5dbb838e8ea7892ee1034299e03f852bd9b6dffe870310414dd",
+ "sha256:f4ab6280277e3208a59bfa9f2e51240304d09e69ffb65abfb4a21d678b495f74"
],
"markers": "python_version >= '3.5.3'",
- "version": "==0.25.1"
+ "version": "==0.25.2"
},
"pandocfilters": {
"hashes": [
@@ -1858,35 +1954,39 @@
},
"pillow": {
"hashes": [
- "sha256:00fdeb23820f30e43bba78eb9abb00b7a937a655de7760b2e09101d63708b64e",
- "sha256:01f948e8220c85eae1aa1a7f8edddcec193918f933fb07aaebe0bfbbcffefbf1",
- "sha256:08abf39948d4b5017a137be58f1a52b7101700431f0777bec3d897c3949f74e6",
- "sha256:099a61618b145ecb50c6f279666bbc398e189b8bc97544ae32b8fcb49ad6b830",
- "sha256:2c1c61546e73de62747e65807d2cc4980c395d4c5600ecb1f47a650c6fa78c79",
- "sha256:2ed9c4f694861642401f27dc3cb99772be67cd190e84845c749dae0a06c3bfae",
- "sha256:338581b30b908e111be578f0297255f6b57a51358cd16fa0e6f664c9a1f88bff",
- "sha256:38c7d48a21cd06fdeee93987147b9b1c55b73b4cfcbf83240568bfbd5adee447",
- "sha256:43fd026f613c8e48a25eba1a92f4d2ad7f3903c95d8c33a11611a7717d2ab654",
- "sha256:4548236844327a718ce3bb182ab32a16fa2050c61e334e959f554cac052fb0df",
- "sha256:5090857876c58885cfa388dc649e5db30aae98a068c26f3fd0ac9d7d9a4d9572",
- "sha256:5bbba34f97a26a93f5e8dec469ca4ddd712451418add43da946dbaed7f7a98d2",
- "sha256:65a28969a025a0eb4594637b6103201dc4ed2a9508bdab56ac33e43e3081c404",
- "sha256:892bb52b70bd5ea9dbbc3ac44f38e84f5a04e9d8b1bff48159d96cb795b81159",
- "sha256:8a9becd5cbd5062f973bcd2e7bc79483af310222de112b6541f8af1f93a3cc42",
- "sha256:972a7aaeb7c4a2795b52eef52ee991ef040b31009f36deca6207a986607b55f3",
- "sha256:97b119c436bfa96a92ac2ca525f7025836d4d4e64b1c9f9eff8dbaf3ff1d86f3",
- "sha256:9ba37698e242223f8053cc158f130aee046a96feacbeab65893dbe94f5530118",
- "sha256:b1b0e1f626a0f079c0d3696db70132fb1f29aa87c66aecb6501a9b8be64ce9f7",
- "sha256:c14c1224fd1a5be2733530d648a316974dbbb3c946913562c6005a76f21ca042",
- "sha256:c79a8546c48ae6465189e54e3245a97ddf21161e33ff7eaa42787353417bb2b6",
- "sha256:ceb76935ac4ebdf6d7bc845482a4450b284c6ccfb281e34da51d510658ab34d8",
- "sha256:e22bffaad04b4d16e1c091baed7f2733fc1ebb91e0c602abf1b6834d17158b1f",
- "sha256:ec883b8e44d877bda6f94a36313a1c6063f8b1997aa091628ae2f34c7f97c8d5",
- "sha256:f1baa54d50ec031d1a9beb89974108f8f2c0706f49798f4777df879df0e1adb6",
- "sha256:f53a5385932cda1e2c862d89460992911a89768c65d176ff8c50cddca4d29bed"
- ],
- "index": "pypi",
- "version": "==6.2.0"
+ "sha256:047d9473cf68af50ac85f8ee5d5f21a60f849bc17d348da7fc85711287a75031",
+ "sha256:0f66dc6c8a3cc319561a633b6aa82c44107f12594643efa37210d8c924fc1c71",
+ "sha256:12c9169c4e8fe0a7329e8658c7e488001f6b4c8e88740e76292c2b857af2e94c",
+ "sha256:248cffc168896982f125f5c13e9317c059f74fffdb4152893339f3be62a01340",
+ "sha256:27faf0552bf8c260a5cee21a76e031acaea68babb64daf7e8f2e2540745082aa",
+ "sha256:285edafad9bc60d96978ed24d77cdc0b91dace88e5da8c548ba5937c425bca8b",
+ "sha256:384b12c9aa8ef95558abdcb50aada56d74bc7cc131dd62d28c2d0e4d3aadd573",
+ "sha256:38950b3a707f6cef09cd3cbb142474357ad1a985ceb44d921bdf7b4647b3e13e",
+ "sha256:4aad1b88933fd6dc2846552b89ad0c74ddbba2f0884e2c162aa368374bf5abab",
+ "sha256:4ac6148008c169603070c092e81f88738f1a0c511e07bd2bb0f9ef542d375da9",
+ "sha256:4deb1d2a45861ae6f0b12ea0a786a03d19d29edcc7e05775b85ec2877cb54c5e",
+ "sha256:59aa2c124df72cc75ed72c8d6005c442d4685691a30c55321e00ed915ad1a291",
+ "sha256:5a47d2123a9ec86660fe0e8d0ebf0aa6bc6a17edc63f338b73ea20ba11713f12",
+ "sha256:5cc901c2ab9409b4b7ac7b5bcc3e86ac14548627062463da0af3b6b7c555a871",
+ "sha256:6c1db03e8dff7b9f955a0fb9907eb9ca5da75b5ce056c0c93d33100a35050281",
+ "sha256:7ce80c0a65a6ea90ef9c1f63c8593fcd2929448613fc8da0adf3e6bfad669d08",
+ "sha256:809c19241c14433c5d6135e1b6c72da4e3b56d5c865ad5736ab99af8896b8f41",
+ "sha256:83792cb4e0b5af480588601467c0764242b9a483caea71ef12d22a0d0d6bdce2",
+ "sha256:846fa202bd7ee0f6215c897a1d33238ef071b50766339186687bd9b7a6d26ac5",
+ "sha256:9f5529fc02009f96ba95bea48870173426879dc19eec49ca8e08cd63ecd82ddb",
+ "sha256:a423c2ea001c6265ed28700df056f75e26215fd28c001e93ef4380b0f05f9547",
+ "sha256:ac4428094b42907aba5879c7c000d01c8278d451a3b7cccd2103e21f6397ea75",
+ "sha256:b1ae48d87f10d1384e5beecd169c77502fcc04a2c00a4c02b85f0a94b419e5f9",
+ "sha256:bf4e972a88f8841d8fdc6db1a75e0f8d763e66e3754b03006cbc3854d89f1cb1",
+ "sha256:c6414f6aad598364aaf81068cabb077894eb88fed99c6a65e6e8217bab62ae7a",
+ "sha256:c710fcb7ee32f67baf25aa9ffede4795fd5d93b163ce95fdc724383e38c9df96",
+ "sha256:c7be4b8a09852291c3c48d3c25d1b876d2494a0a674980089ac9d5e0d78bd132",
+ "sha256:c9e5ffb910b14f090ac9c38599063e354887a5f6d7e6d26795e916b4514f2c1a",
+ "sha256:e0697b826da6c2472bb6488db4c0a7fa8af0d52fa08833ceb3681358914b14e5",
+ "sha256:e9a3edd5f714229d41057d56ac0f39ad9bdba6767e8c888c951869f0bdd129b0"
+ ],
+ "index": "pypi",
+ "version": "==6.2.1"
},
"pprofile": {
"hashes": [
@@ -1934,6 +2034,7 @@
"psutil": {
"hashes": [
"sha256:028a1ec3c6197eadd11e7b46e8cc2f0720dc18ac6d7aabdb8e8c0d6c9704f000",
+ "sha256:12542c3642909f4cd1928a2fba59e16fa27e47cbeea60928ebb62a8cbd1ce123",
"sha256:503e4b20fa9d3342bcf58191bbc20a4a5ef79ca7df8972e6197cc14c5513e73d",
"sha256:863a85c1c0a5103a12c05a35e59d336e1d665747e531256e061213e2e90f63f3",
"sha256:954f782608bfef9ae9f78e660e065bd8ffcfaea780f9f2c8a133bb7cb9e826d7",
@@ -2021,11 +2122,11 @@
},
"pylint": {
"hashes": [
- "sha256:7edbae11476c2182708063ac387a8f97c760d9cfe36a5ede0ca996f90cf346c8",
- "sha256:844ce067788028c1a35086a5c66bc5e599ddd851841c41d6ee1623b36774d9f2"
+ "sha256:7b76045426c650d2b0f02fc47c14d7934d17898779da95288a74c2a7ec440702",
+ "sha256:856476331f3e26598017290fd65bebe81c960e806776f324093a46b76fb2d1c0"
],
"index": "pypi",
- "version": "==2.4.2"
+ "version": "==2.4.3"
},
"pylogbeat": {
"hashes": [
@@ -2090,6 +2191,7 @@
"sha256:30f36a9c70450c7878053fa1344aca0145fd47d845270b43a7ee9192a051bf39",
"sha256:37aa336a317209f1bb099ad177fef0da45be36a2aa664507c5d72015f956c310",
"sha256:4943decfc5b905748f0756fdd99d4f9498d7064815c4cf3643820c9028b711d1",
+ "sha256:53126cd91356342dcae7e209f840212a58dcf1177ad52c1d938d428eebc9fee5",
"sha256:57ef38a65056e7800859e5ba9e6091053cd06e1038983016effaffe0efcd594a",
"sha256:5bd61e9b44c543016ce1f6aef48606280e45f892a928ca7068fba30021e9b786",
"sha256:6482d3017a0c0327a49dddc8bd1074cc730d45db2ccb09c3bac1f8f32d1eb61b",
@@ -2098,6 +2200,7 @@
"sha256:a39f54ccbcd2757d1d63b0ec00a00980c0b382c62865b61a505163943624ab20",
"sha256:aabb0c5232910a20eec8563503c153a8e78bbf5459490c49ab31f6adf3f3a415",
"sha256:bd4ecb473a96ad0f90c20acba4f0bf0df91a4e03a1f4dd6a4bdc9ca75aa3a715",
+ "sha256:bf459128feb543cfca16a95f8da31e2e65e4c5257d2f3dfa8c0c1031139c9c92",
"sha256:e2da3c13307eac601f3de04887624939aca8ee3c9488a0bb0eca4fb9401fc6b1",
"sha256:f67814c38162f4deb31f68d590771a29d5ae3b1bd64b75cf232308e5c74777e0"
],
@@ -2169,24 +2272,26 @@
},
"pyqt5-sip": {
"hashes": [
- "sha256:304acf771b6033cb4bafc415939d227c91265d30664ed643b298d7e95f509f81",
- "sha256:39d2677f4de46ed4d7aa3b612f31c74c881975efe51c6a23fbb1d9382e4cc850",
- "sha256:54b99a3057e8f01b90d49cca9ca566b1ea23d8920038760f44e75b90c62b9d5f",
- "sha256:59f5332f86f3ccd3ac94674fe91eae6e8aca26da7c6588917cabd0fe22af106d",
- "sha256:72be07a21b0f379987c4ec59bc86834a9719a2f9cfb49606a4d4e34dae9aa549",
- "sha256:7b3b8c015e545fa30e42205fc1115b7c6afcb6acec790ce3f330a06323730523",
- "sha256:7fbb6389c20aff4c3257e89bb1787effffcaf05c32d937c00094ae45846bffd5",
- "sha256:828d9911acc483672a2bae1cc1bf79f591eb3338faad1f2c798aa2f45459a318",
- "sha256:a9460dac973deccc6ff2d90f18fd105cbaada147f84e5917ed79374dcb237758",
- "sha256:aade50f9a1b9d20f6aabe88e8999b10db57218f5c31950160f3f7957dd64e07c",
- "sha256:ac9e5b282d1f0771a8310ed974afe1961ec31e9ae787d052c0e504ea46ae323a",
- "sha256:ba41bd21b89c6713f7077b5f7d4a1c452989190aad5704e215560a266a1ecbab",
- "sha256:c309dbbd6c155e961bfd6893496afa5cd184cce6f7dffd87ea68ee048b6f97e1",
- "sha256:cfc21b1f80d4655ffa776c505a2576b4d148bbc52bb3e33fedbf6cfbdbc09d1b",
- "sha256:d7b26e0b6d81bf14c1239e6a891ac1303a7e882512d990ec330369c7269226d7",
- "sha256:f8b7a3e05235ce58a38bf317f71a5cb4ab45d3b34dc57421dd8cea48e0e4023e"
- ],
- "version": "==4.19.19"
+ "sha256:02d94786bada670ab17a2b62ce95b3cf8e3b40c99d36007593a6334d551840bb",
+ "sha256:06bc66b50556fb949f14875a4c224423dbf03f972497ccb883fb19b7b7c3b346",
+ "sha256:091fbbe10a7aebadc0e8897a9449cda08d3c3f663460d812eca3001ca1ed3526",
+ "sha256:0a067ade558befe4d46335b13d8b602b5044363bfd601419b556d4ec659bca18",
+ "sha256:1910c1cb5a388d4e59ebb2895d7015f360f3f6eeb1700e7e33e866c53137eb9e",
+ "sha256:1c7ad791ec86247f35243bbbdd29cd59989afbe0ab678e0a41211f4407f21dd8",
+ "sha256:3c330ff1f70b3eaa6f63dce9274df996dffea82ad9726aa8e3d6cbe38e986b2f",
+ "sha256:482a910fa73ee0e36c258d7646ef38f8061774bbc1765a7da68c65056b573341",
+ "sha256:7695dfafb4f5549ce1290ae643d6508dfc2646a9003c989218be3ce42a1aa422",
+ "sha256:8274ed50f4ffbe91d0f4cc5454394631edfecd75dc327aa01be8bc5818a57e88",
+ "sha256:9047d887d97663790d811ac4e0d2e895f1bf2ecac4041691487de40c30239480",
+ "sha256:9f6ab1417ecfa6c1ce6ce941e0cebc03e3ec9cd9925058043229a5f003ae5e40",
+ "sha256:b43ba2f18999d41c3df72f590348152e14cd4f6dcea2058c734d688dfb1ec61f",
+ "sha256:c3ab9ea1bc3f4ce8c57ebc66fb25cd044ef92ed1ca2afa3729854ecc59658905",
+ "sha256:da69ba17f6ece9a85617743cb19de689f2d63025bf8001e2facee2ec9bcff18f",
+ "sha256:ef3c7a0bf78674b0dda86ff5809d8495019903a096c128e1f160984b37848f73",
+ "sha256:fabff832046643cdb93920ddaa8f77344df90768930fbe6bb33d211c4dcd0b5e"
+ ],
+ "markers": "python_version >= '3.5'",
+ "version": "==12.7.0"
},
"pyrsistent": {
"hashes": [
@@ -2218,10 +2323,10 @@
},
"python-engineio": {
"hashes": [
- "sha256:2a4c874aea686e79f8ea9efc30748110df581df6d577d18bb5eaa1a8f2199d12",
- "sha256:eae09ef72bbb13e66ad0bbe2fbb87271e0ba5e2ec8c6693c6be1e14239564e32"
+ "sha256:4a13fb87c819b855c55a731fdf82559adb8311c04cfdfebd6b9ecd1c2afbb575",
+ "sha256:9c9a6035b4b5e5a225f426f846afa14cf627f7571d1ae02167cb703fefd134b7"
],
- "version": "==3.9.3"
+ "version": "==3.10.0"
},
"python-logstash": {
"hashes": [
@@ -2247,10 +2352,10 @@
},
"pytz": {
"hashes": [
- "sha256:26c0b32e437e54a18161324a2fca3c4b9846b74a8dccddd843113109e1116b32",
- "sha256:c894d57500a4cd2d5c71114aaab77dbab5eabd9022308ce5ac9bb93a60a6f0c7"
+ "sha256:1c557d7d0e871de1f5ccd5833f60fb2550652da6be2693c1e02300743d21500d",
+ "sha256:b02c06db6cf09c12dd25137e563b31700d3b80fcc4ad23abb7a315f2789819be"
],
- "version": "==2019.2"
+ "version": "==2019.3"
},
"pyvcd": {
"hashes": [
@@ -2262,34 +2367,30 @@
},
"pywavelets": {
"hashes": [
- "sha256:18b193b67937e805a8e79c036bd2aa4ea3a357737256efeefdabd19c95083c3b",
- "sha256:1d7ba03baa81938b17d4819db36f018e680d929af329062af4d4b6d6236d02ba",
- "sha256:21f39d86cc35e003576fc1400b15534e2999570418fcdb17ea62d1ff8773b076",
- "sha256:250412f482d5cb358b7ec323b2a783d91e5cfc337fdf8fde3c59bf2c35d6366f",
- "sha256:25c0c592bf43eaffb4d3c6b6444b14c7407db750b6f2d344d809d4af934319d9",
- "sha256:2f2cdd96e4882b0c18e75cc90c4710de429ac226ce53b58a90c7420e3e307631",
- "sha256:3abed8dcd3e94ead72ee8010b494df5a9bdbdd5e39129d52fbf8066efa323a51",
- "sha256:3e99ab8feeb47755738fb8deb8154c9604c4a7996b1b7db6b090475105ca7c92",
- "sha256:64926c4c78dd690ec0d61be20f7c27cfbde6de9fa66ab8205eb079d9db6927fc",
- "sha256:687ec8877c10e3a03595ad167d1ea2662bc1ab13ef43d63a6e207a53b2ee4c26",
- "sha256:6af0077c7a4c9935aa64301f6942468b494656b8812e801d4a635cf42088f96c",
- "sha256:7215856a5d2e1a2dccca1f71d912ee6a7387086f3b3adcb55d7c41314c6abb0c",
- "sha256:9e47b241533add77961093b1e40cfff031597d429e91ad7c675838be0f7cc0df",
- "sha256:9e782f49dca57bc0fd2a40c0917949d77be2ecc999ccd44fff57fb10aa214135",
- "sha256:a12c7a6258c0015d2c75d88b87393ee015494551f049009e8b63eafed2d78efc",
- "sha256:a5027d47484498e70391b311a2688c4f74294de629b982ed17be57be4c77ade7",
- "sha256:ab02363467ee3cb222c5b425bc53453270ddae72bce313e72fd14616692d725a",
- "sha256:adc79308c65a2007bdbd5846fda70088e7ead0ef0a5a6f44d08829e9478a907f",
- "sha256:afaaee392450785a346d9e5e5f6e5307b13958d8b0633818632cb38972a7752a",
- "sha256:b26b836c7f71df7b2779e62d1338367cfe37b98324e9b0d54b428ac030e3d1f0",
- "sha256:b9adbc27d70a2626c235a18b41315de2832c384651d03383db7a58c2a2bccc6f",
- "sha256:bd6e62efb7839fd6bf894b7b9aec6d58be0c44a38ea0c9f3c5bea834d84d05eb",
- "sha256:de083a3a71576a9c3d8ba73b6f0425e4690d6ac6e480562f30bec5cb20667324",
- "sha256:e89551257233a3da717a9e6e2e303243df75faffe0b6781d21c15eb9d682ec6d",
- "sha256:eafb7d609c41a04028144f4b6697792f448554960ef353244aaf0a5883263543",
- "sha256:fb3ee9f65d25ee5c89104e533d5f341c253cdb9543ef6fcd6dfa599b12e84f1c"
- ],
- "version": "==1.0.3"
+ "sha256:076ca8907001fdfe4205484f719d12b4a0262dfe6652fa1cfc3c5c362d14dc84",
+ "sha256:18a51b3f9416a2ae6e9a35c4af32cf520dd7895f2b69714f4aa2f4342fca47f9",
+ "sha256:1a64b40f6acb4ffbaccce0545d7fc641744f95351f62e4c6aaa40549326008c9",
+ "sha256:35959c041ec014648575085a97b498eafbbaa824f86f6e4a59bfdef8a3fe6308",
+ "sha256:55e39ec848ceec13c9fa1598253ae9dd5c31d09dfd48059462860d2b908fb224",
+ "sha256:6162dc0ae04669ea04b4b51420777b9ea2d30b0a9d02901b2a3b4d61d159c2e9",
+ "sha256:68b5c33741d26c827074b3d8f0251de1c3019bb9567b8d303eb093c822ce28f1",
+ "sha256:720dbcdd3d91c6dfead79c80bf8b00a1d8aa4e5d551dc528c6d5151e4efc3403",
+ "sha256:7947e51ca05489b85928af52a34fe67022ab5b81d4ae32a4109a99e883a0635e",
+ "sha256:79f5b54f9dc353e5ee47f0c3f02bebd2c899d49780633aa771fed43fa20b3149",
+ "sha256:80b924edbc012ded8aa8b91cb2fd6207fb1a9a3a377beb4049b8a07445cec6f0",
+ "sha256:889d4c5c5205a9c90118c1980df526857929841df33e4cd1ff1eff77c6817a65",
+ "sha256:935ff247b8b78bdf77647fee962b1cc208c51a7b229db30b9ba5f6da3e675178",
+ "sha256:98b2669c5af842a70cfab33a7043fcb5e7535a690a00cd251b44c9be0be418e5",
+ "sha256:9e2528823ccf5a0a1d23262dfefe5034dce89cd84e4e124dc553dfcdf63ebb92",
+ "sha256:bc5e87b72371da87c9bebc68e54882aada9c3114e640de180f62d5da95749cd3",
+ "sha256:be105382961745f88d8196bba5a69ee2c4455d87ad2a2e5d1eed6bd7fda4d3fd",
+ "sha256:c06d2e340c7bf8b9ec71da2284beab8519a3908eab031f4ea126e8ccfc3fd567",
+ "sha256:cfe79844526dd92e3ecc9490b5031fca5f8ab607e1e858feba232b1b788ff0ea",
+ "sha256:d510aef84d9852653d079c84f2f81a82d5d09815e625f35c95714e7364570ad4",
+ "sha256:e02a0558e0c2ac8b8bbe6a6ac18c136767ec56b96a321e0dfde2173adfa5a504"
+ ],
+ "markers": "python_version >= '3.5'",
+ "version": "==1.1.1"
},
"pyzmq": {
"hashes": [
@@ -2331,11 +2432,11 @@
},
"redis": {
"hashes": [
- "sha256:98a22fb750c9b9bb46e75e945dc3f61d0ab30d06117cbb21ff9cd1d315fedd3b",
- "sha256:c504251769031b0dd7dd5cf786050a6050197c6de0d37778c80c08cb04ae8275"
+ "sha256:3613daad9ce5951e426f460deddd5caf469e08a3af633e9578fc77d362becf62",
+ "sha256:8d0fc278d3f5e1249967cba2eb4a5632d19e45ce5c09442b8422d15ee2c22cc2"
],
"index": "pypi",
- "version": "==3.3.8"
+ "version": "==3.3.11"
},
"redlock": {
"hashes": [
@@ -2377,25 +2478,20 @@
},
"scikit-image": {
"hashes": [
- "sha256:0fb4f61ba28e7034dc490b7fd37a35428493cc1180205991aea41ab78c1a3b2a",
- "sha256:117244d206f014fcdc7fd3b03dc25ffd3c32be49c5103b916dadcf3c268ce629",
- "sha256:2dee5c19893bbfebeb30c2edd47e3092d84fe671e1278c8e1b8ab0b541b88590",
- "sha256:2edf2189a89d68e7909bfe939f6f9978d4807c4c2c6464b9d23944171272efe5",
- "sha256:56f8ec5106c1b6037f25395eb6a2c29cbbb1baa9d8cedb48a6488a697f9e0c02",
- "sha256:5c24501fbe0000bf215418ced56fc718ae5bbd004df7dc460fd3fb095385dec5",
- "sha256:6665b00b649237171eb0c34ec7d2c5ee96f51cc826edf1b70654fc05fddec7a8",
- "sha256:676838be922fdc7c65a1bfa71409b382874d60e2a7a0c968fe832f63b485842d",
- "sha256:6b8697a52e1e3c2663f74a0a972cc601d2ceb5b3299cc9be3c3b6ac41d76d238",
- "sha256:91208ff13381ccbacce8a38a771e9d9d8982dce146581bcf6656aa8fd05d06ea",
- "sha256:a8fb7dc56b14656768fdf21d4325bf82f543fad51dc83c24aa6a27456a946a2d",
- "sha256:bea86976ab9b7bebca43721b3ff8fd74a002e1fd95e7600987cd42664fde8a39",
- "sha256:ce9354571e1323ed98251723a7e5ffb3526ddd3b533a27aaca4ebd13ed479c56",
- "sha256:df111e654b47e5ea456c50553debe4c5ddd97258894c7ad3b7f2f9f10798e053",
- "sha256:ed6d2dbb54a68b200df8783fcb17c406ece20420c8c86508ab0f5966e8631da5",
- "sha256:f0491621a6b1d2828d47acaf41d3167a647eaae44ef8fcf83b72eb3e1cc7ac51"
- ],
- "index": "pypi",
- "version": "==0.15.0"
+ "sha256:063d1c20fcd53762f82ee58c29783ae4e8f6fbed445b41b704fa33b6f355729d",
+ "sha256:0808ab5f8218d91a1c008036993636535a37efd67a52ab0f2e6e3f4b7e75aeda",
+ "sha256:2a54bea469eb1b611bee1ce36e60710f5f94f29205bc5bd67a51793909b1e62b",
+ "sha256:2aa962aa82d815606d7dad7f045f5d7ca55c65b4320d47e15a98fc92612c2d6c",
+ "sha256:2d346d49b6852cffb47cbde995e2696d5b07f688d8c057a0a4548abf3a98f920",
+ "sha256:3ad2efa792ab8de5fcefe6f4f5bc1ab64c411cdb5c829ce1526ab3a5a7729627",
+ "sha256:3af3d781ce085573ced37b2b5b9abfd32ce3d4723bd17f37e829025d189b0421",
+ "sha256:6786b127f33470fd843e644435522fbf43bce05c9f5527946c390ccb9e1cac27",
+ "sha256:8b2b768b02c6b7476f2e16ddd91f827d3817aef73f82cf28bff7a8dcdfd8c55c",
+ "sha256:dd7fbd32da74d4e9967dc15845f731f16e7966cee61f5dc0e12e2abb1305068c",
+ "sha256:e774377876cb258e8f4d63f7809863f961c98aa02263b3ff54a39483bc6f7d26"
+ ],
+ "index": "pypi",
+ "version": "==0.16.2"
},
"scipy": {
"hashes": [
@@ -2496,10 +2592,10 @@
},
"sqlalchemy": {
"hashes": [
- "sha256:2f8ff566a4d3a92246d367f2e9cd6ed3edeef670dcd6dda6dfdc9efed88bcd80"
+ "sha256:0f0768b5db594517e1f5e1572c73d14cf295140756431270d89496dc13d5e46c"
],
"index": "pypi",
- "version": "==1.3.8"
+ "version": "==1.3.10"
},
"subprocess32": {
"hashes": [
@@ -2511,11 +2607,11 @@
},
"supervisor": {
"hashes": [
- "sha256:43e87c7b572a94acdb586aaebb06844dae1aa02856b984c5a738032abd753fb7",
- "sha256:9644990d21a1ba03b1a7ac5e9a0c0c62e12822e258f9e98f4a0b128461b3f10a"
+ "sha256:2dc86fe0476e945e61483d614ceb2cf4f93b95282eb243bdf792621994360383",
+ "sha256:a76b2f77a560f2dc411c0254a4eb15f555e99faac48621b0f1fc9ab013944f47"
],
"index": "pypi",
- "version": "==4.0.4"
+ "version": "==4.1.0"
},
"tenacity": {
"hashes": [
@@ -2535,10 +2631,10 @@
},
"tensorflow-estimator": {
"hashes": [
- "sha256:54fdfe8712d54627579bc6d524ced43bbd57042cb2ce411bdf2ae46b29a772da"
+ "sha256:aa8deab25d09a9730dfbae8ec58f4eb00ec2a90b5ca3dcbd8fa0717103d3bbb3"
],
"index": "pypi",
- "version": "==2.0.0"
+ "version": "==2.0.1"
},
"tensorflow-gpu": {
"hashes": [
@@ -2603,20 +2699,25 @@
},
"typed-ast": {
"hashes": [
+ "sha256:1170afa46a3799e18b4c977777ce137bb53c7485379d9706af8a59f2ea1aa161",
"sha256:18511a0b3e7922276346bcb47e2ef9f38fb90fd31cb9223eed42c85d1312344e",
"sha256:262c247a82d005e43b5b7f69aff746370538e176131c32dda9cb0f324d27141e",
"sha256:2b907eb046d049bcd9892e3076c7a6456c93a25bebfe554e931620c90e6a25b0",
"sha256:354c16e5babd09f5cb0ee000d54cfa38401d8b8891eefa878ac772f827181a3c",
+ "sha256:48e5b1e71f25cfdef98b013263a88d7145879fbb2d5185f2a0c79fa7ebbeae47",
"sha256:4e0b70c6fc4d010f8107726af5fd37921b666f5b31d9331f0bd24ad9a088e631",
"sha256:630968c5cdee51a11c05a30453f8cd65e0cc1d2ad0d9192819df9978984529f4",
"sha256:66480f95b8167c9c5c5c87f32cf437d585937970f3fc24386f313a4c97b44e34",
"sha256:71211d26ffd12d63a83e079ff258ac9d56a1376a25bc80b1cdcdf601b855b90b",
+ "sha256:7954560051331d003b4e2b3eb822d9dd2e376fa4f6d98fee32f452f52dd6ebb2",
+ "sha256:838997f4310012cf2e1ad3803bce2f3402e9ffb71ded61b5ee22617b3a7f6b6e",
"sha256:95bd11af7eafc16e829af2d3df510cecfd4387f6453355188342c3e79a2ec87a",
"sha256:bc6c7d3fa1325a0c6613512a093bc2a2a15aeec350451cbdf9e1d4bffe3e3233",
"sha256:cc34a6f5b426748a507dd5d1de4c1978f2eb5626d51326e43280941206c209e1",
"sha256:d755f03c1e4a51e9b24d899561fec4ccaf51f210d52abdf8c07ee2849b212a36",
"sha256:d7c45933b1bdfaf9f36c579671fec15d25b06c8398f113dab64c18ed1adda01d",
"sha256:d896919306dd0aa22d0132f62a1b78d11aaf4c9fc5b3410d3c666b818191630a",
+ "sha256:fdc1c9bbf79510b76408840e009ed65958feba92a88833cdceecff93ae8fff66",
"sha256:ffde2fbfad571af120fcbfbbc61c72469e72f550d676c3342492a9dfdefb8f12"
],
"markers": "python_version < '3.8' and implementation_name == 'cpython'",
diff --git a/README.md b/README.md
index f191c9308f..564287562b 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
Welcome to openpilot
======
-[openpilot](http://github.com/commaai/openpilot) is an open source driver assistance system. Currently, it performs the functions of Adaptive Cruise Control (ACC) and Lane Keeping Assist System (LKAS) for selected Honda, Toyota, Acura, Lexus, Chevrolet, Hyundai, Kia. It's about on par with Tesla Autopilot and GM Super Cruise, and better than [all other manufacturers](http://www.thedrive.com/tech/5707/the-war-for-autonomous-driving-part-iii-us-vs-germany-vs-japan).
+[openpilot](http://github.com/commaai/openpilot) is an open source driver assistance system. Currently, it performs the functions of Adaptive Cruise Control (ACC) and Automated Lane Centering (ALC) for selected Honda, Toyota, Acura, Lexus, Chevrolet, Hyundai, Kia, Subaru, Volkswagen. It's about on par with Tesla Autopilot and GM Super Cruise, and better than [all other manufacturers](http://www.thedrive.com/tech/5707/the-war-for-autonomous-driving-part-iii-us-vs-germany-vs-japan).
The openpilot codebase has been written to be concise and to enable rapid prototyping. We look forward to your contributions - improving real vehicle automation has never been easier.
@@ -29,116 +29,116 @@ Community
openpilot is developed by [comma.ai](https://comma.ai/) and users like you.
-We have a [Twitter you should follow](https://twitter.com/comma_ai).
-
-Also, we have a several thousand people community on [Discord](https://discord.comma.ai).
+[Follow us on Twitter](https://twitter.com/comma_ai) and [join our Discord](https://discord.comma.ai).
-  |
-  |
-  |
-  |
+  |
+  |
+  |
+  |
-  |
-  |
-  |
-  |
+  |
+  |
+  |
+  |
Hardware
------
-At the moment openpilot supports the [EON Dashcam DevKit](https://comma.ai/shop/products/eon-dashcam-devkit). A [panda](https://shop.comma.ai/products/panda-obd-ii-dongle) and a [giraffe](https://comma.ai/shop/products/giraffe/) are recommended tools to interface the EON with the car. We'd like to support other platforms as well.
+At the moment openpilot supports the [EON DevKit](https://comma.ai/shop/products/eon-dashcam-devkit). A [car harness](https://comma.ai/shop/products/car-harness) is recommended to connect the EON to the car. We'd like to support other platforms as well.
Install openpilot on a neo device by entering ``https://openpilot.comma.ai`` during NEOS setup.
Supported Cars
------
-| Make | Model (US Market Reference)| Supported Package | Lateral | Longitudinal | No Accel Below | No Steer Below | Giraffe |
-| ---------------------| ---------------------------| ---------------------| --------| ---------------| -----------------| ---------------|-------------------|
-| Acura | ILX 2016-18 | AcuraWatch Plus | Yes | Yes | 25mph1| 25mph | Nidec |
-| Acura | RDX 2016-18 | AcuraWatch Plus | Yes | Yes | 25mph1| 12mph | Nidec |
-| Buick3 | Regal 2018 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom6|
-| Chevrolet3| Malibu 2017 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom6|
-| Chevrolet3| Volt 2017-18 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom6|
-| Cadillac3 | ATS 2018 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom6|
-| Chrysler | Pacifica 2017-18 | Adaptive Cruise | Yes | Stock | 0mph | 9mph | FCA |
-| Chrysler | Pacifica Hybrid 2017-18 | Adaptive Cruise | Yes | Stock | 0mph | 9mph | FCA |
-| Chrysler | Pacifica Hybrid 2019 | Adaptive Cruise | Yes | Stock | 0mph | 39mph | FCA |
-| GMC3 | Acadia Denali 2018 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom6|
-| Holden3 | Astra 2017 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom6|
-| Honda | Accord 2018-19 | All | Yes | Stock | 0mph | 3mph | Bosch |
-| Honda | Accord Hybrid 2018-19 | All | Yes | Stock | 0mph | 3mph | Bosch |
-| Honda | Civic Sedan/Coupe 2016-18 | Honda Sensing | Yes | Yes | 0mph | 12mph | Nidec |
-| Honda | Civic Sedan/Coupe 2019 | Honda Sensing | Yes | Stock | 0mph | 2mph | Bosch |
-| Honda | Civic Hatchback 2017-19 | Honda Sensing | Yes | Stock | 0mph | 12mph | Bosch |
-| Honda | CR-V 2015-16 | Touring | Yes | Yes | 25mph1| 12mph | Nidec |
-| Honda | CR-V 2017-19 | Honda Sensing | Yes | Stock | 0mph | 12mph | Bosch |
-| Honda | CR-V Hybrid 2017-2019 | Honda Sensing | Yes | Stock | 0mph | 12mph | Bosch |
-| Honda | Fit 2018-19 | Honda Sensing | Yes | Yes | 25mph1| 12mph | Inverted Nidec |
-| Honda | Odyssey 2018-19 | Honda Sensing | Yes | Yes | 25mph1| 0mph | Inverted Nidec |
-| Honda | Passport 2019 | All | Yes | Yes | 25mph1| 12mph | Inverted Nidec |
-| Honda | Pilot 2016-18 | Honda Sensing | Yes | Yes | 25mph1| 12mph | Nidec |
-| Honda | Pilot 2019 | All | Yes | Yes | 25mph1| 12mph | Inverted Nidec |
-| Honda | Ridgeline 2017-19 | Honda Sensing | Yes | Yes | 25mph1| 12mph | Nidec |
-| Hyundai | Santa Fe 2019 | All | Yes | Stock | 0mph | 0mph | Custom5|
-| Hyundai | Elantra 2017-19 | SCC + LKAS | Yes | Stock | 19mph | 34mph | Custom5|
-| Hyundai | Genesis 2018 | All | Yes | Stock | 19mph | 34mph | Custom5|
-| Jeep | Grand Cherokee 2016-18 | Adaptive Cruise | Yes | Stock | 0mph | 9mph | FCA |
-| Jeep | Grand Cherokee 2019 | Adaptive Cruise | Yes | Stock | 0mph | 39mph | FCA |
-| Kia | Optima 2019 | SCC + LKAS | Yes | Stock | 0mph | 0mph | Custom5|
-| Kia | Sorento 2018 | All | Yes | Stock | 0mph | 0mph | Custom5|
-| Kia | Stinger 2018 | SCC + LKAS | Yes | Stock | 0mph | 0mph | Custom5|
-| Lexus | CT Hybrid 2017-18 | All | Yes | Yes2| 0mph | 0mph | Toyota |
-| Lexus | ES 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
-| Lexus | ES Hybrid 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
-| Lexus | RX Hybrid 2016-19 | All | Yes | Yes2| 0mph | 0mph | Toyota |
-| Lexus | IS 2017-2019 | All | Yes | Stock | 22mph | 0mph | Toyota |
-| Lexus | IS Hybrid 2017 | All | Yes | Stock | 0mph | 0mph | Toyota |
-| Subaru | Crosstrek 2018-19 | EyeSight | Yes | Stock | 0mph | 0mph | Subaru |
-| Subaru | Impreza 2019-20 | EyeSight | Yes | Stock | 0mph | 0mph | Subaru |
-| Toyota | Avalon 2016 | TSS-P | Yes | Yes2| 20mph1| 0mph | Toyota |
-| Toyota | Avalon 2017-18 | All | Yes | Yes2| 20mph1| 0mph | Toyota |
-| Toyota | Camry 2018-19 | All | Yes | Stock | 0mph4 | 0mph | Toyota |
-| Toyota | Camry Hybrid 2018-19 | All | Yes | Stock | 0mph4 | 0mph | Toyota |
-| Toyota | C-HR 2017-19 | All | Yes | Stock | 0mph | 0mph | Toyota |
-| Toyota | C-HR Hybrid 2017-19 | All | Yes | Stock | 0mph | 0mph | Toyota |
-| Toyota | Corolla 2017-19 | All | Yes | Yes2| 20mph1| 0mph | Toyota |
-| Toyota | Corolla 2020 | All | Yes | Yes | 0mph | 0mph | Toyota |
-| Toyota | Corolla Hatchback 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
-| Toyota | Corolla Hybrid 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
-| Toyota | Highlander 2017-19 | All | Yes | Yes2| 0mph | 0mph | Toyota |
-| Toyota | Highlander Hybrid 2017-19 | All | Yes | Yes2| 0mph | 0mph | Toyota |
-| Toyota | Prius 2016 | TSS-P | Yes | Yes2| 0mph | 0mph | Toyota |
-| Toyota | Prius 2017-19 | All | Yes | Yes2| 0mph | 0mph | Toyota |
-| Toyota | Prius Prime 2017-20 | All | Yes | Yes2| 0mph | 0mph | Toyota |
-| Toyota | Rav4 2016 | TSS-P | Yes | Yes2| 20mph1| 0mph | Toyota |
-| Toyota | Rav4 2017-18 | All | Yes | Yes2| 20mph1| 0mph | Toyota |
-| Toyota | Rav4 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
-| Toyota | Rav4 Hybrid 2016 | TSS-P | Yes | Yes2| 0mph | 0mph | Toyota |
-| Toyota | Rav4 Hybrid 2017-18 | All | Yes | Yes2| 0mph | 0mph | Toyota |
-| Toyota | Sienna 2018 | All | Yes | Yes2| 0mph | 0mph | Toyota |
+| Make | Model (US Market Reference) | Supported Package | Lateral | Longitudinal | No Accel Below | No Steer Below |
+| ----------------------| -----------------------------------| ---------------------| --------| ---------------| -----------------| ---------------|
+| Acura | ILX 2016-18 | AcuraWatch Plus | Yes | Yes | 25mph1| 25mph |
+| Acura | RDX 2016-18 | AcuraWatch Plus | Yes | Yes | 25mph1| 12mph |
+| Buick3 | Regal 20186 | Adaptive Cruise | Yes | Yes | 0mph | 7mph |
+| Chevrolet3 | Malibu 20176 | Adaptive Cruise | Yes | Yes | 0mph | 7mph |
+| Chevrolet3 | Volt 2017-186 | Adaptive Cruise | Yes | Yes | 0mph | 7mph |
+| Cadillac3 | ATS 2018 | Adaptive Cruise | Yes | Yes | 0mph | 7mph |
+| Chrysler | Pacifica 2017-187 | Adaptive Cruise | Yes | Stock | 0mph | 9mph |
+| Chrysler | Pacifica Hybrid 2017-187| Adaptive Cruise | Yes | Stock | 0mph | 9mph |
+| Chrysler | Pacifica Hybrid 20197 | Adaptive Cruise | Yes | Stock | 0mph | 39mph |
+| GMC3 | Acadia Denali 20186 | Adaptive Cruise | Yes | Yes | 0mph | 7mph |
+| Holden3 | Astra 20176 | Adaptive Cruise | Yes | Yes | 0mph | 7mph |
+| Honda | Accord 2018-19 | All | Yes | Stock | 0mph | 3mph |
+| Honda | Accord Hybrid 2018-19 | All | Yes | Stock | 0mph | 3mph |
+| Honda | Civic Sedan/Coupe 2016-18 | Honda Sensing | Yes | Yes | 0mph | 12mph |
+| Honda | Civic Sedan/Coupe 2019 | Honda Sensing | Yes | Stock | 0mph | 2mph |
+| Honda | Civic Hatchback 2017-19 | Honda Sensing | Yes | Stock | 0mph | 12mph |
+| Honda | CR-V 2015-16 | Touring | Yes | Yes | 25mph1| 12mph |
+| Honda | CR-V 2017-19 | Honda Sensing | Yes | Stock | 0mph | 12mph |
+| Honda | CR-V Hybrid 2017-2019 | Honda Sensing | Yes | Stock | 0mph | 12mph |
+| Honda | Fit 2018-19 | Honda Sensing | Yes | Yes | 25mph1| 12mph |
+| Honda | Odyssey 2018-19 | Honda Sensing | Yes | Yes | 25mph1| 0mph |
+| Honda | Passport 2019 | All | Yes | Yes | 25mph1| 12mph |
+| Honda | Pilot 2016-18 | Honda Sensing | Yes | Yes | 25mph1| 12mph |
+| Honda | Pilot 2019 | All | Yes | Yes | 25mph1| 12mph |
+| Honda | Ridgeline 2017-19 | Honda Sensing | Yes | Yes | 25mph1| 12mph |
+| Hyundai | Santa Fe 20195 | All | Yes | Stock | 0mph | 0mph |
+| Hyundai | Elantra 2017-195 | SCC + LKAS | Yes | Stock | 19mph | 34mph |
+| Hyundai | Genesis 20185 | All | Yes | Stock | 19mph | 34mph |
+| Jeep | Grand Cherokee 2016-187 | Adaptive Cruise | Yes | Stock | 0mph | 9mph |
+| Jeep | Grand Cherokee 20197 | Adaptive Cruise | Yes | Stock | 0mph | 39mph |
+| Kia | Optima 20195 | SCC + LKAS | Yes | Stock | 0mph | 0mph |
+| Kia | Sorento 20185 | All | Yes | Stock | 0mph | 0mph |
+| Kia | Stinger 20185 | SCC + LKAS | Yes | Stock | 0mph | 0mph |
+| Lexus | CT Hybrid 2017-18 | All | Yes | Yes2| 0mph | 0mph |
+| Lexus | ES Hybrid 2019 | All | Yes | Yes | 0mph | 0mph |
+| Lexus | RX Hybrid 2016-19 | All | Yes | Yes2| 0mph | 0mph |
+| Lexus | IS 2017-2019 | All | Yes | Stock | 22mph | 0mph |
+| Lexus | IS Hybrid 2017 | All | Yes | Stock | 0mph | 0mph |
+| Subaru | Crosstrek 2018-19 | EyeSight | Yes | Stock | 0mph | 0mph |
+| Subaru | Impreza 2019-20 | EyeSight | Yes | Stock | 0mph | 0mph |
+| Toyota | Avalon 2016 | TSS-P | Yes | Yes2| 20mph1| 0mph |
+| Toyota | Avalon 2017-18 | All | Yes | Yes2| 20mph1| 0mph |
+| Toyota | Camry 2018-19 | All | Yes | Stock | 0mph4 | 0mph |
+| Toyota | Camry Hybrid 2018-19 | All | Yes | Stock | 0mph4 | 0mph |
+| Toyota | C-HR 2017-19 | All | Yes | Stock | 0mph | 0mph |
+| Toyota | C-HR Hybrid 2017-19 | All | Yes | Stock | 0mph | 0mph |
+| Toyota | Corolla 2017-19 | All | Yes | Yes2| 20mph1| 0mph |
+| Toyota | Corolla 2020 | All | Yes | Yes | 0mph | 0mph |
+| Toyota | Corolla Hatchback 2019 | All | Yes | Yes | 0mph | 0mph |
+| Toyota | Corolla Hybrid 2020 | All | Yes | Yes | 0mph | 0mph |
+| Toyota | Highlander 2017-19 | All | Yes | Yes2| 0mph | 0mph |
+| Toyota | Highlander Hybrid 2017-19 | All | Yes | Yes2| 0mph | 0mph |
+| Toyota | Prius 2016 | TSS-P | Yes | Yes2| 0mph | 0mph |
+| Toyota | Prius 2017-19 | All | Yes | Yes2| 0mph | 0mph |
+| Toyota | Prius Prime 2017-20 | All | Yes | Yes2| 0mph | 0mph |
+| Toyota | Rav4 2016 | TSS-P | Yes | Yes2| 20mph1| 0mph |
+| Toyota | Rav4 2017-18 | All | Yes | Yes2| 20mph1| 0mph |
+| Toyota | Rav4 2019 | All | Yes | Yes | 0mph | 0mph |
+| Toyota | Rav4 Hybrid 2016 | TSS-P | Yes | Yes2| 0mph | 0mph |
+| Toyota | Rav4 Hybrid 2017-18 | All | Yes | Yes2| 0mph | 0mph |
+| Toyota | Sienna 2018 | All | Yes | Yes2| 0mph | 0mph |
+| Volkswagen8| Golf 2016-19 | Driver Assistance | Yes | Stock | 0mph | 0mph |
1[Comma Pedal](https://community.comma.ai/wiki/index.php/Comma_Pedal) is used to provide stop-and-go capability to some of the openpilot-supported cars that don't currently support stop-and-go. Here is how to [build a Comma Pedal](https://medium.com/@jfrux/comma-pedal-building-with-macrofab-6328bea791e8). ***NOTE: The Comma Pedal is not officially supported by [comma.ai](https://comma.ai).***
2When disconnecting the Driver Support Unit (DSU), otherwise longitudinal control is stock ACC. For DSU locations, see [Toyota Wiki page](https://community.comma.ai/wiki/index.php/Toyota). ***NOTE: disconnecting the DSU disables Automatic Emergency Braking (AEB).***
3[GM installation guide](https://zoneos.com/volt/). ***NOTE: disconnecting the ASCM disables Automatic Emergency Braking (AEB).***
428mph for Camry 4CYL L, 4CYL LE and 4CYL SE which don't have Full-Speed Range Dynamic Radar Cruise Control.
-5Open sourced [Hyundai Giraffe](https://github.com/commaai/neo/tree/master/giraffe/hyundai) is designed for the 2019 Sante Fe; pinout may differ for other Hyundais.
-6Community built Giraffe, find more information [here](https://zoneos.com/shop/).
+5Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and open sourced [Hyundai Giraffe](https://github.com/commaai/neo/tree/master/giraffe/hyundai), designed for the 2019 Sante Fe; pinout may differ for other Hyundais.
+6Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and community built giraffe, find more information [here](https://zoneos.com/shop/).
+7Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and FCA [giraffe](https://comma.ai/shop/products/giraffe)
+8Requires a [custom connector](https://community.comma.ai/wiki/index.php/Volkswagen#Integration_at_J533_Gateway) for the [car harness](https://comma.ai/shop/products/car-harness)
Community Maintained Cars
------
-| Make | Model | Supported Package | Lateral | Longitudinal | No Accel Below | No Steer Below | Giraffe |
-| ---------------------| -------------------------| ---------------------| --------| ---------------| -----------------| ---------------|-------------------|
-| Tesla | Model S 2012-13 | All | Yes | Not yet | Not applicable | 0mph | Custom7|
+| Make | Model (US Market Reference) | Supported Package | Lateral | Longitudinal | No Accel Below | No Steer Below |
+| ---------------------| -----------------------------------| ---------------------| --------| ---------------| -----------------| ---------------|
+| Tesla | Model S 2012-139 | All | Yes | NA | NA | 0mph |
[[Tesla Model S Pull Request]](https://github.com/commaai/openpilot/pull/246)
-7Community built Giraffe, find more information here [Community Tesla Giraffe](https://github.com/jeankalud/neo/tree/tesla_giraffe/giraffe/tesla)
+9Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and community built giraffe, find more information [here](https://github.com/jeankalud/neo/tree/tesla_giraffe/giraffe/tesla).
Community Maintained Cars are not confirmed by comma.ai to meet our [safety model](https://github.com/commaai/openpilot/blob/devel/SAFETY.md). Be extra cautious using them.
@@ -149,6 +149,7 @@ In Progress Cars
- All Kia, Genesis with SCC and LKAS.
- All Chrysler, Jeep, Fiat with Adaptive Cruise Control and LaneSense.
- All Subaru with EyeSight.
+- All Volkswagen, Audi, Å koda and SEAT with Adaptive Cruise Control.
How can I add support for my car?
------
@@ -203,7 +204,7 @@ It logs the road facing camera, CAN, GPS, IMU, magnetometer, thermal sensors, cr
The user facing camera is only logged if you explicitly opt-in in settings.
It does not log the microphone.
-By using it, you agree to [our privacy policy](https://community.comma.ai/privacy.html). You understand that use of this software or its related services will generate certain types of user data, which may be logged and stored at the sole discretion of comma.ai. By accepting this agreement, you grant an irrevocable, perpetual, worldwide right to comma.ai for the use of this data.
+By using it, you agree to [our privacy policy](https://my.comma.ai/privacy). You understand that use of this software or its related services will generate certain types of user data, which may be logged and stored at the sole discretion of comma.ai. By accepting this agreement, you grant an irrevocable, perpetual, worldwide right to comma.ai for the use of this data.
Testing on PC
------
diff --git a/RELEASES.md b/RELEASES.md
index 2f6f6729a0..7d21b52260 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1,8 +1,21 @@
+Version 0.6.6 (2019-11-05)
+========================
+ * Volkswagen support thanks to jyoung8607!
+ * Toyota Corolla Hybrid with TSS 2.0 support thanks to u8511049!
+ * Lexus ES with TSS 2.0 support thanks to energee!
+ * Fix GM ignition detection and lock safety mode not required anymore
+ * Log panda firmware and dongle ID thanks to martinl!
+ * New driving model: improve path prediction and lead detection
+ * New driver monitoring model, 4x smaller and running on DSP
+ * Display an alert and don't start openpilot if panda has wrong firmware
+ * Fix bug preventing EON from terminating processes after a drive
+ * Remove support for Toyota giraffe without the 120Ohm resistor
+
Version 0.6.5 (2019-10-07)
========================
* NEOS update: upgrade to Python3 and new installer!
* comma Harness support!
- * New driving model: lateral control has lower reliance on lanelines
+ * New driving model: improve path prediction
* New driver monitoring model: more accurate face and eye detection
* Redesign offroad screen to display updates and alerts
* Increase maximum allowed acceleration
@@ -62,7 +75,7 @@ Version 0.6 (2019-07-01)
* Panda safety code is MISRA compliant and ships with a signed version on release2
* New NEOS is 500MB smaller and has a reproducible usr/pipenv
* Lexus ES Hybrid support thanks to wocsor!
- * Improve tuning for supported Toyota with TSS2
+ * Improve tuning for supported Toyota with TSS 2.0
* Various other stability improvements
Version 0.5.13 (2019-05-31)
diff --git a/SAFETY.md b/SAFETY.md
index 3cda811e0c..f3089c497b 100644
--- a/SAFETY.md
+++ b/SAFETY.md
@@ -1,8 +1,8 @@
openpilot Safety
======
-openpilot is an Adaptive Cruise Control (ACC) and Lane Keeping Assist (LKA) system.
-Like other ACC and LKA systems, openpilot requires the driver to be alert and to
+openpilot is an Adaptive Cruise Control (ACC) and Automated Lane Centering (ALC) system.
+Like other ACC and ALC systems, openpilot requires the driver to be alert and to
pay attention at all times. We repeat, **driver alertness is necessary, but not
sufficient, for openpilot to be used safely**.
@@ -93,7 +93,7 @@ GM/Chevrolet
commands outside these limits. A steering torque rate limit is enforced by the panda firmware and by
openpilot, so that the commanded steering torque must rise from 0 to max value no faster than
0.75s. Commanded steering torque is gradually limited by the panda firmware and by openpilot if the driver's
- torque exceeds 12 units in the opposite dicrection to ensure limited applied torque against the
+ torque exceeds 12 units in the opposite direction to ensure limited applied torque against the
driver's will.
- Brake pedal and gas pedal potentiometer signals are contained in the 0xF1 and 0x1A1 CAN messages,
@@ -116,7 +116,7 @@ Hyundai/Kia (Lateral only)
commands outside the values of -409 and 409. A steering torque rate limit is enforced by the panda firmware and by
openpilot, so that the commanded steering torque must rise from 0 to max value no faster than
0.85s. Commanded steering torque is gradually limited by the panda firmware and by openpilot if the driver's
- torque exceeds 50 units in the opposite dicrection to ensure limited applied torque against the
+ torque exceeds 50 units in the opposite direction to ensure limited applied torque against the
driver's will.
Chrysler/Jeep/Fiat (Lateral only)
@@ -144,8 +144,31 @@ Subaru (Lateral only)
commands outside the values of -2047 and 2047. A steering torque rate limit is enforced by the panda firmware and by
openpilot, so that the commanded steering torque must rise from 0 to max value no faster than
0.41s. Commanded steering torque is gradually limited by the panda firmware and by openpilot if the driver's
- torque exceeds 60 units in the opposite dicrection to ensure limited applied torque against the
+ torque exceeds 60 units in the opposite direction to ensure limited applied torque against the
driver's will.
+Volkswagen, Audi, SEAT, Å koda (Lateral only)
+------
+
+ - While the system is engaged, steer commands are subject to the same limits used by the stock system, and
+ additional limits required to meet Comma safety standards.
+
+ - Steering torque is controlled through the CAN message 0x126, also known as HCA_01 for Heading Control Assist.
+ It's limited by openpilot and Panda to a value between -250 and 250, representing 2.5 Nm of torque applied
+ at the steering rack. The vehicle EPS unit will fault for values outside -300 and 300.
+
+ - The vehicle EPS unit will tolerate any rate of increase or decrease, but may limit the effective rate of
+ change to 5.0 Nm/s. In accordance with the Comma AI safety model requirements, a rate limit is enforced by
+ the Panda firmware and by openpilot, so that the commanded steering torque cannot rise from 0 to maximum
+ faster than 1.25s. Commanded steering torque is gradually limited by the Panda firmware and by openpilot
+ if the driver's torque exceeds 0.8 Nm in the opposite direction to ensure limited applied torque against
+ the driver's will.
+
+ - Brake and gas pedal pressed signals are contained in the ESP_05 0x106 and Motor_20 0x121 CAN messages,
+ respectively. A rising edge of either signals triggers a disengagement and is enforced by openpilot.
+ The cancellation due to the rising edge of the gas pressed signal is also enforced by the Panda firmware.
+ Additionally, the cruise control system disengages on the rising edge of the brake pedal pressed signal,
+ and it's enforced by both openpilot and the Panda firmware.
+
**Extra note**: comma.ai strongly discourages the use of openpilot forks with safety code either missing or
not fully meeting the above requirements.
diff --git a/apk/ai.comma.plus.offroad.apk b/apk/ai.comma.plus.offroad.apk
index 224f4b066a..d8c84cc6bd 100644
Binary files a/apk/ai.comma.plus.offroad.apk and b/apk/ai.comma.plus.offroad.apk differ
diff --git a/check_code_quality.sh b/check_code_quality.sh
index 854d757a84..aed17230eb 100644
--- a/check_code_quality.sh
+++ b/check_code_quality.sh
@@ -1,6 +1,7 @@
#!/bin/bash
-pyflakes $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda")
+# Only pyflakes checks (--select=F)
+flake8 --select=F $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda")
RESULT=$?
if [ $RESULT -eq 0 ]; then
pylint $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda")
diff --git a/common/kalman/simple_kalman.py b/common/kalman/simple_kalman.py
index 0b35555b61..b6fdb7da2c 100644
--- a/common/kalman/simple_kalman.py
+++ b/common/kalman/simple_kalman.py
@@ -6,5 +6,4 @@ kalman_dir = os.path.dirname(os.path.abspath(__file__))
subprocess.check_call(["make", "simple_kalman_impl.so"], cwd=kalman_dir)
from .simple_kalman_impl import KF1D as KF1D
-# Silence pyflakes
assert KF1D
diff --git a/common/params.py b/common/params.py
index 6065c8c1ad..bbc66eaf97 100755
--- a/common/params.py
+++ b/common/params.py
@@ -77,10 +77,11 @@ keys = {
"LiveParameters": [TxType.PERSISTENT],
"LongitudinalControl": [TxType.PERSISTENT],
"OpenpilotEnabledToggle": [TxType.PERSISTENT],
+ "PandaFirmware": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
+ "PandaDongleId": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"Passive": [TxType.PERSISTENT],
"RecordFront": [TxType.PERSISTENT],
"ReleaseNotes": [TxType.PERSISTENT],
- "SafetyModelLock": [TxType.PERSISTENT],
"ShouldDoUpdate": [TxType.CLEAR_ON_MANAGER_START],
"SpeedLimitOffset": [TxType.PERSISTENT],
"SubscriberInfo": [TxType.PERSISTENT],
@@ -89,9 +90,11 @@ keys = {
"UpdateAvailable": [TxType.CLEAR_ON_MANAGER_START],
"Version": [TxType.PERSISTENT],
"Offroad_ChargeDisabled": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
- "Offroad_TemperatureTooHigh": [TxType.CLEAR_ON_MANAGER_START],
- "Offroad_ConnectivityNeededPrompt": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_ConnectivityNeeded": [TxType.CLEAR_ON_MANAGER_START],
+ "Offroad_ConnectivityNeededPrompt": [TxType.CLEAR_ON_MANAGER_START],
+ "Offroad_TemperatureTooHigh": [TxType.CLEAR_ON_MANAGER_START],
+ "Offroad_PandaFirmwareMismatch": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
+ "Offroad_InvalidTime": [TxType.CLEAR_ON_MANAGER_START],
}
diff --git a/models/driving_model.dlc b/models/driving_model.dlc
index 419cee019c..e04f9f93a1 100644
Binary files a/models/driving_model.dlc and b/models/driving_model.dlc differ
diff --git a/models/monitoring_model.dlc b/models/monitoring_model.dlc
index 58615915b0..d252d5d158 100644
Binary files a/models/monitoring_model.dlc and b/models/monitoring_model.dlc differ
diff --git a/panda/board/obj/panda.bin.signed b/panda/board/obj/panda.bin.signed
index 3a6b76e664..7fa3f83e55 100644
Binary files a/panda/board/obj/panda.bin.signed and b/panda/board/obj/panda.bin.signed differ
diff --git a/phonelibs/yaml-cpp/lib/libyaml-cpp.a b/phonelibs/yaml-cpp/lib/libyaml-cpp.a
index c039175107..f871781d35 100644
Binary files a/phonelibs/yaml-cpp/lib/libyaml-cpp.a and b/phonelibs/yaml-cpp/lib/libyaml-cpp.a differ
diff --git a/phonelibs/yaml-cpp/x64/lib/libyaml-cpp.a b/phonelibs/yaml-cpp/x64/lib/libyaml-cpp.a
new file mode 100644
index 0000000000..eb1a3637d9
Binary files /dev/null and b/phonelibs/yaml-cpp/x64/lib/libyaml-cpp.a differ
diff --git a/run_docker_tests.sh b/run_docker_tests.sh
index 3c4ef03e43..caf6299a63 100755
--- a/run_docker_tests.sh
+++ b/run_docker_tests.sh
@@ -1,16 +1,19 @@
#!/bin/bash
set -e
+SETUP="cd /tmp/openpilot && make -C cereal && "
+
docker build -t tmppilot -f Dockerfile.openpilot .
-docker run --rm tmppilot /bin/sh -c 'cd /tmp/openpilot/ && make -C cereal && cd /tmp/openpilot/selfdrive/test/ && ./test_fingerprints.py'
-docker run --rm tmppilot /bin/sh -c 'cd /tmp/openpilot/ && pyflakes $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda" | grep -vi "^\./tools")'
+
+docker run --rm tmppilot /bin/sh -c "$SETUP cd /tmp/openpilot/selfdrive/test/ && ./test_fingerprints.py"
+docker run --rm tmppilot /bin/sh -c 'cd /tmp/openpilot/ && flake8 --select=F $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda" | grep -vi "^\./tools")'
docker run --rm tmppilot /bin/sh -c 'cd /tmp/openpilot/ && pylint $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda" | grep -vi "^\./tools"); exit $(($? & 3))'
-docker run --rm tmppilot /bin/sh -c 'cd /tmp/openpilot/ && make -C cereal && python -m unittest discover common'
-docker run --rm tmppilot /bin/sh -c 'cd /tmp/openpilot/ && make -C cereal && python -m unittest discover selfdrive/can'
-docker run --rm tmppilot /bin/sh -c 'cd /tmp/openpilot/ && make -C cereal && python -m unittest discover selfdrive/boardd'
-docker run --rm tmppilot /bin/sh -c 'cd /tmp/openpilot/ && make -C cereal && python -m unittest discover selfdrive/controls'
-docker run --rm tmppilot /bin/sh -c 'cd /tmp/openpilot/ && python -m unittest discover selfdrive/loggerd'
-docker run --rm -v "$(pwd)"/selfdrive/test/longitudinal_maneuvers/out:/tmp/openpilot/selfdrive/test/longitudinal_maneuvers/out tmppilot /bin/sh -c 'cd /tmp/openpilot/selfdrive/test/longitudinal_maneuvers && OPTEST=1 ./test_longitudinal.py'
-docker run --rm tmppilot /bin/sh -c 'cd /tmp/openpilot/ && make -C cereal && cd /tmp/openpilot/selfdrive/test/process_replay/ && ./test_processes.py'
-docker run --rm tmppilot /bin/sh -c 'mkdir -p /data/params && cd /tmp/openpilot/ && make -C cereal && cd /tmp/openpilot/selfdrive/test/ && ./test_car_models.py'
+docker run --rm tmppilot /bin/sh -c "$SETUP python -m unittest discover common"
+docker run --rm tmppilot /bin/sh -c "$SETUP make -C selfdrive/can -j4 && python -m unittest discover selfdrive/can"
+docker run --rm tmppilot /bin/sh -c "$SETUP python -m unittest discover selfdrive/boardd"
+docker run --rm tmppilot /bin/sh -c "$SETUP make -C selfdrive/can -j4 && python -m unittest discover selfdrive/controls"
+docker run --rm tmppilot /bin/sh -c "$SETUP python -m unittest discover selfdrive/loggerd"
+docker run --rm -v "$(pwd)"/selfdrive/test/longitudinal_maneuvers/out:/tmp/openpilot/selfdrive/test/longitudinal_maneuvers/out tmppilot /bin/sh -c "$SETUP make -C selfdrive/can -j4 && cd /tmp/openpilot/selfdrive/test/longitudinal_maneuvers && OPTEST=1 ./test_longitudinal.py"
+docker run --rm tmppilot /bin/sh -c "$SETUP make -C selfdrive/can -j4 && cd /tmp/openpilot/selfdrive/test/process_replay/ && ./test_processes.py"
+docker run --rm tmppilot /bin/sh -c "$SETUP make -C selfdrive/can -j4 && mkdir -p /data/params && cd /tmp/openpilot/selfdrive/test/ && ./test_car_models.py"
diff --git a/selfdrive/athena/athenad.py b/selfdrive/athena/athenad.py
old mode 100755
new mode 100644
index 1474b346ba..d3b98e7131
--- a/selfdrive/athena/athenad.py
+++ b/selfdrive/athena/athenad.py
@@ -10,22 +10,19 @@ import socket
import time
import threading
import traceback
-import zmq
import base64
import requests
-import six.moves.queue
+import queue
from functools import partial
from jsonrpc import JSONRPCResponseManager, dispatcher
from websocket import create_connection, WebSocketTimeoutException, ABNF
from selfdrive.loggerd.config import ROOT
-import selfdrive.crash as crash
import selfdrive.messaging as messaging
from common.api import Api
from common.params import Params
from selfdrive.services import service_list
from selfdrive.swaglog import cloudlog
-from selfdrive.version import version, dirty
from functools import reduce
ATHENA_HOST = os.getenv('ATHENA_HOST', 'wss://athena.comma.ai')
@@ -33,8 +30,8 @@ HANDLER_THREADS = os.getenv('HANDLER_THREADS', 4)
LOCAL_PORT_WHITELIST = set([8022])
dispatcher["echo"] = lambda s: s
-payload_queue = six.moves.queue.Queue()
-response_queue = six.moves.queue.Queue()
+payload_queue = queue.Queue()
+response_queue = queue.Queue()
def handle_long_poll(ws):
end_event = threading.Event()
@@ -66,7 +63,7 @@ def jsonrpc_handler(end_event):
data = payload_queue.get(timeout=1)
response = JSONRPCResponseManager.handle(data, dispatcher)
response_queue.put_nowait(response)
- except six.moves.queue.Empty:
+ except queue.Empty:
pass
except Exception as e:
cloudlog.exception("athena jsonrpc handler failed")
@@ -79,8 +76,8 @@ def jsonrpc_handler(end_event):
def getMessage(service=None, timeout=1000):
if service is None or service not in service_list:
raise Exception("invalid service")
- socket = messaging.sub_sock(service_list[service].port)
- socket.setsockopt(zmq.RCVTIMEO, timeout)
+ socket = messaging.sub_sock(service)
+ socket.setTimeout(timeout)
ret = messaging.recv_one(socket)
return ret.to_dict()
@@ -99,8 +96,6 @@ def uploadFileToUrl(fn, url, headers):
def startLocalProxy(global_end_event, remote_ws_uri, local_port):
try:
- cloudlog.event("athena startLocalProxy", remote_ws_uri=remote_ws_uri, local_port=local_port)
-
if local_port not in LOCAL_PORT_WHITELIST:
raise Exception("Requested local port not whitelisted")
@@ -169,9 +164,12 @@ def takeSnapshot():
ret = snapshot()
if ret is not None:
def b64jpeg(x):
- f = io.BytesIO()
- jpeg_write(f, x)
- return base64.b64encode(f.getvalue()).decode("utf-8")
+ if x is not None:
+ f = io.BytesIO()
+ jpeg_write(f, x)
+ return base64.b64encode(f.getvalue()).decode("utf-8")
+ else:
+ return None
return {'jpegBack': b64jpeg(ret[0]),
'jpegFront': b64jpeg(ret[1])}
else:
@@ -185,6 +183,7 @@ def ws_proxy_recv(ws, local_sock, ssock, end_event, global_end_event):
except WebSocketTimeoutException:
pass
except Exception:
+ cloudlog.exception("athenad.ws_proxy_recv.exception")
traceback.print_exc()
break
@@ -208,8 +207,9 @@ def ws_proxy_send(ws, local_sock, signal_sock, end_event):
ws.send(data, ABNF.OPCODE_BINARY)
except Exception:
- traceback.print_exc()
- end_event.set()
+ cloudlog.exception("athenad.ws_proxy_send.exception")
+ traceback.print_exc()
+ end_event.set()
def ws_recv(ws, end_event):
while not end_event.is_set():
@@ -219,6 +219,7 @@ def ws_recv(ws, end_event):
except WebSocketTimeoutException:
pass
except Exception:
+ cloudlog.exception("athenad.ws_recv.exception")
traceback.print_exc()
end_event.set()
@@ -227,9 +228,10 @@ def ws_send(ws, end_event):
try:
response = response_queue.get(timeout=1)
ws.send(response.json)
- except six.moves.queue.Empty:
+ except queue.Empty:
pass
except Exception:
+ cloudlog.exception("athenad.ws_send.exception")
traceback.print_exc()
end_event.set()
@@ -241,31 +243,26 @@ def main(gctx=None):
dongle_id = params.get("DongleId").decode('utf-8')
ws_uri = ATHENA_HOST + "/ws/v2/" + dongle_id
- crash.bind_user(id=dongle_id)
- crash.bind_extra(version=version, dirty=dirty, is_eon=True)
- crash.install()
-
api = Api(dongle_id)
conn_retries = 0
while 1:
try:
- print("connecting to %s" % ws_uri)
ws = create_connection(ws_uri,
cookie="jwt=" + api.get_token(),
enable_multithread=True)
+ cloudlog.event("athenad.main.connected_ws", ws_uri=ws_uri)
ws.settimeout(1)
conn_retries = 0
handle_long_poll(ws)
except (KeyboardInterrupt, SystemExit):
break
except Exception:
+ cloudlog.exception("athenad.main.exception")
conn_retries += 1
traceback.print_exc()
time.sleep(backoff(conn_retries))
- params.delete("AthenadPid")
-
if __name__ == "__main__":
main()
diff --git a/selfdrive/athena/manage_athenad.py b/selfdrive/athena/manage_athenad.py
new file mode 100644
index 0000000000..034bfac5cb
--- /dev/null
+++ b/selfdrive/athena/manage_athenad.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python3
+
+import time
+from multiprocessing import Process
+
+import selfdrive.crash as crash
+from common.params import Params
+from selfdrive.manager import launcher
+from selfdrive.swaglog import cloudlog
+from selfdrive.version import version, dirty
+
+ATHENA_MGR_PID_PARAM = "AthenadPid"
+
+def main():
+ params = Params()
+ dongle_id = params.get("DongleId").decode('utf-8')
+ cloudlog.bind_global(dongle_id=dongle_id, version=version, dirty=dirty, is_eon=True)
+ crash.bind_user(id=dongle_id)
+ crash.bind_extra(version=version, dirty=dirty, is_eon=True)
+ crash.install()
+
+ try:
+ while 1:
+ cloudlog.info("starting athena daemon")
+ proc = Process(name='athenad', target=launcher, args=('selfdrive.athena.athenad',))
+ proc.start()
+ proc.join()
+ cloudlog.event("athenad exited", exitcode=proc.exitcode)
+ time.sleep(5)
+ except:
+ cloudlog.exception("manage_athenad.exception")
+ finally:
+ params.delete(ATHENA_MGR_PID_PARAM)
+
+if __name__ == '__main__':
+ main()
\ No newline at end of file
diff --git a/selfdrive/boardd/Makefile b/selfdrive/boardd/Makefile
index 67a315d8d9..f9d0155c6f 100644
--- a/selfdrive/boardd/Makefile
+++ b/selfdrive/boardd/Makefile
@@ -16,7 +16,8 @@ WARN_FLAGS = -Werror=implicit-function-declaration \
CFLAGS = -std=gnu11 -g -fPIC -I../ -I../../ -O2 $(WARN_FLAGS)
CXXFLAGS = -std=c++11 -g -fPIC -I../ -I../../ -O2 $(WARN_FLAGS)
-ZMQ_LIBS = -l:libczmq.a -l:libzmq.a -lgnustl_shared
+MESSAGING_FLAGS = -I$(BASEDIR)/selfdrive/messaging
+MESSAGING_LIBS = $(BASEDIR)/selfdrive/messaging/messaging.a
JSON_FLAGS = -I$(PHONELIBS)/json/src
@@ -31,13 +32,12 @@ EXTRA_LIBS = -lusb-1.0
ifeq ($(ARCH),aarch64)
CFLAGS += -mcpu=cortex-a57
CXXFLAGS += -mcpu=cortex-a57
+EXTRA_LIBS += -lgnustl_shared
endif
ifeq ($(ARCH),x86_64)
ZMQ_FLAGS = -I$(PHONELIBS)/zmq/aarch64/include
-ZMQ_LIBS = -L$(BASEDIR)/external/zmq/lib/ \
- -l:libczmq.a -l:libzmq.a
EXTRA_LIBS = -lusb-1.0 -lpthread
CXXFLAGS += -I/usr/include/libusb-1.0
CFLAGS += -I/usr/include/libusb-1.0
@@ -58,11 +58,10 @@ OBJS = boardd.o \
DEPS := $(OBJS:.o=.d)
-boardd: $(OBJS)
+boardd: $(OBJS) $(MESSAGING_LIBS)
@echo "[ LINK ] $@"
$(CXX) -fPIC -o '$@' $^ \
$(CEREAL_LIBS) \
- $(ZMQ_LIBS) \
$(EXTRA_LIBS)
boardd.o: boardd.cc
@@ -72,6 +71,7 @@ boardd.o: boardd.cc
$(CEREAL_CFLAGS) \
$(CEREAL_CXXFLAGS) \
$(ZMQ_FLAGS) \
+ $(MESSAGING_FLAGS) \
-I../ \
-I../../ \
-c -o '$@' '$<'
@@ -100,6 +100,7 @@ libcan_list_to_can_capnp.a: can_list_to_can_capnp.o $(CEREAL_OBJS)
-Iinclude -I.. -I../.. \
$(CEREAL_CXXFLAGS) \
$(ZMQ_FLAGS) \
+ $(MESSAGING_FLAGS) \
-c -o '$@' '$<'
.PHONY: clean
diff --git a/selfdrive/boardd/boardd.cc b/selfdrive/boardd/boardd.cc
index fde2b3ea21..b94bf3a3ed 100644
--- a/selfdrive/boardd/boardd.cc
+++ b/selfdrive/boardd/boardd.cc
@@ -1,11 +1,12 @@
#include
+#include
#include
#include
#include
#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -14,7 +15,6 @@
#include
#include
-#include
#include
#include
@@ -25,6 +25,7 @@
#include "common/params.h"
#include "common/swaglog.h"
#include "common/timing.h"
+#include "messaging.hpp"
#include
@@ -36,6 +37,16 @@ namespace {
volatile sig_atomic_t do_exit = 0;
+struct __attribute__((packed)) timestamp_t {
+ uint16_t year;
+ uint8_t month;
+ uint8_t day;
+ uint8_t weekday;
+ uint8_t hour;
+ uint8_t minute;
+ uint8_t second;
+};
+
libusb_context *ctx = NULL;
libusb_device_handle *dev_handle;
pthread_mutex_t usb_lock;
@@ -48,8 +59,7 @@ bool is_pigeon = false;
const uint32_t NO_IGNITION_CNT_MAX = 2 * 60 * 60 * 24 * 3; // turn off charge after 3 days
uint32_t no_ignition_cnt = 0;
bool connected_once = false;
-uint8_t ignition_last = 0;
-bool safety_model_locked = false;
+bool ignition_last = false;
pthread_t safety_setter_thread_handle = -1;
pthread_t pigeon_thread_handle = -1;
@@ -76,11 +86,9 @@ void *safety_setter_thread(void *s) {
LOGW("got CarVin %s", value_vin);
// VIN query done, stop listening to OBDII
- if (!safety_model_locked) {
- pthread_mutex_lock(&usb_lock);
- libusb_control_transfer(dev_handle, 0x40, 0xdc, (uint16_t)(cereal::CarParams::SafetyModel::NO_OUTPUT), 0, NULL, 0, TIMEOUT);
- pthread_mutex_unlock(&usb_lock);
- }
+ pthread_mutex_lock(&usb_lock);
+ libusb_control_transfer(dev_handle, 0x40, 0xdc, (uint16_t)(cereal::CarParams::SafetyModel::NO_OUTPUT), 0, NULL, 0, TIMEOUT);
+ pthread_mutex_unlock(&usb_lock);
char *value;
size_t value_sz = 0;
@@ -103,7 +111,7 @@ void *safety_setter_thread(void *s) {
capnp::FlatArrayMessageReader cmsg(amsg);
cereal::CarParams::Reader car_params = cmsg.getRoot();
- auto safety_model = car_params.getSafetyModel();
+ int safety_model = int(car_params.getSafetyModel());
auto safety_param = car_params.getSafetyParam();
LOGW("setting safety model: %d with param %d", safety_model, safety_param);
@@ -115,7 +123,7 @@ void *safety_setter_thread(void *s) {
// set if long_control is allowed by openpilot. Hardcoded to True for now
libusb_control_transfer(dev_handle, 0x40, 0xdf, 1, 0, NULL, 0, TIMEOUT);
- libusb_control_transfer(dev_handle, 0x40, 0xdc, (uint16_t)(cereal::CarParams::SafetyModel(safety_model)), safety_param, NULL, 0, TIMEOUT);
+ libusb_control_transfer(dev_handle, 0x40, 0xdc, safety_model, safety_param, NULL, 0, TIMEOUT);
pthread_mutex_unlock(&usb_lock);
@@ -126,12 +134,14 @@ void *safety_setter_thread(void *s) {
bool usb_connect() {
int err;
unsigned char hw_query[1] = {0};
- char *value_safety_model;
- size_t value_safety_model_sz = 0;
- int safety_model;
- const int result = read_db_value(NULL, "SafetyModelLock", &value_safety_model, &value_safety_model_sz);
+ unsigned char fw_ver_buf[64];
+ unsigned char serial_buf[16];
+ const char *fw_ver;
+ const char *serial;
+ int fw_ver_sz = 0;
+ int serial_sz = 0;
- ignition_last = 0;
+ ignition_last = false;
dev_handle = libusb_open_device_with_vid_pid(ctx, 0xbbaa, 0xddcc);
if (dev_handle == NULL) { goto fail; }
@@ -146,15 +156,26 @@ bool usb_connect() {
libusb_control_transfer(dev_handle, 0xc0, 0xe5, 1, 0, NULL, 0, TIMEOUT);
}
- // check if safety mode is forced (needed to support gm)
- if (value_safety_model_sz > 0) {
- sscanf(value_safety_model, "%d", &safety_model);
- // sanity check that we are not setting all output
- assert(safety_model != (int)(cereal::CarParams::SafetyModel::ALL_OUTPUT));
- safety_model_locked = true;
- LOGW("Setting Locked Safety Model %s", value_safety_model);
- libusb_control_transfer(dev_handle, 0x40, 0xdc, (uint16_t)(cereal::CarParams::SafetyModel(safety_model)), 0, NULL, 0, TIMEOUT);
+ // get panda fw
+ err = libusb_control_transfer(dev_handle, 0xc0, 0xd6, 0, 0, fw_ver_buf, 64, TIMEOUT);
+ if (err > 0) {
+ fw_ver = (const char *)fw_ver_buf;
+ fw_ver_sz = err;
+ write_db_value(NULL, "PandaFirmware", fw_ver, fw_ver_sz);
+ printf("panda fw: %.*s\n", fw_ver_sz, fw_ver);
}
+ else { goto fail; }
+
+ // get panda serial
+ err = libusb_control_transfer(dev_handle, 0xc0, 0xd0, 0, 0, serial_buf, 16, TIMEOUT);
+
+ if (err > 0) {
+ serial = (const char *)serial_buf;
+ serial_sz = strnlen(serial, err);
+ write_db_value(NULL, "PandaDongleId", serial, serial_sz);
+ printf("panda serial: %.*s\n", serial_sz, serial);
+ }
+ else { goto fail; }
// power off ESP
libusb_control_transfer(dev_handle, 0xc0, 0xd9, 0, 0, NULL, 0, TIMEOUT);
@@ -182,6 +203,38 @@ bool usb_connect() {
}
}
+ if (hw_type == cereal::HealthData::HwType::UNO){
+ // Get time from system
+ time_t rawtime;
+ time(&rawtime);
+
+ struct tm * sys_time = gmtime(&rawtime);
+
+ // Get time from RTC
+ timestamp_t rtc_time;
+ libusb_control_transfer(dev_handle, 0xc0, 0xa0, 0, 0, (unsigned char*)&rtc_time, sizeof(rtc_time), TIMEOUT);
+
+ //printf("System: %d-%d-%d\t%d:%d:%d\n", 1900 + sys_time->tm_year, 1 + sys_time->tm_mon, sys_time->tm_mday, sys_time->tm_hour, sys_time->tm_min, sys_time->tm_sec);
+ //printf("RTC: %d-%d-%d\t%d:%d:%d\n", rtc_time.year, rtc_time.month, rtc_time.day, rtc_time.hour, rtc_time.minute, rtc_time.second);
+
+ // Update system time from RTC if it looks off, and RTC time is good
+ if (1900 + sys_time->tm_year < 2019 && rtc_time.year >= 2019){
+ LOGE("System time wrong, setting from RTC");
+
+ struct tm new_time = { 0 };
+ new_time.tm_year = rtc_time.year - 1900;
+ new_time.tm_mon = rtc_time.month - 1;
+ new_time.tm_mday = rtc_time.day;
+ new_time.tm_hour = rtc_time.hour;
+ new_time.tm_min = rtc_time.minute;
+ new_time.tm_sec = rtc_time.second;
+
+ setenv("TZ","UTC",1);
+ const struct timeval tv = {mktime(&new_time), 0};
+ settimeofday(&tv, 0);
+ }
+ }
+
return true;
fail:
return false;
@@ -202,7 +255,7 @@ void handle_usb_issue(int err, const char func[]) {
// TODO: check other errors, is simply retrying okay?
}
-void can_recv(void *s) {
+void can_recv(PubSocket *publisher) {
int err;
uint32_t data[RECV_SIZE/4];
int recv;
@@ -256,10 +309,10 @@ void can_recv(void *s) {
// send to can
auto words = capnp::messageToFlatArray(msg);
auto bytes = words.asBytes();
- zmq_send(s, bytes.begin(), bytes.size(), 0);
+ publisher->send((char*)bytes.begin(), bytes.size());
}
-void can_health(void *s) {
+void can_health(PubSocket *publisher) {
int cnt;
int err;
@@ -270,11 +323,13 @@ void can_health(void *s) {
uint32_t can_send_errs;
uint32_t can_fwd_errs;
uint32_t gmlan_send_errs;
- uint8_t started;
+ uint8_t ignition_line;
+ uint8_t ignition_can;
uint8_t controls_allowed;
uint8_t gas_interceptor_detected;
uint8_t car_harness_status;
uint8_t usb_power_mode;
+ uint8_t safety_model;
} health;
// recv from board
@@ -289,7 +344,9 @@ void can_health(void *s) {
pthread_mutex_unlock(&usb_lock);
- if (health.started == 0) {
+ bool ignition = ((health.ignition_line != 0) || (health.ignition_can != 0));
+
+ if (!ignition) {
no_ignition_cnt += 1;
} else {
no_ignition_cnt = 0;
@@ -305,7 +362,7 @@ void can_health(void *s) {
#endif
// clear VIN, CarParams, and set new safety on car start
- if ((health.started != 0) && (ignition_last == 0)) {
+ if (ignition && !ignition_last) {
int result = delete_db_value(NULL, "CarVin");
assert((result == 0) || (result == ERR_NO_VALUE));
@@ -313,18 +370,46 @@ void can_health(void *s) {
assert((result == 0) || (result == ERR_NO_VALUE));
// diagnostic only is the default, needed for VIN query
- if (!safety_model_locked) {
- pthread_mutex_lock(&usb_lock);
- libusb_control_transfer(dev_handle, 0x40, 0xdc, (uint16_t)(cereal::CarParams::SafetyModel::ELM327), 0, NULL, 0, TIMEOUT);
- pthread_mutex_unlock(&usb_lock);
- }
+ pthread_mutex_lock(&usb_lock);
+ libusb_control_transfer(dev_handle, 0x40, 0xdc, (uint16_t)(cereal::CarParams::SafetyModel::ELM327), 0, NULL, 0, TIMEOUT);
+ pthread_mutex_unlock(&usb_lock);
+
if (safety_setter_thread_handle == -1) {
err = pthread_create(&safety_setter_thread_handle, NULL, safety_setter_thread, NULL);
assert(err == 0);
}
}
- ignition_last = health.started;
+ // Get fan RPM
+ uint16_t fan_speed_rpm = 0;
+
+ pthread_mutex_lock(&usb_lock);
+ int sz = libusb_control_transfer(dev_handle, 0xc0, 0xb2, 0, 0, (unsigned char*)&fan_speed_rpm, sizeof(fan_speed_rpm), TIMEOUT);
+ pthread_mutex_unlock(&usb_lock);
+
+ // Write to rtc once per minute when no ignition present
+ if ((hw_type == cereal::HealthData::HwType::UNO) && !ignition && (no_ignition_cnt % 120 == 1)){
+ // Get time from system
+ time_t rawtime;
+ time(&rawtime);
+
+ struct tm * sys_time = gmtime(&rawtime);
+
+ // Write time to RTC if it looks reasonable
+ if (1900 + sys_time->tm_year >= 2019){
+ pthread_mutex_lock(&usb_lock);
+ libusb_control_transfer(dev_handle, 0x40, 0xa1, (uint16_t)(1900 + sys_time->tm_year), 0, NULL, 0, TIMEOUT);
+ libusb_control_transfer(dev_handle, 0x40, 0xa2, (uint16_t)(1 + sys_time->tm_mon), 0, NULL, 0, TIMEOUT);
+ libusb_control_transfer(dev_handle, 0x40, 0xa3, (uint16_t)sys_time->tm_mday, 0, NULL, 0, TIMEOUT);
+ // libusb_control_transfer(dev_handle, 0x40, 0xa4, (uint16_t)(1 + sys_time->tm_wday), 0, NULL, 0, TIMEOUT);
+ libusb_control_transfer(dev_handle, 0x40, 0xa5, (uint16_t)sys_time->tm_hour, 0, NULL, 0, TIMEOUT);
+ libusb_control_transfer(dev_handle, 0x40, 0xa6, (uint16_t)sys_time->tm_min, 0, NULL, 0, TIMEOUT);
+ libusb_control_transfer(dev_handle, 0x40, 0xa7, (uint16_t)sys_time->tm_sec, 0, NULL, 0, TIMEOUT);
+ pthread_mutex_unlock(&usb_lock);
+ }
+ }
+
+ ignition_last = ignition;
// create message
capnp::MallocMessageBuilder msg;
@@ -336,10 +421,11 @@ void can_health(void *s) {
healthData.setVoltage(health.voltage);
healthData.setCurrent(health.current);
if (spoofing_started) {
- healthData.setStarted(1);
+ healthData.setIgnitionLine(1);
} else {
- healthData.setStarted(health.started);
+ healthData.setIgnitionLine(health.ignition_line);
}
+ healthData.setIgnitionCan(health.ignition_can);
healthData.setControlsAllowed(health.controls_allowed);
healthData.setGasInterceptorDetected(health.gas_interceptor_detected);
healthData.setHasGps(is_pigeon);
@@ -348,11 +434,13 @@ void can_health(void *s) {
healthData.setGmlanSendErrs(health.gmlan_send_errs);
healthData.setHwType(hw_type);
healthData.setUsbPowerMode(cereal::HealthData::UsbPowerMode(health.usb_power_mode));
+ healthData.setSafetyModel(cereal::CarParams::SafetyModel(health.safety_model));
+ healthData.setFanSpeedRpm(fan_speed_rpm);
// send to health
auto words = capnp::messageToFlatArray(msg);
auto bytes = words.asBytes();
- zmq_send(s, bytes.begin(), bytes.size(), 0);
+ publisher->send((char*)bytes.begin(), bytes.size());
pthread_mutex_lock(&usb_lock);
@@ -363,24 +451,20 @@ void can_health(void *s) {
}
-void can_send(void *s) {
+void can_send(SubSocket *subscriber) {
int err;
// recv from sendcan
- zmq_msg_t msg;
- zmq_msg_init(&msg);
- err = zmq_msg_recv(&msg, s, 0);
- assert(err >= 0);
+ Message * msg = subscriber->receive();
- // format for board, make copy due to alignment issues, will be freed on out of scope
- auto amsg = kj::heapArray((zmq_msg_size(&msg) / sizeof(capnp::word)) + 1);
- memcpy(amsg.begin(), zmq_msg_data(&msg), zmq_msg_size(&msg));
+ auto amsg = kj::heapArray((msg->getSize() / sizeof(capnp::word)) + 1);
+ memcpy(amsg.begin(), msg->getData(), msg->getSize());
capnp::FlatArrayMessageReader cmsg(amsg);
cereal::Event::Reader event = cmsg.getRoot();
if (nanos_since_boot() - event.getLogMonoTime() > 1e9) {
//Older than 1 second. Dont send.
- zmq_msg_close(&msg);
+ delete msg;
return;
}
int msg_count = event.getCan().size();
@@ -403,7 +487,7 @@ void can_send(void *s) {
}
// release msg
- zmq_msg_close(&msg);
+ delete msg;
// send to board
int sent;
@@ -428,15 +512,17 @@ void *can_send_thread(void *crap) {
LOGD("start send thread");
// sendcan = 8017
- void *context = zmq_ctx_new();
- void *subscriber = sub_sock(context, "tcp://127.0.0.1:8017");
+ Context * context = Context::create();
+ SubSocket * subscriber = SubSocket::create(context, "sendcan");
+
// drain sendcan to delete any stale messages from previous runs
- zmq_msg_t msg;
- zmq_msg_init(&msg);
- int err = 0;
- while(err >= 0) {
- err = zmq_msg_recv(&msg, subscriber, ZMQ_DONTWAIT);
+ while (true){
+ Message * msg = subscriber->receive(true);
+ if (msg == NULL){
+ break;
+ }
+ delete msg;
}
// run as fast as messages come in
@@ -450,9 +536,8 @@ void *can_recv_thread(void *crap) {
LOGD("start recv thread");
// can = 8006
- void *context = zmq_ctx_new();
- void *publisher = zmq_socket(context, ZMQ_PUB);
- zmq_bind(publisher, "tcp://*:8006");
+ Context * c = Context::create();
+ PubSocket * publisher = PubSocket::create(c, "can");
// run at 100hz
const uint64_t dt = 10000000ULL;
@@ -479,9 +564,8 @@ void *can_recv_thread(void *crap) {
void *can_health_thread(void *crap) {
LOGD("start health thread");
// health = 8011
- void *context = zmq_ctx_new();
- void *publisher = zmq_socket(context, ZMQ_PUB);
- zmq_bind(publisher, "tcp://*:8011");
+ Context * c = Context::create();
+ PubSocket * publisher = PubSocket::create(c, "health");
// run at 2hz
while (!do_exit) {
@@ -491,6 +575,69 @@ void *can_health_thread(void *crap) {
return NULL;
}
+void *hardware_control_thread(void *crap) {
+ LOGD("start hardware control thread");
+ Context * c = Context::create();
+ SubSocket * thermal_sock = SubSocket::create(c, "thermal");
+ SubSocket * driver_monitoring_sock = SubSocket::create(c, "driverMonitoring");
+
+ Poller * poller = Poller::create({thermal_sock, driver_monitoring_sock});
+
+ // Wait for hardware type to be set.
+ while (hw_type == cereal::HealthData::HwType::UNKNOWN){
+ usleep(100*1000);
+ }
+ // Only control fan speed on UNO
+ if (hw_type != cereal::HealthData::HwType::UNO) return NULL;
+
+
+ uint16_t prev_fan_speed = 999;
+ uint16_t prev_ir_pwr = 999;
+
+ while (!do_exit) {
+ for (auto sock : poller->poll(1000)){
+ Message * msg = sock->receive();
+ if (msg == NULL) continue;
+
+ auto amsg = kj::heapArray((msg->getSize() / sizeof(capnp::word)) + 1);
+ memcpy(amsg.begin(), msg->getData(), msg->getSize());
+
+ delete msg;
+
+ capnp::FlatArrayMessageReader cmsg(amsg);
+ cereal::Event::Reader event = cmsg.getRoot();
+
+ auto type = event.which();
+ if(type == cereal::Event::THERMAL){
+ uint16_t fan_speed = event.getThermal().getFanSpeed();
+ if (fan_speed != prev_fan_speed){
+ pthread_mutex_lock(&usb_lock);
+ libusb_control_transfer(dev_handle, 0x40, 0xb1, fan_speed, 0, NULL, 0, TIMEOUT);
+ pthread_mutex_unlock(&usb_lock);
+
+ prev_fan_speed = fan_speed;
+ }
+ } else if (type == cereal::Event::DRIVER_MONITORING){
+ uint16_t ir_pwr = 100.0 * event.getDriverMonitoring().getIrPwr();
+
+ if (ir_pwr != prev_ir_pwr){
+ pthread_mutex_lock(&usb_lock);
+ libusb_control_transfer(dev_handle, 0x40, 0xb0, ir_pwr, 0, NULL, 0, TIMEOUT);
+ pthread_mutex_unlock(&usb_lock);
+
+ prev_ir_pwr = ir_pwr;
+ }
+ }
+ }
+ }
+
+ delete poller;
+ delete thermal_sock;
+ delete c;
+
+ return NULL;
+}
+
#define pigeon_send(x) _pigeon_send(x, sizeof(x)-1)
void hexdump(unsigned char *d, int l) {
@@ -582,7 +729,7 @@ void pigeon_init() {
LOGW("panda GPS on");
}
-static void pigeon_publish_raw(void *publisher, unsigned char *dat, int alen) {
+static void pigeon_publish_raw(PubSocket *publisher, unsigned char *dat, int alen) {
// create message
capnp::MallocMessageBuilder msg;
cereal::Event::Builder event = msg.initRoot();
@@ -593,15 +740,14 @@ static void pigeon_publish_raw(void *publisher, unsigned char *dat, int alen) {
// send to ubloxRaw
auto words = capnp::messageToFlatArray(msg);
auto bytes = words.asBytes();
- zmq_send(publisher, bytes.begin(), bytes.size(), 0);
+ publisher->send((char*)bytes.begin(), bytes.size());
}
void *pigeon_thread(void *crap) {
// ubloxRaw = 8042
- void *context = zmq_ctx_new();
- void *publisher = zmq_socket(context, ZMQ_PUB);
- zmq_bind(publisher, "tcp://*:8042");
+ Context * context = Context::create();
+ PubSocket * publisher = PubSocket::create(context, "ubloxRaw");
// run at ~100hz
unsigned char dat[0x1000];
@@ -695,6 +841,11 @@ int main() {
can_recv_thread, NULL);
assert(err == 0);
+ pthread_t hardware_control_thread_handle;
+ err = pthread_create(&hardware_control_thread_handle, NULL,
+ hardware_control_thread, NULL);
+ assert(err == 0);
+
// join threads
err = pthread_join(can_recv_thread_handle, NULL);
diff --git a/selfdrive/boardd/tests/boardd_old.py b/selfdrive/boardd/tests/boardd_old.py
index 3f5ad7cf6c..f963004423 100755
--- a/selfdrive/boardd/tests/boardd_old.py
+++ b/selfdrive/boardd/tests/boardd_old.py
@@ -12,7 +12,6 @@ import time
import selfdrive.messaging as messaging
from common.realtime import Ratekeeper
-from selfdrive.services import service_list
from selfdrive.swaglog import cloudlog
from selfdrive.boardd.boardd import can_capnp_to_can_list
from cereal import car
@@ -46,13 +45,13 @@ def can_list_to_can_capnp(can_msgs, msgtype='can'):
def can_health():
while 1:
try:
- dat = handle.controlRead(usb1.TYPE_VENDOR | usb1.RECIPIENT_DEVICE, 0xd2, 0, 0, 0x10)
+ dat = handle.controlRead(usb1.TYPE_VENDOR | usb1.RECIPIENT_DEVICE, 0xd2, 0, 0, 0x16)
break
except (USBErrorIO, USBErrorOverflow):
cloudlog.exception("CAN: BAD HEALTH, RETRYING")
- v, i, started = struct.unpack("IIB", dat[0:9])
- # TODO: units
- return {"voltage": v, "current": i, "started": bool(started)}
+ v, i = struct.unpack("II", dat[0:8])
+ ign_line, ign_can = struct.unpack("BB", dat[20:22])
+ return {"voltage": v, "current": i, "ignition_line": bool(ign_line), "ignition_can": bool(ign_can)}
def __parse_can_buffer(dat):
ret = []
@@ -111,8 +110,8 @@ def boardd_mock_loop():
can_init()
handle.controlWrite(0x40, 0xdc, SafetyModel.allOutput, 0, b'')
- logcan = messaging.sub_sock(service_list['can'].port)
- sendcan = messaging.pub_sock(service_list['sendcan'].port)
+ logcan = messaging.sub_sock('can')
+ sendcan = messaging.pub_sock('sendcan')
while 1:
tsc = messaging.drain_sock(logcan, wait_for_one=True)
@@ -150,24 +149,24 @@ def boardd_test_loop():
cnt += 1
# *** main loop ***
-def boardd_loop(rate=200):
+def boardd_loop(rate=100):
rk = Ratekeeper(rate)
can_init()
# *** publishes can and health
- logcan = messaging.pub_sock(service_list['can'].port)
- health_sock = messaging.pub_sock(service_list['health'].port)
+ logcan = messaging.pub_sock('can')
+ health_sock = messaging.pub_sock('health')
# *** subscribes to can send
- sendcan = messaging.sub_sock(service_list['sendcan'].port)
+ sendcan = messaging.sub_sock('sendcan')
# drain sendcan to delete any stale messages from previous runs
messaging.drain_sock(sendcan)
while 1:
- # health packet @ 1hz
- if (rk.frame%rate) == 0:
+ # health packet @ 2hz
+ if (rk.frame % (rate // 2)) == 0:
health = can_health()
msg = messaging.new_message()
msg.init('health')
@@ -175,7 +174,8 @@ def boardd_loop(rate=200):
# store the health to be logged
msg.health.voltage = health['voltage']
msg.health.current = health['current']
- msg.health.started = health['started']
+ msg.health.ignitionLine = health['ignition_line']
+ msg.health.ignitionCan = health['ignition_can']
msg.health.controlsAllowed = True
health_sock.send(msg.to_bytes())
@@ -197,15 +197,15 @@ def boardd_loop(rate=200):
rk.keep_time()
# *** main loop ***
-def boardd_proxy_loop(rate=200, address="192.168.2.251"):
+def boardd_proxy_loop(rate=100, address="192.168.2.251"):
rk = Ratekeeper(rate)
can_init()
# *** subscribes can
- logcan = messaging.sub_sock(service_list['can'].port, addr=address)
+ logcan = messaging.sub_sock('can', addr=address)
# *** publishes to can send
- sendcan = messaging.pub_sock(service_list['sendcan'].port)
+ sendcan = messaging.pub_sock('sendcan')
# drain sendcan to delete any stale messages from previous runs
messaging.drain_sock(sendcan)
diff --git a/selfdrive/boardd/tests/replay_many.py b/selfdrive/boardd/tests/replay_many.py
index 548ec6549a..cd94806a87 100755
--- a/selfdrive/boardd/tests/replay_many.py
+++ b/selfdrive/boardd/tests/replay_many.py
@@ -2,34 +2,37 @@
import sys
import time
import signal
+import traceback
from panda import Panda
from multiprocessing import Pool
import selfdrive.messaging as messaging
-from selfdrive.services import service_list
from selfdrive.boardd.boardd import can_capnp_to_can_list
def initializer():
- """Ignore CTRL+C in the worker process.
- source: https://stackoverflow.com/a/44869451 """
- signal.signal(signal.SIGINT, signal.SIG_IGN)
+ """Ignore CTRL+C in the worker process.
+ source: https://stackoverflow.com/a/44869451 """
+ signal.signal(signal.SIGINT, signal.SIG_IGN)
def send_thread(serial):
- panda = Panda(serial)
- panda.set_safety_mode(Panda.SAFETY_ALLOUTPUT)
- panda.set_can_loopback(False)
-
- can_sock = messaging.sub_sock(service_list['can'].port)
-
- while True:
- # Send messages one bus 0 and 1
- tsc = messaging.recv_one(can_sock)
- snd = can_capnp_to_can_list(tsc.can)
- snd = filter(lambda x: x[-1] <= 2, snd)
- panda.can_send_many(snd)
-
- # Drain panda message buffer
- panda.can_recv()
+ try:
+ panda = Panda(serial)
+ panda.set_safety_mode(Panda.SAFETY_ALLOUTPUT)
+ panda.set_can_loopback(False)
+
+ can_sock = messaging.sub_sock('can')
+
+ while True:
+ # Send messages one bus 0 and 1
+ tsc = messaging.recv_one(can_sock)
+ snd = can_capnp_to_can_list(tsc.can)
+ snd = list(filter(lambda x: x[-1] <= 2, snd))
+ panda.can_send_many(snd)
+
+ # Drain panda message buffer
+ panda.can_recv()
+ except Exception:
+ traceback.print_exc()
if __name__ == "__main__":
diff --git a/selfdrive/boardd/tests/test_boardd_loopback.py b/selfdrive/boardd/tests/test_boardd_loopback.py
index c3992bdac4..fefb3bf254 100755
--- a/selfdrive/boardd/tests/test_boardd_loopback.py
+++ b/selfdrive/boardd/tests/test_boardd_loopback.py
@@ -7,7 +7,6 @@ import time
from selfdrive.boardd.boardd import can_list_to_can_capnp
from selfdrive.messaging import drain_sock, pub_sock, sub_sock
-from selfdrive.services import service_list
def get_test_string():
return b"test"+os.urandom(10)
@@ -15,8 +14,8 @@ def get_test_string():
BUS = 0
def main():
- rcv = sub_sock(service_list['can'].port) # port 8006
- snd = pub_sock(service_list['sendcan'].port) # port 8017
+ rcv = sub_sock('can') # port 8006
+ snd = pub_sock('sendcan') # port 8017
time.sleep(0.3) # wait to bind before send/recv
for i in range(10):
diff --git a/selfdrive/can/Makefile b/selfdrive/can/Makefile
index 85d2c494a9..cc1175b8c1 100644
--- a/selfdrive/can/Makefile
+++ b/selfdrive/can/Makefile
@@ -23,17 +23,6 @@ CFLAGS += -mcpu=cortex-a57
CXXFLAGS += -mcpu=cortex-a57
endif
-ifeq ($(UNAME_S),Darwin)
- ZMQ_LIBS = -L/usr/local/lib -lzmq
-else ifeq ($(OPTEST),1)
- ZMQ_LIBS = -lzmq
-else ifeq ($(UNAME_M),x86_64)
- ZMQ_FLAGS = -I$(PHONELIBS)/zmq/x64/include
- ZMQ_LIBS = -L$(PHONELIBS)/zmq/x64/lib -l:libzmq.a
-else ifeq ($(UNAME_M),aarch64)
- ZMQ_LIBS = -l:libzmq.a -lgnustl_shared
-endif
-
OBJDIR = obj
OPENDBC_PATH := $(shell python3 -c 'import opendbc; print(opendbc.DBC_PATH)')
@@ -43,7 +32,7 @@ DBC_OBJS := $(patsubst $(OPENDBC_PATH)/%.dbc,$(OBJDIR)/%.o,$(DBC_SOURCES))
DBC_CCS := $(patsubst $(OPENDBC_PATH)/%.dbc,dbc_out/%.cc,$(DBC_SOURCES))
.SECONDARY: $(DBC_CCS)
-LIBDBC_OBJS := $(OBJDIR)/dbc.o $(OBJDIR)/parser.o $(OBJDIR)/packer.o
+LIBDBC_OBJS := $(OBJDIR)/dbc.o $(OBJDIR)/parser.o $(OBJDIR)/packer.o $(OBJDIR)/common.o
CWD := $(shell pwd)
@@ -64,8 +53,6 @@ libdbc.so:: $(LIBDBC_OBJS) $(DBC_OBJS)
-I. -I../.. \
$(CXXFLAGS) \
$(LDFLAGS) \
- $(ZMQ_FLAGS) \
- $(ZMQ_LIBS) \
$(CEREAL_CXXFLAGS) \
$(CEREAL_LIBS)
@@ -74,8 +61,8 @@ packer_impl.so: packer_impl.pyx packer_setup.py
rm -rf build
rm -f packer_impl.cpp
-parser_pyx.so: parser_pyx_setup.py parser_pyx.pyx parser_pyx.pxd
- python3 $< build_ext --inplace
+parser_pyx.so: libdbc.so parser_pyx_setup.py parser_pyx.pyx common.pxd
+ python3 parser_pyx_setup.py build_ext --inplace
rm -rf build
rm -f parser_pyx.cpp
@@ -84,7 +71,6 @@ $(OBJDIR)/%.o: %.cc
$(CXX) -fPIC -c -o '$@' $^ \
-I. -I../.. \
$(CXXFLAGS) \
- $(ZMQ_FLAGS) \
$(CEREAL_CXXFLAGS) \
$(OBJDIR)/%.o: dbc_out/%.cc
@@ -92,13 +78,11 @@ $(OBJDIR)/%.o: dbc_out/%.cc
$(CXX) -fPIC -c -o '$@' $^ \
-I. -I../.. \
$(CXXFLAGS) \
- $(ZMQ_FLAGS) \
$(CEREAL_CXXFLAGS) \
dbc_out/%.cc: process_dbc.py dbc_template.cc $(OPENDBC_PATH)/%.dbc
@echo "[ DBC GEN ] $@"
- @echo "Missing prereq $?"
- ./process_dbc.py $(OPENDBC_PATH) dbc_out
+ ./process_dbc.py $(OPENDBC_PATH) '$@'
$(OBJDIR):
mkdir -p $@
@@ -109,4 +93,5 @@ clean:
rm -f dbc_out/*.cc
rm -f dbcs.txt
rm -f dbcs.csv
+ rm -f *.so
rm -rf $(OBJDIR)/*
diff --git a/selfdrive/can/common.cc b/selfdrive/can/common.cc
new file mode 100644
index 0000000000..5a131eb6c7
--- /dev/null
+++ b/selfdrive/can/common.cc
@@ -0,0 +1,165 @@
+#include "common.h"
+
+unsigned int honda_checksum(unsigned int address, uint64_t d, int l) {
+ d >>= ((8-l)*8); // remove padding
+ d >>= 4; // remove checksum
+
+ int s = 0;
+ while (address) { s += (address & 0xF); address >>= 4; }
+ while (d) { s += (d & 0xF); d >>= 4; }
+ s = 8-s;
+ s &= 0xF;
+
+ return s;
+}
+
+unsigned int toyota_checksum(unsigned int address, uint64_t d, int l) {
+ d >>= ((8-l)*8); // remove padding
+ d >>= 8; // remove checksum
+
+ unsigned int s = l;
+ while (address) { s += address & 0xff; address >>= 8; }
+ while (d) { s += d & 0xff; d >>= 8; }
+
+ return s & 0xFF;
+}
+
+// Static lookup table for fast computation of CRC8 poly 0x2F, aka 8H2F/AUTOSAR
+uint8_t crc8_lut_8h2f[256];
+
+void gen_crc_lookup_table(uint8_t poly, uint8_t crc_lut[]) {
+ uint8_t crc;
+ int i, j;
+
+ for (i = 0; i < 256; i++) {
+ crc = i;
+ for (j = 0; j < 8; j++) {
+ if ((crc & 0x80) != 0)
+ crc = (uint8_t)((crc << 1) ^ poly);
+ else
+ crc <<= 1;
+ }
+ crc_lut[i] = crc;
+ }
+}
+
+void init_crc_lookup_tables() {
+ // At init time, set up static lookup tables for fast CRC computation.
+
+ gen_crc_lookup_table(0x2F, crc8_lut_8h2f); // CRC-8 8H2F/AUTOSAR for Volkswagen
+}
+
+unsigned int volkswagen_crc(unsigned int address, uint64_t d, int l) {
+ // Volkswagen uses standard CRC8 8H2F/AUTOSAR, but they compute it with
+ // a magic variable padding byte tacked onto the end of the payload.
+ // https://www.autosar.org/fileadmin/user_upload/standards/classic/4-3/AUTOSAR_SWS_CRCLibrary.pdf
+
+ uint8_t *dat = (uint8_t *)&d;
+ uint8_t crc = 0xFF; // Standard init value for CRC8 8H2F/AUTOSAR
+
+ // CRC the payload first, skipping over the first byte where the CRC lives.
+ for (int i = 1; i < l; i++) {
+ crc ^= dat[i];
+ crc = crc8_lut_8h2f[crc];
+ }
+
+ // Look up and apply the magic final CRC padding byte, which permutes by CAN
+ // address, and additionally (for SOME addresses) by the message counter.
+ uint8_t counter = dat[1] & 0x0F;
+ switch(address) {
+ case 0x86: // LWI_01 Steering Angle
+ crc ^= (uint8_t[]){0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86}[counter];
+ break;
+ case 0x9F: // EPS_01 Electric Power Steering
+ crc ^= (uint8_t[]){0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5}[counter];
+ break;
+ case 0xAD: // Getriebe_11 Automatic Gearbox
+ crc ^= (uint8_t[]){0x3F,0x69,0x39,0xDC,0x94,0xF9,0x14,0x64,0xD8,0x6A,0x34,0xCE,0xA2,0x55,0xB5,0x2C}[counter];
+ break;
+ case 0xFD: // ESP_21 Electronic Stability Program
+ crc ^= (uint8_t[]){0xB4,0xEF,0xF8,0x49,0x1E,0xE5,0xC2,0xC0,0x97,0x19,0x3C,0xC9,0xF1,0x98,0xD6,0x61}[counter];
+ break;
+ case 0x106: // ESP_05 Electronic Stability Program
+ crc ^= (uint8_t[]){0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07}[counter];
+ break;
+ case 0x117: // ACC_10 Automatic Cruise Control
+ crc ^= (uint8_t[]){0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC}[counter];
+ break;
+ case 0x122: // ACC_06 Automatic Cruise Control
+ crc ^= (uint8_t[]){0x37,0x7D,0xF3,0xA9,0x18,0x46,0x6D,0x4D,0x3D,0x71,0x92,0x9C,0xE5,0x32,0x10,0xB9}[counter];
+ break;
+ case 0x126: // HCA_01 Heading Control Assist
+ crc ^= (uint8_t[]){0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA}[counter];
+ break;
+ case 0x12B: // GRA_ACC_01 Steering wheel controls for ACC
+ crc ^= (uint8_t[]){0x6A,0x38,0xB4,0x27,0x22,0xEF,0xE1,0xBB,0xF8,0x80,0x84,0x49,0xC7,0x9E,0x1E,0x2B}[counter];
+ break;
+ case 0x187: // EV_Gearshift "Gear" selection data for EVs with no gearbox
+ crc ^= (uint8_t[]){0x7F,0xED,0x17,0xC2,0x7C,0xEB,0x44,0x21,0x01,0xFA,0xDB,0x15,0x4A,0x6B,0x23,0x05}[counter];
+ break;
+ case 0x30C: // ACC_02 Automatic Cruise Control
+ crc ^= (uint8_t[]){0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F}[counter];
+ break;
+ case 0x3C0: // Klemmen_Status_01 ignition and starting status
+ crc ^= (uint8_t[]){0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3}[counter];
+ break;
+ case 0x65D: // ESP_20 Electronic Stability Program
+ crc ^= (uint8_t[]){0xAC,0xB3,0xAB,0xEB,0x7A,0xE1,0x3B,0xF7,0x73,0xBA,0x7C,0x9E,0x06,0x5F,0x02,0xD9}[counter];
+ break;
+ default: // As-yet undefined CAN message, CRC check expected to fail
+ printf("Attempt to CRC check undefined Volkswagen message 0x%02X\n", address);
+ crc ^= (uint8_t[]){0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}[counter];
+ break;
+ }
+ crc = crc8_lut_8h2f[crc];
+
+ return crc ^ 0xFF; // Return after standard final XOR for CRC8 8H2F/AUTOSAR
+}
+
+
+unsigned int pedal_checksum(uint64_t d, int l) {
+ uint8_t crc = 0xFF;
+ uint8_t poly = 0xD5; // standard crc8
+
+ d >>= ((8-l)*8); // remove padding
+ d >>= 8; // remove checksum
+
+ uint8_t *dat = (uint8_t *)&d;
+
+ int i, j;
+ for (i = 0; i < l - 1; i++) {
+ crc ^= dat[i];
+ for (j = 0; j < 8; j++) {
+ if ((crc & 0x80) != 0) {
+ crc = (uint8_t)((crc << 1) ^ poly);
+ }
+ else {
+ crc <<= 1;
+ }
+ }
+ }
+ return crc;
+}
+
+
+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]);
+}
+
+uint64_t read_u64_le(const uint8_t* v) {
+ return ((uint64_t)v[0]
+ | ((uint64_t)v[1] << 8)
+ | ((uint64_t)v[2] << 16)
+ | ((uint64_t)v[3] << 24)
+ | ((uint64_t)v[4] << 32)
+ | ((uint64_t)v[5] << 40)
+ | ((uint64_t)v[6] << 48)
+ | ((uint64_t)v[7] << 56));
+}
diff --git a/selfdrive/can/common.h b/selfdrive/can/common.h
index d6c2e4760b..2ec2507585 100644
--- a/selfdrive/can/common.h
+++ b/selfdrive/can/common.h
@@ -4,22 +4,29 @@
#include
#include
#include
+#include
+#include
+#include
+#include "cereal/gen/cpp/log.capnp.h"
+
+#define MAX_BAD_COUNTER 5
#define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
+// Helper functions
unsigned int honda_checksum(unsigned int address, uint64_t d, int l);
unsigned int toyota_checksum(unsigned int address, uint64_t d, int l);
-unsigned int pedal_checksum(unsigned int address, uint64_t d, int l);
-
void init_crc_lookup_tables();
unsigned int volkswagen_crc(unsigned int address, uint64_t d, int l);
+unsigned int pedal_checksum(uint64_t d, int l);
+uint64_t read_u64_be(const uint8_t* v);
+uint64_t read_u64_le(const uint8_t* v);
struct SignalPackValue {
const char* name;
double value;
};
-
struct SignalParseOptions {
uint32_t address;
const char* name;
@@ -82,6 +89,50 @@ struct DBC {
size_t num_vals;
};
+
+class MessageState {
+public:
+ uint32_t address;
+ unsigned int size;
+
+ std::vector parse_sigs;
+ std::vector vals;
+
+ uint16_t ts;
+ uint64_t seen;
+ uint64_t check_threshold;
+
+ uint8_t counter;
+ uint8_t counter_fail;
+
+ bool parse(uint64_t sec, uint16_t ts_, uint8_t * dat);
+ bool update_counter_generic(int64_t v, int cnt_size);
+};
+
+class CANParser {
+private:
+ const int bus;
+
+ const DBC *dbc = NULL;
+ std::unordered_map message_states;
+
+public:
+ bool can_valid = false;
+ uint64_t last_sec = 0;
+
+ CANParser(int abus, const std::string& dbc_name,
+ const std::vector &options,
+ const std::vector &sigoptions);
+ void UpdateCans(uint64_t sec, const capnp::List::Reader& cans);
+ void UpdateValid(uint64_t sec);
+ void update_string(std::string data);
+ std::vector query_latest();
+
+};
+
+
+
+
const DBC* dbc_lookup(const std::string& dbc_name);
void dbc_register(const DBC* dbc);
diff --git a/selfdrive/can/common.pxd b/selfdrive/can/common.pxd
new file mode 100644
index 0000000000..54c6e444fd
--- /dev/null
+++ b/selfdrive/can/common.pxd
@@ -0,0 +1,71 @@
+# distutils: language = c++
+#cython: language_level=3
+
+from libc.stdint cimport uint32_t, uint64_t, uint16_t
+from libcpp.vector cimport vector
+from libcpp.map cimport map
+from libcpp.string cimport string
+from libcpp.unordered_set cimport unordered_set
+from libcpp cimport bool
+
+
+cdef extern from "common.h":
+
+ ctypedef enum SignalType:
+ DEFAULT,
+ HONDA_CHECKSUM,
+ HONDA_COUNTER,
+ TOYOTA_CHECKSUM,
+ PEDAL_CHECKSUM,
+ PEDAL_COUNTER
+
+ cdef struct Signal:
+ const char* name
+ int b1, b2, bo
+ bool is_signed
+ double factor, offset
+ SignalType type
+
+ cdef struct Msg:
+ const char* name
+ uint32_t address
+ unsigned int size
+ size_t num_sigs
+ const Signal *sigs
+
+ cdef struct Val:
+ const char* name
+ uint32_t address
+ const char* def_val
+ const Signal *sigs
+
+ cdef struct DBC:
+ const char* name
+ size_t num_msgs
+ const Msg *msgs
+ const Val *vals
+ size_t num_vals
+
+ cdef struct SignalParseOptions:
+ uint32_t address
+ const char* name
+ double default_value
+
+
+ cdef struct MessageParseOptions:
+ uint32_t address
+ int check_frequency
+
+ cdef struct SignalValue:
+ uint32_t address
+ uint16_t ts
+ const char* name
+ double value
+
+ cdef const DBC* dbc_lookup(const string);
+
+ cdef cppclass CANParser:
+ bool can_valid
+ CANParser(int, string, vector[MessageParseOptions], vector[SignalParseOptions])
+ void update_string(string)
+ vector[SignalValue] query_latest()
diff --git a/selfdrive/can/dbc_template.cc b/selfdrive/can/dbc_template.cc
index be249012e3..52351aef2f 100644
--- a/selfdrive/can/dbc_template.cc
+++ b/selfdrive/can/dbc_template.cc
@@ -27,14 +27,14 @@ const Signal sigs_{{address}}[] = {
.type = SignalType::HONDA_COUNTER,
{% elif checksum_type == "toyota" and sig.name == "CHECKSUM" %}
.type = SignalType::TOYOTA_CHECKSUM,
+ {% elif checksum_type == "volkswagen" and sig.name == "CHECKSUM" %}
+ .type = SignalType::VOLKSWAGEN_CHECKSUM,
+ {% elif checksum_type == "volkswagen" and sig.name == "COUNTER" %}
+ .type = SignalType::VOLKSWAGEN_COUNTER,
{% elif address in [512, 513] and sig.name == "CHECKSUM_PEDAL" %}
.type = SignalType::PEDAL_CHECKSUM,
{% elif address in [512, 513] and sig.name == "COUNTER_PEDAL" %}
.type = SignalType::PEDAL_COUNTER,
- {% elif checksum_type == "volkswagen" and sig.name == "CHECKSUM" %}
- .type = SignalType::VOLKSWAGEN_CHECKSUM,
- {% elif checksum_type == "volkswagen" and sig.name == "COUNTER" %}
- .type = SignalType::VOLKSWAGEN_COUNTER,
{% else %}
.type = SignalType::DEFAULT,
{% endif %}
diff --git a/selfdrive/can/libdbc_py.py b/selfdrive/can/libdbc_py.py
index 36713eab0f..92093f9316 100644
--- a/selfdrive/can/libdbc_py.py
+++ b/selfdrive/can/libdbc_py.py
@@ -5,7 +5,7 @@ from cffi import FFI
can_dir = os.path.dirname(os.path.abspath(__file__))
libdbc_fn = os.path.join(can_dir, "libdbc.so")
-subprocess.check_call(["make"], cwd=can_dir)
+subprocess.check_call(["make", "-j3"], cwd=can_dir) # don't use all the cores to avoid overheating
ffi = FFI()
ffi.cdef("""
@@ -79,10 +79,9 @@ typedef struct {
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, bool sendcan,
- const char* tcp_addr, int timeout);
+ size_t num_signal_options, const SignalParseOptions* signal_options);
-int can_update(void* can, uint64_t sec, bool wait);
+void can_update_string(void *can, const char* dat, int len);
size_t can_query_latest(void* can, bool *out_can_valid, size_t out_values_size, SignalValue* out_values);
diff --git a/selfdrive/can/packer.cc b/selfdrive/can/packer.cc
index 88fca77da0..f6da562a7a 100644
--- a/selfdrive/can/packer.cc
+++ b/selfdrive/can/packer.cc
@@ -51,7 +51,6 @@ namespace {
signal_lookup[std::make_pair(msg->address, std::string(sig->name))] = *sig;
}
}
-
init_crc_lookup_tables();
}
@@ -97,12 +96,10 @@ namespace {
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) {
+ } 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 if (sig.type == SignalType::VOLKSWAGEN_CHECKSUM) {
+ } else if (sig.type == SignalType::VOLKSWAGEN_CHECKSUM) {
// FIXME: Hackish fix for an endianness issue. The message is in reverse byte order
// until later in the pack process. Checksums can be run backwards, CRCs not so much.
// The correct fix is unclear but this works for the moment.
@@ -117,7 +114,6 @@ namespace {
}
-
private:
const DBC *dbc = NULL;
std::map, Signal> signal_lookup;
diff --git a/selfdrive/can/packer.py b/selfdrive/can/packer.py
index 81a8c34270..ccb537c956 100644
--- a/selfdrive/can/packer.py
+++ b/selfdrive/can/packer.py
@@ -3,7 +3,7 @@ import os
import subprocess
can_dir = os.path.dirname(os.path.abspath(__file__))
-subprocess.check_call(["make", "packer_impl.so"], cwd=can_dir)
+subprocess.check_call(["make", "-j3", "packer_impl.so"], cwd=can_dir) # don't use all the cores to avoid overheating
from selfdrive.can.packer_impl import CANPacker
assert CANPacker
diff --git a/selfdrive/can/parser.cc b/selfdrive/can/parser.cc
index f07aab8e56..2df843e213 100644
--- a/selfdrive/can/parser.cc
+++ b/selfdrive/can/parser.cc
@@ -9,11 +9,7 @@
#include
#include
-#include
#include
-#include
-
-#include
#include
#include "cereal/gen/cpp/log.capnp.h"
@@ -24,661 +20,228 @@
// #define DEBUG printf
#define INFO printf
-#define MAX_BAD_COUNTER 5
-
-// Static lookup table for fast computation of CRC8 poly 0x2F, aka 8H2F/AUTOSAR
-uint8_t crc8_lut_8h2f[256];
-
-unsigned int honda_checksum(unsigned int address, uint64_t d, int l) {
- d >>= ((8-l)*8); // remove padding
- d >>= 4; // remove checksum
- int s = 0;
- while (address) { s += (address & 0xF); address >>= 4; }
- while (d) { s += (d & 0xF); d >>= 4; }
- s = 8-s;
- s &= 0xF;
-
- return s;
-}
-
-unsigned int toyota_checksum(unsigned int address, uint64_t d, int l) {
- d >>= ((8-l)*8); // remove padding
- d >>= 8; // remove checksum
-
- unsigned int s = l;
- while (address) { s += address & 0xff; address >>= 8; }
- while (d) { s += d & 0xff; d >>= 8; }
-
- return s & 0xFF;
-}
+bool MessageState::parse(uint64_t sec, uint16_t ts_, uint8_t * dat) {
+ uint64_t dat_le = read_u64_le(dat);
+ uint64_t dat_be = read_u64_be(dat);
-unsigned int pedal_checksum(unsigned int address, uint64_t d, int l) {
- uint8_t crc = 0xFF;
- uint8_t poly = 0xD5; // standard crc8
+ for (int i=0; i < parse_sigs.size(); i++) {
+ auto& sig = parse_sigs[i];
+ int64_t tmp;
- d >>= ((8-l)*8); // remove padding
- d >>= 8; // remove checksum
-
- uint8_t *dat = (uint8_t *)&d;
-
- int i, j;
- for (i = 0; i < l - 1; i++) {
- crc ^= dat[i];
- for (j = 0; j < 8; j++) {
- if ((crc & 0x80) != 0) {
- crc = (uint8_t)((crc << 1) ^ poly);
- }
- else {
- crc <<= 1;
- }
+ if (sig.is_little_endian){
+ tmp = (dat_le >> sig.b1) & ((1ULL << sig.b2)-1);
+ } else {
+ tmp = (dat_be >> sig.bo) & ((1ULL << sig.b2)-1);
}
- }
- return crc;
-}
-void gen_crc_lookup_table(uint8_t poly, uint8_t crc_lut[])
-{
- uint8_t crc;
- int i, j;
-
- for (i = 0; i < 256; i++) {
- crc = i;
- for (j = 0; j < 8; j++) {
- if ((crc & 0x80) != 0)
- crc = (uint8_t)((crc << 1) ^ poly);
- else
- crc <<= 1;
+ if (sig.is_signed) {
+ tmp -= (tmp >> (sig.b2-1)) ? (1ULL << sig.b2) : 0; //signed
}
- crc_lut[i] = crc;
- }
-}
-
-void init_crc_lookup_tables()
-{
- // At init time, set up static lookup tables for fast CRC computation.
-
- gen_crc_lookup_table(0x2F, crc8_lut_8h2f); // CRC-8 8H2F/AUTOSAR for Volkswagen
-}
-
-unsigned int volkswagen_crc(unsigned int address, uint64_t d, int l)
-{
- // Volkswagen uses standard CRC8 8H2F/AUTOSAR, but they compute it with
- // a magic variable padding byte tacked onto the end of the payload.
- // https://www.autosar.org/fileadmin/user_upload/standards/classic/4-3/AUTOSAR_SWS_CRCLibrary.pdf
-
- uint8_t *dat = (uint8_t *)&d;
- uint8_t crc = 0xFF; // Standard init value for CRC8 8H2F/AUTOSAR
-
- // CRC the payload first, skipping over the first byte where the CRC lives.
- for (int i = 1; i < l; i++) {
- crc ^= dat[i];
- crc = crc8_lut_8h2f[crc];
- }
-
- // Look up and apply the magic final CRC padding byte, which permutes by CAN
- // address, and additionally (for SOME addresses) by the message counter.
- uint8_t counter = dat[1] & 0x0F;
- switch(address) {
- case 0x86: // LWI_01 Steering Angle
- crc ^= (uint8_t[]){0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86,0x86}[counter];
- break;
- case 0x9F: // EPS_01 Electric Power Steering
- crc ^= (uint8_t[]){0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5,0xF5}[counter];
- break;
- case 0xAD: // Getriebe_11 Automatic Gearbox
- crc ^= (uint8_t[]){0x3F,0x69,0x39,0xDC,0x94,0xF9,0x14,0x64,0xD8,0x6A,0x34,0xCE,0xA2,0x55,0xB5,0x2C}[counter];
- break;
- case 0xFD: // ESP_21 Electronic Stability Program
- crc ^= (uint8_t[]){0xB4,0xEF,0xF8,0x49,0x1E,0xE5,0xC2,0xC0,0x97,0x19,0x3C,0xC9,0xF1,0x98,0xD6,0x61}[counter];
- break;
- case 0x106: // ESP_05 Electronic Stability Program
- crc ^= (uint8_t[]){0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07}[counter];
- break;
- case 0x117: // ACC_10 Automatic Cruise Control
- crc ^= (uint8_t[]){0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC,0xAC}[counter];
- break;
- case 0x122: // ACC_06 Automatic Cruise Control
- crc ^= (uint8_t[]){0x37,0x7D,0xF3,0xA9,0x18,0x46,0x6D,0x4D,0x3D,0x71,0x92,0x9C,0xE5,0x32,0x10,0xB9}[counter];
- break;
- case 0x126: // HCA_01 Heading Control Assist
- crc ^= (uint8_t[]){0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA,0xDA}[counter];
- break;
- case 0x12B: // GRA_ACC_01 Steering wheel controls for ACC
- crc ^= (uint8_t[]){0x6A,0x38,0xB4,0x27,0x22,0xEF,0xE1,0xBB,0xF8,0x80,0x84,0x49,0xC7,0x9E,0x1E,0x2B}[counter];
- break;
- case 0x187: // EV_Gearshift "Gear" selection data for EVs with no gearbox
- crc ^= (uint8_t[]){0x7F,0xED,0x17,0xC2,0x7C,0xEB,0x44,0x21,0x01,0xFA,0xDB,0x15,0x4A,0x6B,0x23,0x05}[counter];
- break;
- case 0x30C: // ACC_02 Automatic Cruise Control
- crc ^= (uint8_t[]){0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F}[counter];
- break;
- case 0x3C0: // Klemmen_Status_01 ignition and starting status
- crc ^= (uint8_t[]){0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3,0xC3}[counter];
- break;
- case 0x65D: // ESP_20 Electronic Stability Program
- crc ^= (uint8_t[]){0xAC,0xB3,0xAB,0xEB,0x7A,0xE1,0x3B,0xF7,0x73,0xBA,0x7C,0x9E,0x06,0x5F,0x02,0xD9}[counter];
- break;
- default: // As-yet undefined CAN message, CRC check expected to fail
- INFO("Attempt to CRC check undefined Volkswagen message 0x%02X\n", address);
- crc ^= (uint8_t[]){0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}[counter];
- break;
- }
- crc = crc8_lut_8h2f[crc];
-
- return crc ^ 0xFF; // Return after standard final XOR for CRC8 8H2F/AUTOSAR
-}
-
-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]);
-}
-
-uint64_t read_u64_le(const uint8_t* v) {
- return ((uint64_t)v[0]
- | ((uint64_t)v[1] << 8)
- | ((uint64_t)v[2] << 16)
- | ((uint64_t)v[3] << 24)
- | ((uint64_t)v[4] << 32)
- | ((uint64_t)v[5] << 40)
- | ((uint64_t)v[6] << 48)
- | ((uint64_t)v[7] << 56));
-}
-
-struct MessageState {
- uint32_t address;
- unsigned int size;
+ DEBUG("parse 0x%X %s -> %lld\n", address, sig.name, tmp);
- std::vector parse_sigs;
- std::vector vals;
-
- uint16_t ts;
- uint64_t seen;
- uint64_t check_threshold;
-
- uint8_t counter;
- uint8_t counter_fail;
-
- bool parse(uint64_t sec, uint16_t ts_, uint64_t dat) {
- for (int i=0; i < parse_sigs.size(); i++) {
- auto& sig = parse_sigs[i];
- int64_t tmp;
-
- if (sig.is_little_endian){
- tmp = (dat >> sig.b1) & ((1ULL << sig.b2)-1);
- } else {
- tmp = (dat >> sig.bo) & ((1ULL << sig.b2)-1);
+ if (sig.type == SignalType::HONDA_CHECKSUM) {
+ if (honda_checksum(address, dat_be, size) != tmp) {
+ INFO("0x%X CHECKSUM FAIL\n", address);
+ return false;
}
-
- if (sig.is_signed) {
- tmp -= (tmp >> (sig.b2-1)) ? (1ULL << sig.b2) : 0; //signed
+ } else if (sig.type == SignalType::HONDA_COUNTER) {
+ if (!update_counter_generic(tmp, sig.b2)) {
+ return false;
}
-
- DEBUG("parse 0x%X %s -> %lld\n", address, sig.name, tmp);
-
- if (sig.type == SignalType::HONDA_CHECKSUM) {
- if (honda_checksum(address, dat, size) != tmp) {
- INFO("0x%X CHECKSUM FAIL\n", address);
- return false;
- }
- } else if (sig.type == SignalType::HONDA_COUNTER) {
- if (!update_counter_generic(tmp, sig.b2)) {
- return false;
- }
- } else if (sig.type == SignalType::TOYOTA_CHECKSUM) {
- if (toyota_checksum(address, dat, size) != tmp) {
- INFO("0x%X CHECKSUM FAIL\n", address);
- return false;
- }
- } else if (sig.type == SignalType::VOLKSWAGEN_CHECKSUM) {
- if (volkswagen_crc(address, dat, size) != tmp) {
- INFO("0x%X CRC FAIL\n", address);
- return false;
- }
- } else if (sig.type == SignalType::VOLKSWAGEN_COUNTER) {
- if (!update_counter_generic(tmp, sig.b2)) {
- return false;
- }
- } else if (sig.type == SignalType::PEDAL_CHECKSUM) {
- if (pedal_checksum(address, dat, size) != tmp) {
- INFO("0x%X PEDAL CHECKSUM FAIL\n", address);
- return false;
- }
- } else if (sig.type == SignalType::PEDAL_COUNTER) {
+ } else if (sig.type == SignalType::TOYOTA_CHECKSUM) {
+ if (toyota_checksum(address, dat_be, size) != tmp) {
+ INFO("0x%X CHECKSUM FAIL\n", address);
+ return false;
+ }
+ } else if (sig.type == SignalType::VOLKSWAGEN_CHECKSUM) {
+ if (volkswagen_crc(address, dat_le, size) != tmp) {
+ INFO("0x%X CRC FAIL\n", address);
+ return false;
+ }
+ } else if (sig.type == SignalType::VOLKSWAGEN_COUNTER) {
if (!update_counter_generic(tmp, sig.b2)) {
- return false;
- }
+ INFO("0x%X CHECKSUM FAIL\n", address);
+ return false;
}
-
- vals[i] = tmp * sig.factor + sig.offset;
- }
- ts = ts_;
- seen = sec;
-
- return true;
- }
-
-
- bool update_counter_generic(int64_t v, int cnt_size) {
- uint8_t old_counter = counter;
- counter = v;
- if (((old_counter+1) & ((1 << cnt_size) -1)) != v) {
- counter_fail += 1;
- if (counter_fail > 1) {
- INFO("0x%X COUNTER FAIL %d -- %d vs %d\n", address, counter_fail, old_counter, (int)v);
+ } else if (sig.type == SignalType::PEDAL_CHECKSUM) {
+ if (pedal_checksum(dat_be, size) != tmp) {
+ INFO("0x%X PEDAL CHECKSUM FAIL\n", address);
+ return false;
}
- if (counter_fail >= MAX_BAD_COUNTER) {
+ } else if (sig.type == SignalType::PEDAL_COUNTER) {
+ if (!update_counter_generic(tmp, sig.b2)) {
return false;
}
- } else if (counter_fail > 0) {
- counter_fail--;
}
- return true;
+
+ vals[i] = tmp * sig.factor + sig.offset;
}
+ ts = ts_;
+ seen = sec;
-};
+ return true;
+}
-class CANParser {
- public:
- CANParser(int abus, const std::string& dbc_name,
- const std::vector &options,
- const std::vector &sigoptions,
- bool sendcan, const std::string& tcp_addr, int timeout=-1)
- : bus(abus) {
- // connect to can on 8006
- context = zmq_ctx_new();
+bool MessageState::update_counter_generic(int64_t v, int cnt_size) {
+ uint8_t old_counter = counter;
+ counter = v;
+ if (((old_counter+1) & ((1 << cnt_size) -1)) != v) {
+ counter_fail += 1;
+ if (counter_fail > 1) {
+ INFO("%X COUNTER FAIL %d -- %d vs %d\n", address, counter_fail, old_counter, (int)v);
+ }
+ if (counter_fail >= MAX_BAD_COUNTER) {
+ return false;
+ }
+ } else if (counter_fail > 0) {
+ counter_fail--;
+ }
+ return true;
+}
- if (tcp_addr.length() > 0) {
- subscriber = zmq_socket(context, ZMQ_SUB);
- zmq_setsockopt(subscriber, ZMQ_SUBSCRIBE, "", 0);
- zmq_setsockopt(subscriber, ZMQ_RCVTIMEO, &timeout, sizeof(int));
- std::string tcp_addr_str;
+CANParser::CANParser(int abus, const std::string& dbc_name,
+ const std::vector &options,
+ const std::vector &sigoptions)
+ : bus(abus) {
- if (sendcan) {
- tcp_addr_str = "tcp://" + tcp_addr + ":8017";
- } else {
- tcp_addr_str = "tcp://" + tcp_addr + ":8006";
- }
- const char *tcp_addr_char = tcp_addr_str.c_str();
+ dbc = dbc_lookup(dbc_name);
+ assert(dbc);
+ init_crc_lookup_tables();
- zmq_connect(subscriber, tcp_addr_char);
+ for (const auto& op : options) {
+ MessageState state = {
+ .address = op.address,
+ // .check_frequency = op.check_frequency,
+ };
- // drain sendcan to delete any stale messages from previous runs
- zmq_msg_t msgDrain;
- zmq_msg_init(&msgDrain);
- int err = 0;
- while(err >= 0) {
- err = zmq_msg_recv(&msgDrain, subscriber, ZMQ_DONTWAIT);
- }
- } else {
- subscriber = NULL;
+ // msg is not valid if a message isn't received for 10 consecutive steps
+ if (op.check_frequency > 0) {
+ state.check_threshold = (1000000000ULL / op.check_frequency) * 10;
}
- dbc = dbc_lookup(dbc_name);
- assert(dbc);
- init_crc_lookup_tables();
-
- for (const auto& op : options) {
- MessageState state = {
- .address = op.address,
- // .check_frequency = op.check_frequency,
- };
- // msg is not valid if a message isn't received for 10 consecutive steps
- if (op.check_frequency > 0) {
- state.check_threshold = (1000000000ULL / op.check_frequency) * 10;
+ const Msg* msg = NULL;
+ for (int i=0; inum_msgs; i++) {
+ if (dbc->msgs[i].address == op.address) {
+ msg = &dbc->msgs[i];
+ break;
}
+ }
+ if (!msg) {
+ fprintf(stderr, "CANParser: could not find message 0x%X in dnc %s\n", op.address, dbc_name.c_str());
+ assert(false);
+ }
+ state.size = msg->size;
- const Msg* msg = NULL;
- for (int i=0; inum_msgs; i++) {
- if (dbc->msgs[i].address == op.address) {
- msg = &dbc->msgs[i];
- break;
- }
- }
- if (!msg) {
- fprintf(stderr, "CANParser: could not find message 0x%X in dnc %s\n", op.address, dbc_name.c_str());
- assert(false);
+ // track checksums and counters for this message
+ for (int i=0; inum_sigs; i++) {
+ const Signal *sig = &msg->sigs[i];
+ if (sig->type != SignalType::DEFAULT) {
+ state.parse_sigs.push_back(*sig);
+ state.vals.push_back(0);
}
+ }
- state.size = msg->size;
+ // track requested signals for this message
+ for (const auto& sigop : sigoptions) {
+ if (sigop.address != op.address) continue;
- // track checksums and counters for this message
for (int i=0; inum_sigs; i++) {
const Signal *sig = &msg->sigs[i];
- if (sig->type != SignalType::DEFAULT) {
+ if (strcmp(sig->name, sigop.name) == 0
+ && sig->type == SignalType::DEFAULT) {
state.parse_sigs.push_back(*sig);
- state.vals.push_back(0);
- }
- }
-
- // track requested signals for this message
- for (const auto& sigop : sigoptions) {
- if (sigop.address != op.address) continue;
-
- for (int i=0; inum_sigs; i++) {
- const Signal *sig = &msg->sigs[i];
- if (strcmp(sig->name, sigop.name) == 0
- && sig->type == SignalType::DEFAULT) {
- state.parse_sigs.push_back(*sig);
- state.vals.push_back(sigop.default_value);
- break;
- }
- }
-
- }
-
- message_states[state.address] = state;
- }
- }
-
- void UpdateCans(uint64_t sec, const capnp::List::Reader& cans) {
- int msg_count = cans.size();
- uint64_t p;
-
- DEBUG("got %d messages\n", msg_count);
-
- // parse the messages
- for (int i = 0; i < msg_count; i++) {
- auto cmsg = cans[i];
- if (cmsg.getSrc() != bus) {
- // DEBUG("skip %d: wrong bus\n", cmsg.getAddress());
- continue;
- }
- auto state_it = message_states.find(cmsg.getAddress());
- if (state_it == message_states.end()) {
- // DEBUG("skip %d: not specified\n", cmsg.getAddress());
- continue;
- }
-
- if (cmsg.getDat().size() > 8) continue; //shouldnt ever happen
- uint8_t dat[8] = {0};
- memcpy(dat, cmsg.getDat().begin(), cmsg.getDat().size());
-
- // Assumes all signals in the message are of the same type (little or big endian)
- // TODO: allow signals within the same message to have different endianess
- auto& sig = message_states[cmsg.getAddress()].parse_sigs[0];
- if (sig.is_little_endian) {
- p = read_u64_le(dat);
- } else {
- p = read_u64_be(dat);
+ state.vals.push_back(sigop.default_value);
+ break;
}
-
- DEBUG(" proc %X: %llx\n", cmsg.getAddress(), p);
-
- state_it->second.parse(sec, cmsg.getBusTime(), p);
}
- }
- void UpdateValid(uint64_t sec) {
- can_valid = true;
- for (const auto& kv : message_states) {
- const auto& state = kv.second;
- if (state.check_threshold > 0 && (sec - state.seen) > state.check_threshold) {
- if (state.seen > 0) {
- DEBUG("%X TIMEOUT\n", state.address);
- }
- can_valid = false;
- }
}
- }
-
- void update_string(std::string data) {
- // format for board, make copy due to alignment issues, will be freed on out of scope
- auto amsg = kj::heapArray((data.length() / sizeof(capnp::word)) + 1);
- memcpy(amsg.begin(), data.data(), data.length());
-
- // extract the messages
- capnp::FlatArrayMessageReader cmsg(amsg);
- cereal::Event::Reader event = cmsg.getRoot();
-
- last_sec = event.getLogMonoTime();
- auto cans = event.getCan();
- UpdateCans(last_sec, cans);
-
- UpdateValid(last_sec);
+ message_states[state.address] = state;
}
+}
- int update(uint64_t sec, bool wait) {
- int err;
- int result = 0;
-
- // recv from can
- zmq_msg_t msg;
- zmq_msg_init(&msg);
+void CANParser::UpdateCans(uint64_t sec, const capnp::List::Reader& cans) {
+ int msg_count = cans.size();
+ uint64_t p;
- // multiple recv is fine
- bool first = wait;
- while (subscriber != NULL) {
- if (first) {
- err = zmq_msg_recv(&msg, subscriber, 0);
- first = false;
+ DEBUG("got %d messages\n", msg_count);
- // When we timeout on the first message, return error
- if (err < 0){
- result = -1;
- }
- } else {
- err = zmq_msg_recv(&msg, subscriber, ZMQ_DONTWAIT);
+ // parse the messages
+ for (int i = 0; i < msg_count; i++) {
+ auto cmsg = cans[i];
+ if (cmsg.getSrc() != bus) {
+ // DEBUG("skip %d: wrong bus\n", cmsg.getAddress());
+ continue;
+ }
+ auto state_it = message_states.find(cmsg.getAddress());
+ if (state_it == message_states.end()) {
+ // DEBUG("skip %d: not specified\n", cmsg.getAddress());
+ continue;
}
- if (err < 0) break;
-
- // format for board, make copy due to alignment issues, will be freed on out of scope
- auto amsg = kj::heapArray((zmq_msg_size(&msg) / sizeof(capnp::word)) + 1);
- memcpy(amsg.begin(), zmq_msg_data(&msg), zmq_msg_size(&msg));
- // extract the messages
- capnp::FlatArrayMessageReader cmsg(amsg);
- cereal::Event::Reader event = cmsg.getRoot();
+ if (cmsg.getDat().size() > 8) continue; //shouldnt ever happen
+ uint8_t dat[8] = {0};
+ memcpy(dat, cmsg.getDat().begin(), cmsg.getDat().size());
- auto cans = event.getCan();
- UpdateCans(sec, cans);
+ state_it->second.parse(sec, cmsg.getBusTime(), dat);
}
+}
- last_sec = sec;
- UpdateValid(sec);
- zmq_msg_close(&msg);
- return result;
- }
-
- std::vector query_latest() {
- std::vector ret;
-
- for (const auto& kv : message_states) {
- const auto& state = kv.second;
- if (last_sec != 0 && state.seen != last_sec) continue;
-
- for (int i=0; i 0 && (sec - state.seen) > state.check_threshold) {
+ if (state.seen > 0) {
+ DEBUG("%X TIMEOUT\n", state.address);
}
+ can_valid = false;
}
-
- return ret;
}
-
- bool can_valid = false;
- uint64_t last_sec = 0;
-
- private:
- const int bus;
- // zmq vars
- void *context = NULL;
- void *subscriber = NULL;
-
- const DBC *dbc = NULL;
- std::unordered_map message_states;
-};
-
-}
-
-extern "C" {
-
-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,
- bool sendcan, const char* tcp_addr, int timeout) {
- CANParser* ret = new CANParser(bus, std::string(dbc_name),
- (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, std::string(tcp_addr), timeout);
- return (void*)ret;
}
-void* can_init_with_vectors(int bus, const char* dbc_name,
- std::vector message_options,
- std::vector signal_options,
- bool sendcan, const char* tcp_addr, int timeout) {
- CANParser* ret = new CANParser(bus, std::string(dbc_name),
- message_options,
- signal_options,
- sendcan, std::string(tcp_addr), timeout);
- return (void*)ret;
-}
+void CANParser::update_string(std::string data) {
+ // format for board, make copy due to alignment issues, will be freed on out of scope
+ auto amsg = kj::heapArray((data.length() / sizeof(capnp::word)) + 1);
+ memcpy(amsg.begin(), data.data(), data.length());
-int can_update(void* can, uint64_t sec, bool wait) {
- CANParser* cp = (CANParser*)can;
- return cp->update(sec, wait);
-}
+ // extract the messages
+ capnp::FlatArrayMessageReader cmsg(amsg);
+ cereal::Event::Reader event = cmsg.getRoot();
-void can_update_string(void *can, const char* dat, int len) {
- CANParser* cp = (CANParser*)can;
- cp->update_string(std::string(dat, len));
-}
+ last_sec = event.getLogMonoTime();
-size_t can_query_latest(void* can, bool *out_can_valid, size_t out_values_size, SignalValue* out_values) {
- CANParser* cp = (CANParser*)can;
+ auto cans = event.getCan();
+ UpdateCans(last_sec, cans);
- if (out_can_valid) {
- *out_can_valid = cp->can_valid;
- }
+ UpdateValid(last_sec);
+}
- const std::vector values = cp->query_latest();
- if (out_values) {
- std::copy(values.begin(), values.begin()+std::min(out_values_size, values.size()), out_values);
- }
- return values.size();
-};
-void can_query_latest_vector(void* can, bool *out_can_valid, std::vector &values) {
- CANParser* cp = (CANParser*)can;
- if (out_can_valid) {
- *out_can_valid = cp->can_valid;
- }
- values = cp->query_latest();
-};
+std::vector CANParser::query_latest() {
+ std::vector ret;
-}
+ for (const auto& kv : message_states) {
+ const auto& state = kv.second;
+ if (last_sec != 0 && state.seen != last_sec) continue;
-#ifdef TEST
-
-int main(int argc, char** argv) {
- CANParser cp(0, "honda_civic_touring_2016_can",
- std::vector{
- // address, check_frequency
- {0x14a, 100},
- {0x158, 100},
- {0x17c, 100},
- {0x191, 100},
- {0x1a4, 50},
- {0x326, 10},
- {0x1b0, 50},
- {0x1d0, 50},
- {0x305, 10},
- {0x324, 10},
- {0x405, 3},
- {0x18f, 0},
- {0x130, 0},
- {0x296, 0},
- {0x30c, 0},
- },
- std::vector{
- // sig_name, sig_address, default
- {0x158, "XMISSION_SPEED", 0},
- {0x1d0, "WHEEL_SPEED_FL", 0},
- {0x1d0, "WHEEL_SPEED_FR", 0},
- {0x1d0, "WHEEL_SPEED_RL", 0},
- {0x14a, "STEER_ANGLE", 0},
- {0x18f, "STEER_TORQUE_SENSOR", 0},
- {0x191, "GEAR", 0},
- {0x1b0, "WHEELS_MOVING", 1},
- {0x405, "DOOR_OPEN_FL", 1},
- {0x405, "DOOR_OPEN_FR", 1},
- {0x405, "DOOR_OPEN_RL", 1},
- {0x405, "DOOR_OPEN_RR", 1},
- {0x324, "CRUISE_SPEED_PCM", 0},
- {0x305, "SEATBELT_DRIVER_LAMP", 1},
- {0x305, "SEATBELT_DRIVER_LATCHED", 0},
- {0x17c, "BRAKE_PRESSED", 0},
- {0x130, "CAR_GAS", 0},
- {0x296, "CRUISE_BUTTONS", 0},
- {0x1a4, "ESP_DISABLED", 1},
- {0x30c, "HUD_LEAD", 0},
- {0x1a4, "USER_BRAKE", 0},
- {0x18f, "STEER_STATUS", 5},
- {0x1d0, "WHEEL_SPEED_RR", 0},
- {0x1b0, "BRAKE_ERROR_1", 1},
- {0x1b0, "BRAKE_ERROR_2", 1},
- {0x191, "GEAR_SHIFTER", 0},
- {0x326, "MAIN_ON", 0},
- {0x17c, "ACC_STATUS", 0},
- {0x17c, "PEDAL_GAS", 0},
- {0x296, "CRUISE_SETTING", 0},
- {0x326, "LEFT_BLINKER", 0},
- {0x326, "RIGHT_BLINKER", 0},
- {0x324, "COUNTER", 0},
- {0x17c, "ENGINE_RPM", 0},
- });
-
-
-
- const std::string log_fn = "dats.bin";
-
- int log_fd = open(log_fn.c_str(), O_RDONLY, 0);
- assert(log_fd >= 0);
-
- off_t log_size = lseek(log_fd, 0, SEEK_END);
- lseek(log_fd, 0, SEEK_SET);
-
- void* log_data = mmap(NULL, log_size, PROT_READ, MAP_PRIVATE, log_fd, 0);
- assert(log_data);
-
- auto words = kj::arrayPtr((const capnp::word*)log_data, log_size/sizeof(capnp::word));
- while (words.size() > 0) {
- capnp::FlatArrayMessageReader reader(words);
-
- auto evt = reader.getRoot();
- auto cans = evt.getCan();
-
- cp.UpdateCans(0, cans);
-
- words = kj::arrayPtr(reader.getEnd(), words.end());
+ for (int i=0; idlsym(libdbc, 'can_init_with_vectors')
- self.dbc_lookup = dlsym(libdbc, 'dbc_lookup')
- self.can_update = dlsym(libdbc, 'can_update')
- self.can_update_string = dlsym(libdbc, 'can_update_string')
- self.can_query_latest_vector = dlsym(libdbc, 'can_query_latest_vector')
+ cdef:
+ cpp_CANParser *can
+ const DBC *dbc
+ map[string, uint32_t] msg_name_to_address
+ map[uint32_t, string] address_to_msg_name
+ vector[SignalValue] can_values
+ bool test_mode_enabled
+
+ cdef public:
+ string dbc_name
+ dict vl
+ dict ts
+ bool can_valid
+ int can_invalid_cnt
+
+ def __init__(self, dbc_name, signals, checks=None, bus=0):
if checks is None:
checks = []
self.can_valid = True
self.dbc_name = dbc_name
- self.dbc = self.dbc_lookup(dbc_name)
+ self.dbc = dbc_lookup(dbc_name)
self.vl = {}
self.ts = {}
@@ -78,15 +92,15 @@ cdef class CANParser:
mpo.check_frequency = freq
message_options_v.push_back(mpo)
- self.can = self.can_init_with_vectors(bus, dbc_name, message_options_v, signal_options_v, sendcan, tcp_addr, timeout)
+ self.can = new cpp_CANParser(bus, dbc_name, message_options_v, signal_options_v)
self.update_vl()
cdef unordered_set[uint32_t] update_vl(self):
cdef string sig_name
cdef unordered_set[uint32_t] updated_val
- cdef bool valid = False
- self.can_query_latest_vector(self.can, &valid, self.can_values)
+ can_values = self.can.query_latest()
+ valid = self.can.can_valid
# Update invalid flag
self.can_invalid_cnt += 1
@@ -95,7 +109,7 @@ cdef class CANParser:
self.can_valid = self.can_invalid_cnt < CAN_INVALID_CNT
- for cv in self.can_values:
+ for cv in can_values:
# Cast char * directly to unicde
name = self.address_to_msg_name[cv.address].c_str()
cv_name = cv.name
@@ -111,7 +125,7 @@ cdef class CANParser:
return updated_val
def update_string(self, dat):
- self.can_update_string(self.can, dat, len(dat))
+ self.can.update_string(dat)
return self.update_vl()
def update_strings(self, strings):
@@ -122,8 +136,3 @@ cdef class CANParser:
updated_vals.update(updated_val)
return updated_vals
-
- def update(self, uint64_t sec, bool wait):
- r = (self.can_update(self.can, sec, wait) >= 0)
- updated_val = self.update_vl()
- return r, updated_val
diff --git a/selfdrive/can/parser_pyx_setup.py b/selfdrive/can/parser_pyx_setup.py
index 29102ee026..a024c7a640 100644
--- a/selfdrive/can/parser_pyx_setup.py
+++ b/selfdrive/can/parser_pyx_setup.py
@@ -1,8 +1,10 @@
+import os
import subprocess
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module
from Cython.Build import cythonize
+from common.basedir import BASEDIR
from common.cython_hacks import BuildExtWithoutPlatformSuffix
sourcefiles = ['parser_pyx.pyx']
@@ -12,12 +14,22 @@ ARCH = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() # pyl
if ARCH == "aarch64":
extra_compile_args += ["-Wno-deprecated-register"]
-setup(name='Radard Thread',
+setup(name='CAN parser',
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
ext_modules=cythonize(
Extension(
"parser_pyx",
+ language="c++",
sources=sourcefiles,
- extra_compile_args=extra_compile_args
- ),
- nthreads=4))
+ extra_compile_args=extra_compile_args,
+ include_dirs=[
+ BASEDIR,
+ os.path.join(BASEDIR, 'phonelibs', 'capnp-cpp/include'),
+ ],
+ extra_link_args=[
+ os.path.join(BASEDIR, 'selfdrive', 'can', 'libdbc.so'),
+ ],
+ )
+ ),
+ nthreads=4,
+)
diff --git a/selfdrive/can/process_dbc.py b/selfdrive/can/process_dbc.py
index 6da527f785..c1da3ce45c 100755
--- a/selfdrive/can/process_dbc.py
+++ b/selfdrive/can/process_dbc.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
+from __future__ import print_function
import os
-import glob
import sys
import jinja2
@@ -10,108 +10,96 @@ from common.dbc import dbc
def main():
if len(sys.argv) != 3:
- print("usage: %s dbc_directory output_directory" % (sys.argv[0],))
+ print("usage: %s dbc_directory output_filename" % (sys.argv[0],))
sys.exit(0)
dbc_dir = sys.argv[1]
- out_dir = sys.argv[2]
+ out_fn = sys.argv[2]
- template_fn = os.path.join(os.path.dirname(__file__), "dbc_template.cc")
- template_mtime = os.path.getmtime(template_fn)
+ dbc_name = os.path.split(out_fn)[-1].replace('.cc', '')
- this_file_mtime = os.path.getmtime(__file__)
+ template_fn = os.path.join(os.path.dirname(__file__), "dbc_template.cc")
with open(template_fn, "r") as template_f:
template = jinja2.Template(template_f.read(), trim_blocks=True, lstrip_blocks=True)
- for dbc_path in glob.iglob(os.path.join(dbc_dir, "*.dbc")):
- dbc_mtime = os.path.getmtime(dbc_path)
- dbc_fn = os.path.split(dbc_path)[1]
- dbc_name = os.path.splitext(dbc_fn)[0]
- can_dbc = dbc(dbc_path)
- out_fn = os.path.join(os.path.dirname(__file__), out_dir, dbc_name + ".cc")
- if os.path.exists(out_fn):
- out_mtime = os.path.getmtime(out_fn)
- else:
- out_mtime = 0
-
- if dbc_mtime < out_mtime and template_mtime < out_mtime and this_file_mtime < out_mtime:
- continue #skip output is newer than template and dbc
-
- msgs = [(address, msg_name, msg_size, sorted(msg_sigs, key=lambda s: s.name not in ("COUNTER", "CHECKSUM"))) # process counter and checksums first
- for address, ((msg_name, msg_size), msg_sigs) in sorted(can_dbc.msgs.items()) if msg_sigs]
-
- def_vals = {a: set(b) for a,b in can_dbc.def_vals.items()} #remove duplicates
- def_vals = sorted(def_vals.items())
-
- if can_dbc.name.startswith(("honda_", "acura_")):
- checksum_type = "honda"
- checksum_size = 4
- counter_size = 2
- checksum_start_bit = 3
- counter_start_bit = 5
- little_endian = False
- elif can_dbc.name.startswith(("toyota_", "lexus_")):
- checksum_type = "toyota"
- checksum_size = 8
- counter_size = None
- checksum_start_bit = 7
- counter_start_bit = None
- little_endian = False
- elif can_dbc.name.startswith(("vw_", "volkswagen_", "audi_", "seat_", "skoda_")):
- checksum_type = "volkswagen"
- checksum_size = 8
- counter_size = 4
- checksum_start_bit = 0
- counter_start_bit = 0
- little_endian = True
- else:
- checksum_type = None
- checksum_size = None
- counter_size = None
- checksum_start_bit = None
- counter_start_bit = None
- little_endian = None
-
- # sanity checks on expected COUNTER and CHECKSUM rules, as packer and parser auto-compute those signals
- for address, msg_name, msg_size, sigs in msgs:
- dbc_msg_name = dbc_name + " " + msg_name
- for sig in sigs:
- if checksum_type is not None:
- # checksum rules
- if sig.name == "CHECKSUM":
- if sig.size != checksum_size:
- sys.exit("%s: CHECKSUM is not %d bits long" % (dbc_msg_name, checksum_size))
- if sig.start_bit % 8 != checksum_start_bit:
- sys.exit("%s: CHECKSUM starts at wrong bit" % dbc_msg_name)
- if little_endian != sig.is_little_endian:
- sys.exit("%s: CHECKSUM has wrong endianess" % dbc_msg_name)
- # counter rules
- if sig.name == "COUNTER":
- if counter_size is not None and sig.size != counter_size:
- sys.exit("%s: COUNTER is not %d bits long" % (dbc_msg_name, counter_size))
- if counter_start_bit is not None and sig.start_bit % 8 != counter_start_bit:
- print(counter_start_bit, sig.start_bit)
- sys.exit("%s: COUNTER starts at wrong bit" % dbc_msg_name)
- if little_endian != sig.is_little_endian:
- sys.exit("%s: COUNTER has wrong endianess" % dbc_msg_name)
- # pedal rules
- if address in [0x200, 0x201]:
- if sig.name == "COUNTER_PEDAL" and sig.size != 4:
- sys.exit("%s: PEDAL COUNTER is not 4 bits long" % dbc_msg_name)
- if sig.name == "CHECKSUM_PEDAL" and sig.size != 8:
- sys.exit("%s: PEDAL CHECKSUM is not 8 bits long" % dbc_msg_name)
-
- # Fail on duplicate message names
- c = Counter([msg_name for address, msg_name, msg_size, sigs in msgs])
- for name, count in c.items():
- if count > 1:
- sys.exit("%s: Duplicate message name in DBC file %s" % (dbc_name, name))
-
- parser_code = template.render(dbc=can_dbc, checksum_type=checksum_type, msgs=msgs, def_vals=def_vals, len=len)
-
- with open(out_fn, "w") as out_f:
- out_f.write(parser_code)
+ can_dbc = dbc(os.path.join(dbc_dir, dbc_name + '.dbc'))
+
+ msgs = [(address, msg_name, msg_size, sorted(msg_sigs, key=lambda s: s.name not in ("COUNTER", "CHECKSUM"))) # process counter and checksums first
+ for address, ((msg_name, msg_size), msg_sigs) in sorted(can_dbc.msgs.items()) if msg_sigs]
+
+ def_vals = {a: set(b) for a,b in can_dbc.def_vals.items()} #remove duplicates
+ def_vals = sorted(def_vals.items())
+
+ if can_dbc.name.startswith(("honda_", "acura_")):
+ checksum_type = "honda"
+ checksum_size = 4
+ counter_size = 2
+ checksum_start_bit = 3
+ counter_start_bit = 5
+ little_endian = False
+ elif can_dbc.name.startswith(("toyota_", "lexus_")):
+ checksum_type = "toyota"
+ checksum_size = 8
+ counter_size = None
+ checksum_start_bit = 7
+ counter_start_bit = None
+ little_endian = False
+ elif can_dbc.name.startswith(("vw_", "volkswagen_", "audi_", "seat_", "skoda_")):
+ checksum_type = "volkswagen"
+ checksum_size = 8
+ counter_size = 4
+ checksum_start_bit = 0
+ counter_start_bit = 0
+ little_endian = True
+ else:
+ checksum_type = None
+ checksum_size = None
+ counter_size = None
+ checksum_start_bit = None
+ counter_start_bit = None
+ little_endian = None
+
+ # sanity checks on expected COUNTER and CHECKSUM rules, as packer and parser auto-compute those signals
+ for address, msg_name, msg_size, sigs in msgs:
+ dbc_msg_name = dbc_name + " " + msg_name
+ for sig in sigs:
+ if checksum_type is not None:
+ # checksum rules
+ if sig.name == "CHECKSUM":
+ if sig.size != checksum_size:
+ sys.exit("%s: CHECKSUM is not %d bits long" % (dbc_msg_name, checksum_size))
+ if sig.start_bit % 8 != checksum_start_bit:
+ sys.exit("%s: CHECKSUM starts at wrong bit" % dbc_msg_name)
+ if little_endian != sig.is_little_endian:
+ sys.exit("%s: CHECKSUM has wrong endianess" % dbc_msg_name)
+ # counter rules
+ if sig.name == "COUNTER":
+ if counter_size is not None and sig.size != counter_size:
+ sys.exit("%s: COUNTER is not %d bits long" % (dbc_msg_name, counter_size))
+ if counter_start_bit is not None and sig.start_bit % 8 != counter_start_bit:
+ print(counter_start_bit, sig.start_bit)
+ sys.exit("%s: COUNTER starts at wrong bit" % dbc_msg_name)
+ if little_endian != sig.is_little_endian:
+ sys.exit("%s: COUNTER has wrong endianess" % dbc_msg_name)
+ # pedal rules
+ if address in [0x200, 0x201]:
+ if sig.name == "COUNTER_PEDAL" and sig.size != 4:
+ sys.exit("%s: PEDAL COUNTER is not 4 bits long" % dbc_msg_name)
+ if sig.name == "CHECKSUM_PEDAL" and sig.size != 8:
+ sys.exit("%s: PEDAL CHECKSUM is not 8 bits long" % dbc_msg_name)
+
+ # Fail on duplicate message names
+ c = Counter([msg_name for address, msg_name, msg_size, sigs in msgs])
+ for name, count in c.items():
+ if count > 1:
+ sys.exit("%s: Duplicate message name in DBC file %s" % (dbc_name, name))
+
+ parser_code = template.render(dbc=can_dbc, checksum_type=checksum_type, msgs=msgs, def_vals=def_vals, len=len)
+
+
+ with open(out_fn, "w") as out_f:
+ out_f.write(parser_code)
if __name__ == '__main__':
main()
diff --git a/selfdrive/can/tests/packer_old.py b/selfdrive/can/tests/packer_old.py
deleted file mode 100644
index 63120218e9..0000000000
--- a/selfdrive/can/tests/packer_old.py
+++ /dev/null
@@ -1,68 +0,0 @@
-import struct
-from selfdrive.can.libdbc_py import libdbc, ffi
-
-
-class CANPacker():
- def __init__(self, dbc_name):
- dbc_name = dbc_name.encode('utf8')
- self.packer = libdbc.canpack_init(dbc_name)
- self.dbc = libdbc.dbc_lookup(dbc_name)
- self.sig_names = {}
- self.name_to_address_and_size = {}
-
- num_msgs = self.dbc[0].num_msgs
- for i in range(num_msgs):
- msg = self.dbc[0].msgs[i]
-
- name = ffi.string(msg.name).decode('utf8')
- address = msg.address
- self.name_to_address_and_size[name] = (address, msg.size)
- self.name_to_address_and_size[address] = (address, msg.size)
-
- def pack(self, addr, values, counter):
- values_thing = []
- for name, value in values.items():
- if name not in self.sig_names:
- self.sig_names[name] = ffi.new("char[]", name.encode('utf8'))
-
- values_thing.append({
- 'name': self.sig_names[name],
- 'value': value
- })
-
- values_c = ffi.new("SignalPackValue[]", values_thing)
-
- return libdbc.canpack_pack(self.packer, addr, len(values_thing), values_c, counter)
-
- def pack_bytes(self, addr, values, counter=-1):
- addr, size = self.name_to_address_and_size[addr]
-
- val = self.pack(addr, values, counter)
- r = struct.pack(">Q", val)
- return addr, r[:size]
-
- 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__":
- ## little endian test
- cp = CANPacker("hyundai_santa_fe_2019_ccan")
- s = cp.pack_bytes(0x340, {
- "CR_Lkas_StrToqReq": -0.06,
- #"CF_Lkas_FcwBasReq": 1,
- "CF_Lkas_MsgCount": 7,
- "CF_Lkas_HbaSysState": 0,
- #"CF_Lkas_Chksum": 3,
- })
- s = cp.pack_bytes(0x340, {
- "CF_Lkas_MsgCount": 1,
- })
- # big endian test
- #cp = CANPacker("honda_civic_touring_2016_can_generated")
- #s = cp.pack_bytes(0xe4, {
- # "STEER_TORQUE": -2,
- #})
- print([hex(ord(v)) for v in s[1]])
- print(s[1].encode("hex"))
diff --git a/selfdrive/can/tests/parser_old.py b/selfdrive/can/tests/parser_old.py
deleted file mode 100644
index 1d2da57862..0000000000
--- a/selfdrive/can/tests/parser_old.py
+++ /dev/null
@@ -1,220 +0,0 @@
-import time
-import numbers
-
-from selfdrive.can.libdbc_py import libdbc, ffi
-
-CAN_INVALID_CNT = 5 # after so many consecutive CAN data with wrong checksum, counter or frequency, flag CAN invalidity
-
-class CANParser():
- def __init__(self, dbc_name, signals, checks=None, bus=0, sendcan=False, tcp_addr="127.0.0.1", timeout=-1):
- if checks is None:
- checks = []
-
- self.can_valid = True
- self.can_invalid_cnt = CAN_INVALID_CNT
- self.vl = {}
- self.ts = {}
-
- self.dbc_name = dbc_name
- self.dbc = libdbc.dbc_lookup(dbc_name.encode('utf8'))
- self.msg_name_to_addres = {}
- self.address_to_msg_name = {}
-
- num_msgs = self.dbc[0].num_msgs
- for i in range(num_msgs):
- msg = self.dbc[0].msgs[i]
-
- name = ffi.string(msg.name).decode('utf8')
- address = msg.address
-
- self.msg_name_to_addres[name] = address
- self.address_to_msg_name[address] = name
-
- self.vl[address] = {}
- self.vl[name] = {}
- self.ts[address] = {}
- self.ts[name] = {}
-
- # Convert message names into addresses
- for i in range(len(signals)):
- s = signals[i]
- if not isinstance(s[1], numbers.Number):
- s = (s[0], self.msg_name_to_addres[s[1]], s[2])
- signals[i] = s
-
- for i in range(len(checks)):
- c = checks[i]
- if not isinstance(c[0], numbers.Number):
- c = (self.msg_name_to_addres[c[0]], c[1])
- checks[i] = c
-
- sig_names = dict((name, ffi.new("char[]", name.encode('utf8'))) for name, _, _ in signals)
-
- signal_options_c = ffi.new("SignalParseOptions[]", [
- {
- 'address': sig_address,
- 'name': sig_names[sig_name],
- 'default_value': sig_default,
- } for sig_name, sig_address, sig_default in signals])
-
- message_options = dict((address, 0) for _, address, _ in signals)
- message_options.update(dict(checks))
-
- message_options_c = ffi.new("MessageParseOptions[]", [
- {
- 'address': msg_address,
- 'check_frequency': freq,
- } for msg_address, freq in message_options.items()])
-
- self.can = libdbc.can_init(bus, dbc_name.encode('utf8'), len(message_options_c), message_options_c,
- len(signal_options_c), signal_options_c, sendcan, tcp_addr.encode('utf8'), timeout)
-
- self.p_can_valid = ffi.new("bool*")
-
- value_count = libdbc.can_query_latest(self.can, self.p_can_valid, 0, ffi.NULL)
- self.can_values = ffi.new("SignalValue[%d]" % value_count)
- self.update_vl(0)
-
- def update_vl(self, sec):
- can_values_len = libdbc.can_query_latest(self.can, self.p_can_valid, len(self.can_values), self.can_values)
- assert can_values_len <= len(self.can_values)
-
- self.can_invalid_cnt += 1
- if self.p_can_valid[0]:
- self.can_invalid_cnt = 0
- self.can_valid = self.can_invalid_cnt < CAN_INVALID_CNT
-
- ret = set()
- for i in range(can_values_len):
- cv = self.can_values[i]
- address = cv.address
- # print("{0} {1}".format(hex(cv.address), ffi.string(cv.name)))
- name = ffi.string(cv.name).decode('utf8')
- self.vl[address][name] = cv.value
- self.ts[address][name] = cv.ts
-
- sig_name = self.address_to_msg_name[address]
- self.vl[sig_name][name] = cv.value
- self.ts[sig_name][name] = cv.ts
- ret.add(address)
- return ret
-
- def update(self, sec, wait):
- """Returns if the update was successfull (e.g. no rcv timeout happened)"""
- r = libdbc.can_update(self.can, sec, wait)
- return bool(r >= 0), self.update_vl(sec)
-
-
-if __name__ == "__main__":
- from common.realtime import sec_since_boot
-
- radar_messages = range(0x430, 0x43A) + range(0x440, 0x446)
- # signals = zip(['LONG_DIST'] * 16 + ['NEW_TRACK'] * 16 + ['LAT_DIST'] * 16 +
- # ['REL_SPEED'] * 16, radar_messages * 4,
- # [255] * 16 + [1] * 16 + [0] * 16 + [0] * 16)
- # checks = zip(radar_messages, [20]*16)
-
- # cp = CANParser("acura_ilx_2016_nidec", signals, checks, 1)
-
-
- # signals = [
- # ("XMISSION_SPEED", 0x158, 0), #sig_name, sig_address, default
- # ("WHEEL_SPEED_FL", 0x1d0, 0),
- # ("WHEEL_SPEED_FR", 0x1d0, 0),
- # ("WHEEL_SPEED_RL", 0x1d0, 0),
- # ("STEER_ANGLE", 0x14a, 0),
- # ("STEER_TORQUE_SENSOR", 0x18f, 0),
- # ("GEAR", 0x191, 0),
- # ("WHEELS_MOVING", 0x1b0, 1),
- # ("DOOR_OPEN_FL", 0x405, 1),
- # ("DOOR_OPEN_FR", 0x405, 1),
- # ("DOOR_OPEN_RL", 0x405, 1),
- # ("DOOR_OPEN_RR", 0x405, 1),
- # ("CRUISE_SPEED_PCM", 0x324, 0),
- # ("SEATBELT_DRIVER_LAMP", 0x305, 1),
- # ("SEATBELT_DRIVER_LATCHED", 0x305, 0),
- # ("BRAKE_PRESSED", 0x17c, 0),
- # ("CAR_GAS", 0x130, 0),
- # ("CRUISE_BUTTONS", 0x296, 0),
- # ("ESP_DISABLED", 0x1a4, 1),
- # ("HUD_LEAD", 0x30c, 0),
- # ("USER_BRAKE", 0x1a4, 0),
- # ("STEER_STATUS", 0x18f, 5),
- # ("WHEEL_SPEED_RR", 0x1d0, 0),
- # ("BRAKE_ERROR_1", 0x1b0, 1),
- # ("BRAKE_ERROR_2", 0x1b0, 1),
- # ("GEAR_SHIFTER", 0x191, 0),
- # ("MAIN_ON", 0x326, 0),
- # ("ACC_STATUS", 0x17c, 0),
- # ("PEDAL_GAS", 0x17c, 0),
- # ("CRUISE_SETTING", 0x296, 0),
- # ("LEFT_BLINKER", 0x326, 0),
- # ("RIGHT_BLINKER", 0x326, 0),
- # ("COUNTER", 0x324, 0),
- # ("ENGINE_RPM", 0x17C, 0)
- # ]
- # checks = [
- # (0x14a, 100), # address, frequency
- # (0x158, 100),
- # (0x17c, 100),
- # (0x191, 100),
- # (0x1a4, 50),
- # (0x326, 10),
- # (0x1b0, 50),
- # (0x1d0, 50),
- # (0x305, 10),
- # (0x324, 10),
- # (0x405, 3),
- # ]
-
- # cp = CANParser("honda_civic_touring_2016_can_generated", signals, checks, 0)
-
-
- signals = [
- # sig_name, sig_address, default
- ("GEAR", 956, 0x20),
- ("BRAKE_PRESSED", 548, 0),
- ("GAS_PEDAL", 705, 0),
-
- ("WHEEL_SPEED_FL", 170, 0),
- ("WHEEL_SPEED_FR", 170, 0),
- ("WHEEL_SPEED_RL", 170, 0),
- ("WHEEL_SPEED_RR", 170, 0),
- ("DOOR_OPEN_FL", 1568, 1),
- ("DOOR_OPEN_FR", 1568, 1),
- ("DOOR_OPEN_RL", 1568, 1),
- ("DOOR_OPEN_RR", 1568, 1),
- ("SEATBELT_DRIVER_UNLATCHED", 1568, 1),
- ("TC_DISABLED", 951, 1),
- ("STEER_ANGLE", 37, 0),
- ("STEER_FRACTION", 37, 0),
- ("STEER_RATE", 37, 0),
- ("GAS_RELEASED", 466, 0),
- ("CRUISE_STATE", 466, 0),
- ("MAIN_ON", 467, 0),
- ("SET_SPEED", 467, 0),
- ("STEER_TORQUE_DRIVER", 608, 0),
- ("STEER_TORQUE_EPS", 608, 0),
- ("TURN_SIGNALS", 1556, 3), # 3 is no blinkers
- ("LKA_STATE", 610, 0),
- ]
- checks = [
- (548, 40),
- (705, 33),
-
- (170, 80),
- (37, 80),
- (466, 33),
- (608, 50),
- ]
-
- cp = CANParser("toyota_rav4_2017_pt_generated", signals, checks, 0)
-
- # print(cp.vl)
-
- while True:
- cp.update(int(sec_since_boot()*1e9), True)
- # print(cp.vl)
- print(cp.ts)
- print(cp.can_valid)
- time.sleep(0.01)
diff --git a/selfdrive/can/tests/test_packer_chrysler.py b/selfdrive/can/tests/test_packer_chrysler.py
deleted file mode 100644
index e566d87a72..0000000000
--- a/selfdrive/can/tests/test_packer_chrysler.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import unittest
-import random
-
-from selfdrive.can.tests.packer_old import CANPacker as CANPackerOld
-from selfdrive.can.packer import CANPacker
-import selfdrive.car.chrysler.chryslercan as chryslercan
-
-
-class TestPackerMethods(unittest.TestCase):
- def setUp(self):
- self.chrysler_cp_old = CANPackerOld("chrysler_pacifica_2017_hybrid")
- self.chrysler_cp = CANPacker("chrysler_pacifica_2017_hybrid")
-
- def test_correctness(self):
- # Test all commands, randomize the params.
- for _ in range(1000):
- gear = ('drive', 'reverse', 'low')[random.randint(0, 3) % 3]
- lkas_active = (random.randint(0, 2) % 2 == 0)
- hud_alert = random.randint(0, 6)
- hud_count = random.randint(0, 65536)
- lkas_car_model = random.randint(0, 65536)
- m_old = chryslercan.create_lkas_hud(self.chrysler_cp_old, gear, lkas_active, hud_alert, hud_count, lkas_car_model)
- m = chryslercan.create_lkas_hud(self.chrysler_cp, gear, lkas_active, hud_alert, hud_count, lkas_car_model)
- self.assertEqual(m_old, m)
-
- apply_steer = (random.randint(0, 2) % 2 == 0)
- moving_fast = (random.randint(0, 2) % 2 == 0)
- frame = random.randint(0, 65536)
- m_old = chryslercan.create_lkas_command(self.chrysler_cp_old, apply_steer, moving_fast, frame)
- m = chryslercan.create_lkas_command(self.chrysler_cp, apply_steer, moving_fast, frame)
- self.assertEqual(m_old, m)
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/selfdrive/can/tests/test_packer_gm.py b/selfdrive/can/tests/test_packer_gm.py
deleted file mode 100644
index 54119fbe43..0000000000
--- a/selfdrive/can/tests/test_packer_gm.py
+++ /dev/null
@@ -1,66 +0,0 @@
-import unittest
-import random
-
-from selfdrive.can.tests.packer_old import CANPacker as CANPackerOld
-from selfdrive.can.packer import CANPacker
-import selfdrive.car.gm.gmcan as gmcan
-from selfdrive.car.gm.interface import CanBus as GMCanBus
-
-
-class TestPackerMethods(unittest.TestCase):
- def setUp(self):
- self.gm_cp_old = CANPackerOld("gm_global_a_powertrain")
- self.gm_cp = CANPacker("gm_global_a_powertrain")
-
- self.ct6_cp_old = CANPackerOld("cadillac_ct6_chassis")
- self.ct6_cp = CANPacker("cadillac_ct6_chassis")
-
- def test_correctness(self):
- # Test all cars' commands, randomize the params.
- for _ in range(1000):
- bus = random.randint(0, 65536)
- apply_steer = (random.randint(0, 2) % 2 == 0)
- idx = random.randint(0, 65536)
- lkas_active = (random.randint(0, 2) % 2 == 0)
- m_old = gmcan.create_steering_control(self.gm_cp_old, bus, apply_steer, idx, lkas_active)
- m = gmcan.create_steering_control(self.gm_cp, bus, apply_steer, idx, lkas_active)
- self.assertEqual(m_old, m)
-
- canbus = GMCanBus()
- apply_steer = (random.randint(0, 2) % 2 == 0)
- v_ego = random.randint(0, 65536)
- idx = random.randint(0, 65536)
- enabled = (random.randint(0, 2) % 2 == 0)
- m_old = gmcan.create_steering_control_ct6(self.ct6_cp_old, canbus, apply_steer, v_ego, idx, enabled)
- m = gmcan.create_steering_control_ct6(self.ct6_cp, canbus, apply_steer, v_ego, idx, enabled)
- self.assertEqual(m_old, m)
-
- bus = random.randint(0, 65536)
- throttle = random.randint(0, 65536)
- idx = random.randint(0, 65536)
- acc_engaged = (random.randint(0, 2) % 2 == 0)
- at_full_stop = (random.randint(0, 2) % 2 == 0)
- m_old = gmcan.create_gas_regen_command(self.gm_cp_old, bus, throttle, idx, acc_engaged, at_full_stop)
- m = gmcan.create_gas_regen_command(self.gm_cp, bus, throttle, idx, acc_engaged, at_full_stop)
- self.assertEqual(m_old, m)
-
- bus = random.randint(0, 65536)
- apply_brake = (random.randint(0, 2) % 2 == 0)
- idx = random.randint(0, 65536)
- near_stop = (random.randint(0, 2) % 2 == 0)
- at_full_stop = (random.randint(0, 2) % 2 == 0)
- m_old = gmcan.create_friction_brake_command(self.ct6_cp_old, bus, apply_brake, idx, near_stop, at_full_stop)
- m = gmcan.create_friction_brake_command(self.ct6_cp, bus, apply_brake, idx, near_stop, at_full_stop)
- self.assertEqual(m_old, m)
-
- bus = random.randint(0, 65536)
- acc_engaged = (random.randint(0, 2) % 2 == 0)
- target_speed_kph = random.randint(0, 65536)
- lead_car_in_sight = (random.randint(0, 2) % 2 == 0)
- m_old = gmcan.create_acc_dashboard_command(self.gm_cp_old, bus, acc_engaged, target_speed_kph, lead_car_in_sight)
- m = gmcan.create_acc_dashboard_command(self.gm_cp, bus, acc_engaged, target_speed_kph, lead_car_in_sight)
- self.assertEqual(m_old, m)
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/selfdrive/can/tests/test_packer_honda.py b/selfdrive/can/tests/test_packer_honda.py
deleted file mode 100644
index 3a9548a3ef..0000000000
--- a/selfdrive/can/tests/test_packer_honda.py
+++ /dev/null
@@ -1,56 +0,0 @@
-import unittest
-import random
-
-from selfdrive.can.tests.packer_old import CANPacker as CANPackerOld
-from selfdrive.can.packer import CANPacker
-import selfdrive.car.honda.hondacan as hondacan
-from selfdrive.car.honda.values import HONDA_BOSCH
-from selfdrive.car.honda.carcontroller import HUDData
-
-
-class TestPackerMethods(unittest.TestCase):
- def setUp(self):
- self.honda_cp_old = CANPackerOld("honda_pilot_touring_2017_can_generated")
- self.honda_cp = CANPacker("honda_pilot_touring_2017_can_generated")
-
- def test_correctness(self):
- # Test all commands, randomize the params.
- for _ in range(1000):
- has_relay = False
- car_fingerprint = HONDA_BOSCH[0]
-
- apply_brake = (random.randint(0, 2) % 2 == 0)
- pump_on = (random.randint(0, 2) % 2 == 0)
- pcm_override = (random.randint(0, 2) % 2 == 0)
- pcm_cancel_cmd = (random.randint(0, 2) % 2 == 0)
- fcw = random.randint(0, 65536)
- idx = random.randint(0, 65536)
- m_old = hondacan.create_brake_command(self.honda_cp_old, apply_brake, pump_on, pcm_override, pcm_cancel_cmd, fcw, idx, car_fingerprint, has_relay)
- m = hondacan.create_brake_command(self.honda_cp, apply_brake, pump_on, pcm_override, pcm_cancel_cmd, fcw, idx, car_fingerprint, has_relay)
- self.assertEqual(m_old, m)
-
- apply_steer = (random.randint(0, 2) % 2 == 0)
- lkas_active = (random.randint(0, 2) % 2 == 0)
- idx = random.randint(0, 65536)
- m_old = hondacan.create_steering_control(self.honda_cp_old, apply_steer, lkas_active, car_fingerprint, idx, has_relay)
- m = hondacan.create_steering_control(self.honda_cp, apply_steer, lkas_active, car_fingerprint, idx, has_relay)
- self.assertEqual(m_old, m)
-
- pcm_speed = random.randint(0, 65536)
- hud = HUDData(random.randint(0, 65536), random.randint(0, 65536), 1, random.randint(0, 65536),
- 0xc1, random.randint(0, 65536), random.randint(0, 65536), random.randint(0, 65536), random.randint(0, 65536))
- idx = random.randint(0, 65536)
- is_metric = (random.randint(0, 2) % 2 == 0)
- m_old = hondacan.create_ui_commands(self.honda_cp_old, pcm_speed, hud, car_fingerprint, is_metric, idx, has_relay)
- m = hondacan.create_ui_commands(self.honda_cp, pcm_speed, hud, car_fingerprint, is_metric, idx, has_relay)
- self.assertEqual(m_old, m)
-
- button_val = random.randint(0, 65536)
- idx = random.randint(0, 65536)
- m_old = hondacan.spam_buttons_command(self.honda_cp_old, button_val, idx, car_fingerprint, has_relay)
- m = hondacan.spam_buttons_command(self.honda_cp, button_val, idx, car_fingerprint, has_relay)
- self.assertEqual(m_old, m)
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/selfdrive/can/tests/test_packer_hyundai.py b/selfdrive/can/tests/test_packer_hyundai.py
deleted file mode 100644
index c2bcb04014..0000000000
--- a/selfdrive/can/tests/test_packer_hyundai.py
+++ /dev/null
@@ -1,70 +0,0 @@
-import unittest
-import random
-
-from selfdrive.can.tests.packer_old import CANPacker as CANPackerOld
-from selfdrive.can.packer import CANPacker
-import selfdrive.car.hyundai.hyundaican as hyundaican
-from selfdrive.car.hyundai.values import CHECKSUM as hyundai_checksum
-
-
-class TestPackerMethods(unittest.TestCase):
- def setUp(self):
- self.hyundai_cp_old = CANPackerOld("hyundai_kia_generic")
- self.hyundai_cp = CANPacker("hyundai_kia_generic")
-
- def test_correctness(self):
- # Test all commands, randomize the params.
- for _ in range(1000):
- # Hyundai
- car_fingerprint = hyundai_checksum["crc8"][0]
- apply_steer = (random.randint(0, 2) % 2 == 0)
- steer_req = (random.randint(0, 2) % 2 == 0)
- cnt = random.randint(0, 65536)
- enabled = (random.randint(0, 2) % 2 == 0)
- lkas11 = {
- "CF_Lkas_LdwsSysState": random.randint(0,65536),
- "CF_Lkas_SysWarning": random.randint(0,65536),
- "CF_Lkas_LdwsLHWarning": random.randint(0,65536),
- "CF_Lkas_LdwsRHWarning": random.randint(0,65536),
- "CF_Lkas_HbaLamp": random.randint(0,65536),
- "CF_Lkas_FcwBasReq": random.randint(0,65536),
- "CF_Lkas_ToiFlt": random.randint(0,65536),
- "CF_Lkas_HbaSysState": random.randint(0,65536),
- "CF_Lkas_FcwOpt": random.randint(0,65536),
- "CF_Lkas_HbaOpt": random.randint(0,65536),
- "CF_Lkas_FcwSysState": random.randint(0,65536),
- "CF_Lkas_FcwCollisionWarning": random.randint(0,65536),
- "CF_Lkas_FusionState": random.randint(0,65536),
- "CF_Lkas_FcwOpt_USM": random.randint(0,65536),
- "CF_Lkas_LdwsOpt_USM": random.randint(0,65536)
- }
- hud_alert = random.randint(0, 65536)
- keep_stock = (random.randint(0, 2) % 2 == 0)
- m_old = hyundaican.create_lkas11(self.hyundai_cp_old, car_fingerprint, apply_steer, steer_req, cnt, enabled,
- lkas11, hud_alert, keep_stock)
- m = hyundaican.create_lkas11(self.hyundai_cp, car_fingerprint, apply_steer, steer_req, cnt, enabled,
- lkas11, hud_alert, keep_stock)
- self.assertEqual(m_old, m)
-
- clu11 = {
- "CF_Clu_CruiseSwState": random.randint(0,65536),
- "CF_Clu_CruiseSwMain": random.randint(0,65536),
- "CF_Clu_SldMainSW": random.randint(0,65536),
- "CF_Clu_ParityBit1": random.randint(0,65536),
- "CF_Clu_VanzDecimal": random.randint(0,65536),
- "CF_Clu_Vanz": random.randint(0,65536),
- "CF_Clu_SPEED_UNIT": random.randint(0,65536),
- "CF_Clu_DetentOut": random.randint(0,65536),
- "CF_Clu_RheostatLevel": random.randint(0,65536),
- "CF_Clu_CluInfo": random.randint(0,65536),
- "CF_Clu_AmpInfo": random.randint(0,65536),
- "CF_Clu_AliveCnt1": random.randint(0,65536),
- }
- button = random.randint(0, 65536)
- m_old = hyundaican.create_clu11(self.hyundai_cp_old, clu11, button)
- m = hyundaican.create_clu11(self.hyundai_cp, clu11, button)
- self.assertEqual(m_old, m)
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/selfdrive/can/tests/test_packer_parser.py b/selfdrive/can/tests/test_packer_parser.py
new file mode 100644
index 0000000000..9b8a886c46
--- /dev/null
+++ b/selfdrive/can/tests/test_packer_parser.py
@@ -0,0 +1,92 @@
+#!/usr/bin/env python3
+
+import unittest
+
+from selfdrive.can.parser import CANParser
+from selfdrive.can.packer import CANPacker
+
+from selfdrive.boardd.boardd import can_list_to_can_capnp
+
+from selfdrive.car.honda.interface import CarInterface as HondaInterface
+from selfdrive.car.honda.values import CAR as HONDA_CAR
+from selfdrive.car.honda.values import DBC as HONDA_DBC
+
+from selfdrive.car.subaru.interface import CarInterface as SubaruInterface
+from selfdrive.car.subaru.values import CAR as SUBARU_CAR
+from selfdrive.car.subaru.values import DBC as SUBARU_DBC
+
+class TestCanParserPacker(unittest.TestCase):
+ def test_civic(self):
+ CP = HondaInterface.get_params(HONDA_CAR.CIVIC)
+
+ signals = [
+ ("STEER_TORQUE", "STEERING_CONTROL", 0),
+ ("STEER_TORQUE_REQUEST", "STEERING_CONTROL", 0),
+ ]
+ checks = []
+
+ parser = CANParser(HONDA_DBC[CP.carFingerprint]['pt'], signals, checks, 0)
+ packer = CANPacker(HONDA_DBC[CP.carFingerprint]['pt'])
+
+ idx = 0
+
+ for steer in range(0, 255):
+ for active in [1, 0]:
+ values = {
+ "STEER_TORQUE": steer,
+ "STEER_TORQUE_REQUEST": active,
+ }
+
+ msgs = packer.make_can_msg("STEERING_CONTROL", 0, values, idx)
+ bts = can_list_to_can_capnp([msgs])
+
+ parser.update_string(bts)
+
+ self.assertAlmostEqual(parser.vl["STEERING_CONTROL"]["STEER_TORQUE"], steer)
+ self.assertAlmostEqual(parser.vl["STEERING_CONTROL"]["STEER_TORQUE_REQUEST"], active)
+ self.assertAlmostEqual(parser.vl["STEERING_CONTROL"]["COUNTER"], idx % 4)
+
+ idx += 1
+
+ def test_subaru(self):
+ # Subuaru is little endian
+ CP = SubaruInterface.get_params(SUBARU_CAR.IMPREZA)
+
+ signals = [
+ ("Counter", "ES_LKAS", 0),
+ ("LKAS_Output", "ES_LKAS", 0),
+ ("LKAS_Request", "ES_LKAS", 0),
+ ("SET_1", "ES_LKAS", 0),
+
+ ]
+
+ checks = []
+
+ parser = CANParser(SUBARU_DBC[CP.carFingerprint]['pt'], signals, checks, 0)
+ packer = CANPacker(SUBARU_DBC[CP.carFingerprint]['pt'])
+
+ idx = 0
+
+ for steer in range(0, 255):
+ for active in [1, 0]:
+ values = {
+ "Counter": idx,
+ "LKAS_Output": steer,
+ "LKAS_Request": active,
+ "SET_1": 1
+ }
+
+ msgs = packer.make_can_msg("ES_LKAS", 0, values)
+ bts = can_list_to_can_capnp([msgs])
+ parser.update_string(bts)
+
+ self.assertAlmostEqual(parser.vl["ES_LKAS"]["LKAS_Output"], steer)
+ self.assertAlmostEqual(parser.vl["ES_LKAS"]["LKAS_Request"], active)
+ self.assertAlmostEqual(parser.vl["ES_LKAS"]["SET_1"], 1)
+ self.assertAlmostEqual(parser.vl["ES_LKAS"]["Counter"], idx % 16)
+
+ idx += 1
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/selfdrive/can/tests/test_packer_subaru.py b/selfdrive/can/tests/test_packer_subaru.py
deleted file mode 100644
index 0690806d7c..0000000000
--- a/selfdrive/can/tests/test_packer_subaru.py
+++ /dev/null
@@ -1,37 +0,0 @@
-import unittest
-import random
-
-from selfdrive.can.tests.packer_old import CANPacker as CANPackerOld
-from selfdrive.can.packer import CANPacker
-import selfdrive.car.subaru.subarucan as subarucan
-from selfdrive.car.subaru.values import CAR as subaru_car
-
-
-class TestPackerMethods(unittest.TestCase):
- def setUp(self):
- self.subaru_cp_old = CANPackerOld("subaru_global_2017")
- self.subaru_cp = CANPacker("subaru_global_2017")
-
- def test_correctness(self):
- # Test all cars' commands, randomize the params.
- for _ in range(1000):
- apply_steer = (random.randint(0, 2) % 2 == 0)
- frame = random.randint(1, 65536)
- steer_step = random.randint(1, 65536)
- m_old = subarucan.create_steering_control(self.subaru_cp_old, subaru_car.IMPREZA, apply_steer, frame, steer_step)
- m = subarucan.create_steering_control(self.subaru_cp, subaru_car.IMPREZA, apply_steer, frame, steer_step)
- self.assertEqual(m_old, m)
-
- m_old = subarucan.create_steering_status(self.subaru_cp_old, subaru_car.IMPREZA, apply_steer, frame, steer_step)
- m = subarucan.create_steering_status(self.subaru_cp, subaru_car.IMPREZA, apply_steer, frame, steer_step)
- self.assertEqual(m_old, m)
-
- es_distance_msg = {}
- pcm_cancel_cmd = (random.randint(0, 2) % 2 == 0)
- m_old = subarucan.create_es_distance(self.subaru_cp_old, es_distance_msg, pcm_cancel_cmd)
- m = subarucan.create_es_distance(self.subaru_cp, es_distance_msg, pcm_cancel_cmd)
- self.assertEqual(m_old, m)
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/selfdrive/can/tests/test_packer_toyota.py b/selfdrive/can/tests/test_packer_toyota.py
deleted file mode 100644
index 05f5eeed2e..0000000000
--- a/selfdrive/can/tests/test_packer_toyota.py
+++ /dev/null
@@ -1,86 +0,0 @@
-import unittest
-import random
-
-from selfdrive.can.tests.packer_old import CANPacker as CANPackerOld
-from selfdrive.can.packer import CANPacker
-from selfdrive.car.toyota.toyotacan import (
- create_ipas_steer_command, create_steer_command, create_accel_command,
- create_fcw_command, create_ui_command
-)
-from common.realtime import sec_since_boot
-
-
-class TestPackerMethods(unittest.TestCase):
- def setUp(self):
- self.cp_old = CANPackerOld("toyota_rav4_hybrid_2017_pt_generated")
- self.cp = CANPacker("toyota_rav4_hybrid_2017_pt_generated")
-
- def test_correctness(self):
- # Test all commands, randomize the params.
- for _ in range(1000):
- # Toyota
- steer = random.randint(-1, 1)
- enabled = (random.randint(0, 2) % 2 == 0)
- apgs_enabled = (random.randint(0, 2) % 2 == 0)
- m_old = create_ipas_steer_command(self.cp_old, steer, enabled, apgs_enabled)
- m = create_ipas_steer_command(self.cp, steer, enabled, apgs_enabled)
- self.assertEqual(m_old, m)
-
- steer = (random.randint(0, 2) % 2 == 0)
- steer_req = (random.randint(0, 2) % 2 == 0)
- raw_cnt = random.randint(1, 65536)
- m_old = create_steer_command(self.cp_old, steer, steer_req, raw_cnt)
- m = create_steer_command(self.cp, steer, steer_req, raw_cnt)
- self.assertEqual(m_old, m)
-
- accel = (random.randint(0, 2) % 2 == 0)
- pcm_cancel = (random.randint(0, 2) % 2 == 0)
- standstill_req = (random.randint(0, 2) % 2 == 0)
- lead = (random.randint(0, 2) % 2 == 0)
- m_old = create_accel_command(self.cp_old, accel, pcm_cancel, standstill_req, lead)
- m = create_accel_command(self.cp, accel, pcm_cancel, standstill_req, lead)
- self.assertEqual(m_old, m)
-
- fcw = random.randint(1, 65536)
- m_old = create_fcw_command(self.cp_old, fcw)
- m = create_fcw_command(self.cp, fcw)
- self.assertEqual(m_old, m)
-
- steer = (random.randint(0, 2) % 2 == 0)
- chime = random.randint(1, 65536)
- left_line = (random.randint(0, 2) % 2 == 0)
- right_line = (random.randint(0, 2) % 2 == 0)
- left_lane_depart = (random.randint(0, 2) % 2 == 0)
- right_lane_depart = (random.randint(0, 2) % 2 == 0)
- m_old = create_ui_command(self.cp_old, steer, chime, left_line, right_line, left_lane_depart, right_lane_depart)
- m = create_ui_command(self.cp, steer, chime, left_line, right_line, left_lane_depart, right_lane_depart)
- self.assertEqual(m_old, m)
-
- def test_performance(self):
- n1 = sec_since_boot()
- recursions = 100000
- steer = (random.randint(0, 2) % 2 == 0)
- chime = random.randint(1, 65536)
- left_line = (random.randint(0, 2) % 2 == 0)
- right_line = (random.randint(0, 2) % 2 == 0)
- left_lane_depart = (random.randint(0, 2) % 2 == 0)
- right_lane_depart = (random.randint(0, 2) % 2 == 0)
-
- for _ in range(recursions):
- create_ui_command(self.cp_old, steer, chime, left_line, right_line, left_lane_depart, right_lane_depart)
- n2 = sec_since_boot()
- elapsed_old = n2 - n1
-
- # print('Old API, elapsed time: {} secs'.format(elapsed_old))
- n1 = sec_since_boot()
- for _ in range(recursions):
- create_ui_command(self.cp, steer, chime, left_line, right_line, left_lane_depart, right_lane_depart)
- n2 = sec_since_boot()
- elapsed_new = n2 - n1
- # print('New API, elapsed time: {} secs'.format(elapsed_new))
- self.assertTrue(elapsed_new < elapsed_old / 2)
-
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/selfdrive/can/tests/test_parser.py b/selfdrive/can/tests/test_parser.py
deleted file mode 100755
index 09d153c1bd..0000000000
--- a/selfdrive/can/tests/test_parser.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/env python3
-
-import os
-import unittest
-
-import requests
-
-import selfdrive.messaging as messaging
-from selfdrive.can.parser import CANParser as CANParserNew
-from selfdrive.can.tests.parser_old import CANParser as CANParserOld
-from selfdrive.car.honda.carstate import get_can_signals
-from selfdrive.car.honda.interface import CarInterface
-from selfdrive.car.honda.values import CAR, DBC
-from selfdrive.services import service_list
-from tools.lib.logreader import LogReader
-
-BASE_URL = "https://commadataci.blob.core.windows.net/openpilotci/"
-DT = int(0.01 * 1e9) # ns
-
-
-def dict_keys_differ(dict1, dict2):
- keys1 = set(dict1.keys())
- keys2 = set(dict2.keys())
-
- if keys1 != keys2:
- return True
-
- for k in keys1:
- keys1 = set(dict1[k].keys())
- keys2 = set(dict2[k].keys())
-
- if keys1 != keys2:
- return True
-
- return False
-
-def dicts_vals_differ(dict1, dict2):
- for k_outer in dict1.keys():
- for k_inner in dict1[k_outer].keys():
- if dict1[k_outer][k_inner] != dict2[k_outer][k_inner]:
- return True
-
- return False
-
-def run_route(route):
- can = messaging.pub_sock(service_list['can'].port)
-
- CP = CarInterface.get_params(CAR.CIVIC)
- signals, checks = get_can_signals(CP)
- parser_old = CANParserOld(DBC[CP.carFingerprint]['pt'], signals, checks, 0, timeout=-1, tcp_addr="127.0.0.1")
- parser_new = CANParserNew(DBC[CP.carFingerprint]['pt'], signals, checks, 0, timeout=-1, tcp_addr="127.0.0.1")
- parser_string = CANParserNew(DBC[CP.carFingerprint]['pt'], signals, checks, 0, timeout=-1)
-
- if dict_keys_differ(parser_old.vl, parser_new.vl):
- return False
-
- lr = LogReader(route + ".bz2")
-
- route_ok = True
-
- for msg in lr:
- if msg.which() == 'can':
- t = msg.logMonoTime
- msg_bytes = msg.as_builder().to_bytes()
- can.send(msg_bytes)
-
- _, updated_old = parser_old.update(t, True)
- _, updated_new = parser_new.update(t, True)
- updated_string = parser_string.update_string(msg_bytes)
-
- if updated_old != updated_new:
- route_ok = False
- print(t, "Diff in seen")
-
- if updated_new != updated_string:
- route_ok = False
- print(t, "Diff in seen string")
-
- if dicts_vals_differ(parser_old.vl, parser_new.vl):
- print(t, "Diff in dict")
- route_ok = False
-
- if dicts_vals_differ(parser_new.vl, parser_string.vl):
- print(t, "Diff in dict string")
- route_ok = False
-
- return route_ok
-
-class TestCanParser(unittest.TestCase):
- def setUp(self):
- self.routes = {
- CAR.CIVIC: "b0c9d2329ad1606b|2019-05-30--20-23-57"
- }
-
- for route in self.routes.values():
- route_filename = route + ".bz2"
- if not os.path.isfile(route_filename):
- with open(route + ".bz2", "wb") as f:
- f.write(requests.get(BASE_URL + route_filename).content)
-
- def test_parser_civic(self):
- self.assertTrue(run_route(self.routes[CAR.CIVIC]))
-
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py
index eaff50a3b7..bc7d9676f5 100644
--- a/selfdrive/car/car_helpers.py
+++ b/selfdrive/car/car_helpers.py
@@ -1,6 +1,4 @@
import os
-import zmq
-from cereal import car
from common.params import Params
from common.basedir import BASEDIR
from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_known_cars
@@ -9,17 +7,6 @@ from selfdrive.swaglog import cloudlog
import selfdrive.messaging as messaging
from selfdrive.car import gen_empty_fingerprint
-
-def get_one_can(logcan):
- while True:
- try:
- can = messaging.recv_one(logcan)
- if len(can.can) > 0:
- return can
- except zmq.error.Again:
- continue
-
-
def get_startup_alert(car_recognized, controller_available):
alert = 'startup'
if not car_recognized:
@@ -69,14 +56,8 @@ def only_toyota_left(candidate_cars):
# BOUNTY: every added fingerprint in selfdrive/car/*/values.py is a $100 coupon code on shop.comma.ai
# **** for use live only ****
def fingerprint(logcan, sendcan, has_relay):
- params = Params()
- car_params = params.get("CarParams")
-
- if car_params is not None:
- # use already stored VIN: a new VIN query cannot be done, since panda isn't in ELM327 mode
- car_params = car.CarParams.from_bytes(car_params)
- vin = VIN_UNKNOWN if car_params.carVin == "" else car_params.carVin
- elif has_relay:
+
+ if has_relay:
# Vin query only reliably works thorugh OBDII
vin = get_vin(logcan, sendcan, 1)
else:
@@ -93,7 +74,7 @@ def fingerprint(logcan, sendcan, has_relay):
done = False
while not done:
- a = get_one_can(logcan)
+ a = messaging.get_one_can(logcan)
for can in a.can:
# need to independently try to fingerprint both bus 0 and 1 to work
diff --git a/selfdrive/car/chrysler/carcontroller.py b/selfdrive/car/chrysler/carcontroller.py
index 7e2dc5cff6..ed92b1427d 100644
--- a/selfdrive/car/chrysler/carcontroller.py
+++ b/selfdrive/car/chrysler/carcontroller.py
@@ -1,16 +1,9 @@
from selfdrive.car import apply_toyota_steer_torque_limits
from selfdrive.car.chrysler.chryslercan import create_lkas_hud, create_lkas_command, \
create_wheel_buttons
-from selfdrive.car.chrysler.values import ECU, CAR
+from selfdrive.car.chrysler.values import ECU, CAR, SteerLimitParams
from selfdrive.can.packer import CANPacker
-class SteerLimitParams:
- STEER_MAX = 261 # 262 faults
- STEER_DELTA_UP = 3 # 3 is stock. 100 is fine. 200 is too much it seems
- STEER_DELTA_DOWN = 3 # no faults on the way down it seems
- STEER_ERROR_MAX = 80
-
-
class CarController():
def __init__(self, dbc_name, car_fingerprint, enable_camera):
self.braking = False
diff --git a/selfdrive/car/chrysler/values.py b/selfdrive/car/chrysler/values.py
index 1832c8cd08..ebd7cad875 100644
--- a/selfdrive/car/chrysler/values.py
+++ b/selfdrive/car/chrysler/values.py
@@ -1,5 +1,13 @@
from selfdrive.car import dbc_dict
+class SteerLimitParams:
+ STEER_MAX = 261 # 262 faults
+ STEER_DELTA_UP = 3 # 3 is stock. 100 is fine. 200 is too much it seems
+ STEER_DELTA_DOWN = 3 # no faults on the way down it seems
+ STEER_ERROR_MAX = 80
+
+
+
class CAR:
PACIFICA_2017_HYBRID = "CHRYSLER PACIFICA HYBRID 2017"
PACIFICA_2018_HYBRID = "CHRYSLER PACIFICA HYBRID 2018"
diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py
index 2390997bcb..213f767652 100755
--- a/selfdrive/car/gm/interface.py
+++ b/selfdrive/car/gm/interface.py
@@ -61,7 +61,6 @@ class CarInterface(CarInterfaceBase):
candidate == CAR.CADILLAC_CT6
ret.openpilotLongitudinalControl = ret.enableCamera
tire_stiffness_factor = 0.444 # not optimized yet
- ret.safetyModelPassive = car.CarParams.SafetyModel.gmPassive
if candidate == CAR.VOLT:
# supports stop and go, but initial engage must be above 18mph (which include conservatism)
diff --git a/selfdrive/car/honda/carstate.py b/selfdrive/car/honda/carstate.py
index bb974b3d14..792542167b 100644
--- a/selfdrive/car/honda/carstate.py
+++ b/selfdrive/car/honda/carstate.py
@@ -354,19 +354,3 @@ class CarState():
# TODO: discover the CAN msg that has the imperial unit bit for all other cars
self.is_metric = not cp.vl["HUD_SETTING"]['IMPERIAL_UNIT'] if self.CP.carFingerprint in (CAR.CIVIC) else False
-
-# carstate standalone tester
-if __name__ == '__main__':
- import zmq
- context = zmq.Context()
-
- class CarParams():
- def __init__(self):
- self.carFingerprint = "HONDA CIVIC 2016 TOURING"
- self.enableGasInterceptor = 0
- CP = CarParams()
- CS = CarState(CP)
-
- # while 1:
- # CS.update()
- # time.sleep(0.01)
diff --git a/selfdrive/car/honda/values.py b/selfdrive/car/honda/values.py
index ab94068130..90dfd4eab3 100644
--- a/selfdrive/car/honda/values.py
+++ b/selfdrive/car/honda/values.py
@@ -81,8 +81,9 @@ FINGERPRINTS = {
CAR.CRV: [{
57: 3, 145: 8, 316: 8, 340: 8, 342: 6, 344: 8, 380: 8, 398: 3, 399: 6, 401: 8, 404: 4, 420: 8, 422: 8, 426: 8, 432: 7, 464: 8, 474: 5, 476: 4, 487: 4, 490: 8, 493: 3, 506: 8, 507: 1, 512: 6, 513: 6, 542: 7, 545: 4, 597: 8, 660: 8, 661: 4, 773: 7, 777: 8, 780: 8, 800: 8, 804: 8, 808: 8, 829: 5, 882: 2, 884: 7, 888: 8, 891: 8, 892: 8, 923: 2, 929: 8, 983: 8, 985: 3, 1024: 5, 1027: 5, 1029: 8, 1033: 5, 1036: 8, 1039: 8, 1057: 5, 1064: 7, 1108: 8, 1125: 8, 1296: 8, 1365: 5, 1424: 5, 1600: 5, 1601: 8,
}],
+ # msg 1115 has seen with len 2 and 4, so ignore it
CAR.CRV_5G: [{
- 57: 3, 148: 8, 199: 4, 228: 5, 231: 5, 232: 7, 304: 8, 330: 8, 340: 8, 344: 8, 380: 8, 399: 7, 401: 8, 420: 8, 423: 2, 427: 3, 428: 8, 432: 7, 441: 5, 446: 3, 450: 8, 464: 8, 467: 2, 469: 3, 470: 2, 474: 8, 476: 7, 477: 8, 479: 8, 490: 8, 493: 5, 495: 8, 507: 1, 545: 6, 597: 8, 661: 4, 662: 4, 773: 7, 777: 8, 780: 8, 795: 8, 800: 8, 804: 8, 806: 8, 808: 8, 814: 4, 815: 8, 817: 4, 825: 4, 829: 5, 862: 8, 881: 8, 882: 4, 884: 8, 888: 8, 891: 8, 927: 8, 918: 7, 929: 8, 983: 8, 985: 3, 1024: 5, 1027: 5, 1029: 8, 1036: 8, 1039: 8, 1064: 7, 1108: 8, 1092: 1, 1115: 4, 1125: 8, 1127: 2, 1296: 8, 1302: 8, 1322: 5, 1361: 5, 1365: 5, 1424: 5, 1600: 5, 1601: 8, 1618: 5, 1633: 8, 1670: 5
+ 57: 3, 148: 8, 199: 4, 228: 5, 231: 5, 232: 7, 304: 8, 330: 8, 340: 8, 344: 8, 380: 8, 399: 7, 401: 8, 420: 8, 423: 2, 427: 3, 428: 8, 432: 7, 441: 5, 446: 3, 450: 8, 464: 8, 467: 2, 469: 3, 470: 2, 474: 8, 476: 7, 477: 8, 479: 8, 490: 8, 493: 5, 495: 8, 507: 1, 545: 6, 597: 8, 661: 4, 662: 4, 773: 7, 777: 8, 780: 8, 795: 8, 800: 8, 804: 8, 806: 8, 808: 8, 814: 4, 815: 8, 817: 4, 825: 4, 829: 5, 862: 8, 881: 8, 882: 4, 884: 8, 888: 8, 891: 8, 927: 8, 918: 7, 929: 8, 983: 8, 985: 3, 1024: 5, 1027: 5, 1029: 8, 1036: 8, 1039: 8, 1064: 7, 1108: 8, 1092: 1, 1125: 8, 1127: 2, 1296: 8, 1302: 8, 1322: 5, 1361: 5, 1365: 5, 1424: 5, 1600: 5, 1601: 8, 1618: 5, 1633: 8, 1670: 5
}],
CAR.CRV_HYBRID: [{
57: 3, 148: 8, 228: 5, 304: 8, 330: 8, 344: 8, 380: 8, 387: 8, 388: 8, 399: 7, 408: 6, 415: 6, 419: 8, 420: 8, 427: 3, 428: 8, 432: 7, 441: 5, 450: 8, 464: 8, 477: 8, 479: 8, 490: 8, 495: 8, 525: 8, 531: 8, 545: 6, 662: 4, 773: 7, 777: 8, 780: 8, 804: 8, 806: 8, 808: 8, 814: 4, 829: 5, 833: 6, 862: 8, 884: 8, 891: 8, 927: 8, 929: 8, 930: 8, 931: 8, 1302: 8, 1361: 5, 1365: 5, 1600: 5, 1601: 8, 1626: 5, 1627: 5
diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py
index 729c853628..daf3ca3142 100644
--- a/selfdrive/car/hyundai/carcontroller.py
+++ b/selfdrive/car/hyundai/carcontroller.py
@@ -2,19 +2,10 @@ from selfdrive.car import apply_std_steer_torque_limits
from selfdrive.car.hyundai.hyundaican import create_lkas11, create_lkas12, \
create_1191, create_1156, \
create_clu11
-from selfdrive.car.hyundai.values import Buttons
+from selfdrive.car.hyundai.values import Buttons, SteerLimitParams
from selfdrive.can.packer import CANPacker
-# Steer torque limits
-
-class SteerLimitParams:
- STEER_MAX = 255 # 409 is the max, 255 is stock
- STEER_DELTA_UP = 3
- STEER_DELTA_DOWN = 7
- STEER_DRIVER_ALLOWANCE = 50
- STEER_DRIVER_MULTIPLIER = 2
- STEER_DRIVER_FACTOR = 1
class CarController():
def __init__(self, dbc_name, car_fingerprint):
diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py
index e801260a95..f2a800a9da 100644
--- a/selfdrive/car/hyundai/values.py
+++ b/selfdrive/car/hyundai/values.py
@@ -9,6 +9,16 @@ def get_hud_alerts(visual_alert):
else:
return 0
+# Steer torque limits
+
+class SteerLimitParams:
+ STEER_MAX = 255 # 409 is the max, 255 is stock
+ STEER_DELTA_UP = 3
+ STEER_DELTA_DOWN = 7
+ STEER_DRIVER_ALLOWANCE = 50
+ STEER_DRIVER_MULTIPLIER = 2
+ STEER_DRIVER_FACTOR = 1
+
class CAR:
ELANTRA = "HYUNDAI ELANTRA LIMITED ULTIMATE 2017"
GENESIS = "HYUNDAI GENESIS 2018"
diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py
index 0d619cb950..0c7c2c81dc 100644
--- a/selfdrive/car/interfaces.py
+++ b/selfdrive/car/interfaces.py
@@ -13,6 +13,10 @@ class CarInterfaceBase():
def calc_accel_override(a_ego, a_target, v_ego, v_target):
return 1.
+ @staticmethod
+ def compute_gb(accel, speed):
+ raise NotImplementedError
+
@staticmethod
def get_params(candidate, fingerprint=gen_empty_fingerprint(), vin="", has_relay=False):
raise NotImplementedError
diff --git a/selfdrive/car/lock_safety_model.py b/selfdrive/car/lock_safety_model.py
deleted file mode 100755
index 055d8c0c2b..0000000000
--- a/selfdrive/car/lock_safety_model.py
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env python3
-import sys
-from cereal import car
-from common.params import Params
-
-# This script locks the safety model to a given value.
-# When the safety model is locked, boardd will preset panda to the locked safety model
-
-# run example:
-# ./lock_safety_model.py gm
-
-if __name__ == "__main__":
-
- params = Params()
-
- if len(sys.argv) < 2:
- params.delete("SafetyModelLock")
- print("Clear locked safety model")
-
- else:
- safety_model = getattr(car.CarParams.SafetyModel, sys.argv[1])
- if type(safety_model) != int:
- raise Exception("Invalid safety model: " + sys.argv[1])
- if safety_model == car.CarParams.SafetyModel.allOutput:
- raise Exception("Locking the safety model to allOutput is not allowed")
- params.put("SafetyModelLock", str(safety_model))
- print("Locked safety model: " + sys.argv[1])
diff --git a/selfdrive/car/mock/interface.py b/selfdrive/car/mock/interface.py
index 3b768d2838..a46b93aa61 100755
--- a/selfdrive/car/mock/interface.py
+++ b/selfdrive/car/mock/interface.py
@@ -1,7 +1,6 @@
#!/usr/bin/env python3
from cereal import car
from selfdrive.config import Conversions as CV
-from selfdrive.services import service_list
from selfdrive.swaglog import cloudlog
import selfdrive.messaging as messaging
from selfdrive.car import gen_empty_fingerprint
@@ -16,15 +15,14 @@ LPG = 2 * 3.1415 * YAW_FR * TS / (1 + 2 * 3.1415 * YAW_FR * TS)
class CarInterface(CarInterfaceBase):
def __init__(self, CP, CarController):
-
self.CP = CP
self.CC = CarController
cloudlog.debug("Using Mock Car Interface")
# TODO: subscribe to phone sensor
- self.sensor = messaging.sub_sock(service_list['sensorEvents'].port)
- self.gps = messaging.sub_sock(service_list['gpsLocation'].port)
+ self.sensor = messaging.sub_sock('sensorEvents')
+ self.gps = messaging.sub_sock('gpsLocation')
self.speed = 0.
self.prev_speed = 0.
diff --git a/selfdrive/car/subaru/carcontroller.py b/selfdrive/car/subaru/carcontroller.py
index 6005976fae..e7b9b7d94d 100644
--- a/selfdrive/car/subaru/carcontroller.py
+++ b/selfdrive/car/subaru/carcontroller.py
@@ -1,7 +1,7 @@
#from common.numpy_fast import clip
from selfdrive.car import apply_std_steer_torque_limits
from selfdrive.car.subaru import subarucan
-from selfdrive.car.subaru.values import CAR, DBC
+from selfdrive.car.subaru.values import DBC
from selfdrive.can.packer import CANPacker
@@ -11,10 +11,9 @@ class CarControllerParams():
self.STEER_STEP = 2 # how often we update the steer cmd
self.STEER_DELTA_UP = 50 # torque increase per refresh, 0.8s to max
self.STEER_DELTA_DOWN = 70 # torque decrease per refresh
- if car_fingerprint == CAR.IMPREZA:
- self.STEER_DRIVER_ALLOWANCE = 60 # allowed driver torque before start limiting
- self.STEER_DRIVER_MULTIPLIER = 10 # weight driver torque heavily
- self.STEER_DRIVER_FACTOR = 1 # from dbc
+ self.STEER_DRIVER_ALLOWANCE = 60 # allowed driver torque before start limiting
+ self.STEER_DRIVER_MULTIPLIER = 10 # weight driver torque heavily
+ self.STEER_DRIVER_FACTOR = 1 # from dbc
@@ -30,7 +29,6 @@ class CarController():
# Setup detection helper. Routes commands to
# an appropriate CAN bus number.
self.params = CarControllerParams(car_fingerprint)
- print(DBC)
self.packer = CANPacker(DBC[car_fingerprint]['pt'])
def update(self, enabled, CS, frame, actuators, pcm_cancel_cmd, visual_alert, left_line, right_line):
diff --git a/selfdrive/car/subaru/carstate.py b/selfdrive/car/subaru/carstate.py
index cc24f63d2a..f0256de3d0 100644
--- a/selfdrive/car/subaru/carstate.py
+++ b/selfdrive/car/subaru/carstate.py
@@ -123,7 +123,7 @@ class CarState():
self.v_cruise_pcm *= CV.MPH_TO_KPH
v_wheel = (self.v_wheel_fl + self.v_wheel_fr + self.v_wheel_rl + self.v_wheel_rr) / 4.
- # Kalman filter, even though Hyundai raw wheel speed is heaviliy filtered by default
+ # Kalman filter, even though Subaru raw wheel speed is heaviliy filtered by default
if abs(v_wheel - self.v_ego) > 2.0: # Prevent large accelerations when car starts at non zero speed
self.v_ego_kf.x = [[v_wheel], [0.0]]
diff --git a/selfdrive/car/subaru/values.py b/selfdrive/car/subaru/values.py
index 9abbaef3c8..7292a135c0 100644
--- a/selfdrive/car/subaru/values.py
+++ b/selfdrive/car/subaru/values.py
@@ -7,7 +7,7 @@ FINGERPRINTS = {
CAR.IMPREZA: [{
2: 8, 64: 8, 65: 8, 72: 8, 73: 8, 280: 8, 281: 8, 290: 8, 312: 8, 313: 8, 314: 8, 315: 8, 316: 8, 326: 8, 544: 8, 545: 8, 546: 8, 552: 8, 554: 8, 557: 8, 576: 8, 577: 8, 722: 8, 801: 8, 802: 8, 805: 8, 808: 8, 816: 8, 826: 8, 837: 8, 838: 8, 839: 8, 842: 8, 912: 8, 915: 8, 940: 8, 1614: 8, 1617: 8, 1632: 8, 1650: 8, 1657: 8, 1658: 8, 1677: 8, 1697: 8, 1722: 8, 1743: 8, 1759: 8, 1786: 5, 1787: 5, 1788: 8, 1809: 8, 1813: 8, 1817: 8, 1821: 8, 1840: 8, 1848: 8, 1924: 8, 1932: 8, 1952: 8, 1960: 8
},
- # Crosstrek 2018 (same platform as Subaru)
+ # Crosstrek 2018 (same platform as Impreza)
{
2: 8, 64: 8, 65: 8, 72: 8, 73: 8, 256: 8, 280: 8, 281: 8, 290: 8, 312: 8, 313: 8, 314: 8, 315: 8, 316: 8, 326: 8, 372: 8, 544: 8, 545: 8, 546: 8, 554: 8, 557: 8, 576: 8, 577: 8, 722: 8, 801: 8, 802: 8, 805: 8, 808: 8, 811: 8, 826: 8, 837: 8, 838: 8, 839: 8, 842: 8, 912: 8, 915: 8, 940: 8, 1614: 8, 1617: 8, 1632: 8, 1650: 8, 1657: 8, 1658: 8, 1677: 8, 1697: 8, 1759: 8, 1786: 5, 1787: 5, 1788: 8
}],
diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py
index 094588d57e..ae37ec463d 100644
--- a/selfdrive/car/toyota/carcontroller.py
+++ b/selfdrive/car/toyota/carcontroller.py
@@ -2,11 +2,11 @@ from cereal import car
from common.numpy_fast import clip, interp
from selfdrive.car import apply_toyota_steer_torque_limits
from selfdrive.car import create_gas_command
-from selfdrive.car.toyota.toyotacan import make_can_msg, create_video_target,\
+from selfdrive.car.toyota.toyotacan import make_can_msg, \
create_steer_command, create_ui_command, \
create_ipas_steer_command, create_accel_command, \
create_acc_cancel_command, create_fcw_command
-from selfdrive.car.toyota.values import CAR, ECU, STATIC_MSGS, TSS2_CAR
+from selfdrive.car.toyota.values import CAR, ECU, STATIC_MSGS, TSS2_CAR, SteerLimitParams
from selfdrive.can.packer import CANPacker
VisualAlert = car.CarControl.HUDControl.VisualAlert
@@ -17,12 +17,6 @@ ACCEL_MAX = 1.5 # 1.5 m/s2
ACCEL_MIN = -3.0 # 3 m/s2
ACCEL_SCALE = max(ACCEL_MAX, -ACCEL_MIN)
-# Steer torque limits
-class SteerLimitParams:
- STEER_MAX = 1500
- STEER_DELTA_UP = 10 # 1.5s time to peak torque
- STEER_DELTA_DOWN = 25 # always lower than 45 otherwise the Rav4 faults (Prius seems ok with 50)
- STEER_ERROR_MAX = 350 # max delta between torque cmd and torque motor
# Steer angle limits (tested at the Crows Landing track and considered ok)
ANGLE_MAX_BP = [0., 5.]
@@ -114,9 +108,8 @@ class CarController():
self.packer = CANPacker(dbc_name)
- def update(self, enabled, CS, frame, actuators,
- pcm_cancel_cmd, hud_alert, forwarding_camera, left_line,
- right_line, lead, left_lane_depart, right_lane_depart):
+ def update(self, enabled, CS, frame, actuators, pcm_cancel_cmd, hud_alert,
+ left_line, right_line, lead, left_lane_depart, right_lane_depart):
# *** compute control surfaces ***
@@ -223,10 +216,6 @@ class CarController():
# This prevents unexpected pedal range rescaling
can_sends.append(create_gas_command(self.packer, apply_gas, frame//2))
- if frame % 10 == 0 and ECU.CAM in self.fake_ecus and not forwarding_camera:
- for addr in TARGET_IDS:
- can_sends.append(create_video_target(frame//10, addr))
-
# ui mesg is at 100Hz but we send asap if:
# - there is something to display
# - there is something to stop displaying
@@ -253,19 +242,7 @@ class CarController():
#*** static msgs ***
for (addr, ecu, cars, bus, fr_step, vl) in STATIC_MSGS:
- if frame % fr_step == 0 and ecu in self.fake_ecus and self.car_fingerprint in cars and not (ecu == ECU.CAM and forwarding_camera):
- # special cases
- if fr_step == 5 and ecu == ECU.CAM and bus == 1:
- cnt = (((frame // 5) % 7) + 1) << 5
- vl = bytes([cnt]) + vl
- elif addr in (0x489, 0x48a) and bus == 0:
- # add counter for those 2 messages (last 4 bits)
- cnt = ((frame // 100) % 0xf) + 1
- if addr == 0x48a:
- # 0x48a has a 8 preceding the counter
- cnt += 1 << 7
- vl += bytes([cnt])
-
+ if frame % fr_step == 0 and ecu in self.fake_ecus and self.car_fingerprint in cars:
can_sends.append(make_can_msg(addr, vl, bus, False))
return can_sends
diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py
index 66b9ae5d14..a351590ca1 100755
--- a/selfdrive/car/toyota/interface.py
+++ b/selfdrive/car/toyota/interface.py
@@ -28,8 +28,6 @@ class CarInterface(CarInterfaceBase):
self.cp = get_can_parser(CP)
self.cp_cam = get_cam_can_parser(CP)
- self.forwarding_camera = False
-
self.CC = None
if CarController is not None:
self.CC = CarController(self.cp.dbc_name, CP.carFingerprint, CP.enableCamera, CP.enableDsu, CP.enableApgs)
@@ -370,11 +368,9 @@ class CarInterface(CarInterfaceBase):
# events
events = []
- if self.cp_cam.can_valid:
- self.forwarding_camera = True
if self.cp_cam.can_invalid_cnt >= 100 and self.CP.enableCamera:
- events.append(create_event('invalidGiraffeToyota', [ET.PERMANENT]))
+ events.append(create_event('invalidGiraffeToyota', [ET.PERMANENT, ET.NO_ENTRY]))
if not ret.gearShifter == GearShifter.drive and self.CP.enableDsu:
events.append(create_event('wrongGear', [ET.NO_ENTRY, ET.SOFT_DISABLE]))
if ret.doorOpen:
@@ -427,8 +423,8 @@ class CarInterface(CarInterfaceBase):
def apply(self, c):
can_sends = self.CC.update(c.enabled, self.CS, self.frame,
- c.actuators, c.cruiseControl.cancel, c.hudControl.visualAlert,
- self.forwarding_camera, c.hudControl.leftLaneVisible,
+ c.actuators, c.cruiseControl.cancel,
+ c.hudControl.visualAlert, c.hudControl.leftLaneVisible,
c.hudControl.rightLaneVisible, c.hudControl.leadVisible,
c.hudControl.leftLaneDepart, c.hudControl.rightLaneDepart)
diff --git a/selfdrive/car/toyota/toyotacan.py b/selfdrive/car/toyota/toyotacan.py
index 7125ecbf3e..92d1c2ea26 100644
--- a/selfdrive/car/toyota/toyotacan.py
+++ b/selfdrive/car/toyota/toyotacan.py
@@ -22,12 +22,6 @@ def make_can_msg(addr, dat, alt, cks=False):
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)
- return make_can_msg(addr, msg, 1, True)
-
-
def create_ipas_steer_command(packer, steer, enabled, apgs_enabled):
"""Creates a CAN message for the Toyota Steer Command."""
if steer < 0:
diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py
index e3bacab9c9..dae175db02 100644
--- a/selfdrive/car/toyota/values.py
+++ b/selfdrive/car/toyota/values.py
@@ -1,5 +1,12 @@
from selfdrive.car import dbc_dict
+# Steer torque limits
+class SteerLimitParams:
+ STEER_MAX = 1500
+ STEER_DELTA_UP = 10 # 1.5s time to peak torque
+ STEER_DELTA_DOWN = 25 # always lower than 45 otherwise the Rav4 faults (Prius seems ok with 50)
+ STEER_ERROR_MAX = 350 # max delta between torque cmd and torque motor
+
class CAR:
PRIUS = "TOYOTA PRIUS 2017"
RAV4H = "TOYOTA RAV4 HYBRID 2017"
@@ -31,21 +38,6 @@ class ECU:
# addr: (ecu, cars, bus, 1/freq*100, vl)
STATIC_MSGS = [
- (0x130, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON), 1, 100, b'\x00\x00\x00\x00\x00\x00\x38'),
- (0x240, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON), 1, 5, b'\x00\x10\x01\x00\x10\x01\x00'),
- (0x241, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON), 1, 5, b'\x00\x10\x01\x00\x10\x01\x00'),
- (0x244, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON), 1, 5, b'\x00\x10\x01\x00\x10\x01\x00'),
- (0x245, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON), 1, 5, b'\x00\x10\x01\x00\x10\x01\x00'),
- (0x248, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON), 1, 5, b'\x00\x00\x00\x00\x00\x00\x01'),
- (0x367, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON), 0, 40, b'\x06\x00'),
- (0x414, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON), 0, 100, b'\x00\x00\x00\x00\x00\x00\x17\x00'),
- (0x466, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.HIGHLANDER, CAR.HIGHLANDERH), 1, 100, b'\x20\x20\xAD'),
- (0x466, ECU.CAM, (CAR.COROLLA, CAR.AVALON), 1, 100, b'\x24\x20\xB1'),
- (0x489, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON), 0, 100, b'\x00\x00\x00\x00\x00\x00\x00'),
- (0x48a, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON), 0, 100, b'\x00\x00\x00\x00\x00\x00\x00'),
- (0x48b, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON), 0, 100, b'\x66\x06\x08\x0a\x02\x00\x00\x00'),
- (0x4d3, ECU.CAM, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA, CAR.AVALON), 0, 100, b'\x1C\x00\x00\x01\x00\x00\x00\x00'),
-
(0x128, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA, CAR.AVALON), 1, 3, b'\xf4\x01\x90\x83\x00\x37'),
(0x128, ECU.DSU, (CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.SIENNA, CAR.LEXUS_CTH), 1, 3, b'\x03\x00\x20\x00\x00\x52'),
(0x141, ECU.DSU, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.HIGHLANDERH, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH), 1, 2, b'\x00\x00\x00\x46'),
@@ -185,12 +177,11 @@ FINGERPRINTS = {
36: 8, 37: 8, 114: 5, 170: 8, 180: 8, 186: 4, 401: 8, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 550: 8, 552: 4, 562: 6, 608: 8, 610: 8, 643: 7, 705: 8, 728: 8, 740: 5, 742: 8, 743: 8, 761: 8, 764: 8, 765: 8, 800: 8, 810: 2, 812: 8, 824: 8, 829: 2, 830: 7, 835: 8, 836: 8, 865: 8, 869: 7, 870: 7, 871: 2, 877: 8, 881: 8, 896: 8, 898: 8, 900: 6, 902: 6, 905: 8, 913: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 976: 1, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1059: 1, 1076: 8, 1077: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1172: 8, 1235: 8, 1237: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1595: 8, 1649: 8, 1745: 8, 1775: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1808: 8, 1809: 8, 1816: 8, 1817: 8, 1840: 8, 1848: 8, 1904: 8, 1912: 8, 1940: 8, 1941: 8, 1948: 8, 1949: 8, 1952: 8, 1960: 8, 1981: 8, 1986: 8, 1990: 8, 1994: 8, 1998: 8, 2004: 8
}],
CAR.COROLLAH_TSS2: [
- # 2019 Taiwan Altis Hybrid
- {
+ # 2019 Taiwan Altis Hybrid
+ {
36: 8, 37: 8, 166: 8, 170: 8, 180: 8, 295: 8, 296: 8, 401: 8, 426: 6, 452: 8, 466: 8, 467: 8, 550: 8, 552: 4, 560: 7, 562: 6, 581: 5, 608: 8, 610: 8, 643: 7, 713: 8, 728: 8, 740: 5, 742: 8, 743: 8, 761: 8, 765: 8, 800: 8, 810: 2, 829: 2, 830: 7, 835: 8, 836: 8, 865: 8, 869: 7, 870: 7, 871: 2, 877: 8, 881: 8, 885: 8, 896: 8, 898: 8, 918: 7, 921: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 8, 955: 8, 956: 8, 971: 7, 975: 5, 987: 8, 993: 8, 1002: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1057: 8, 1059: 1, 1071: 8, 1082: 8, 1112: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1172: 8, 1235: 8, 1237: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1592: 8, 1594: 8, 1595: 8, 1745: 8, 1775: 8, 1779: 8
}],
- CAR.LEXUS_ES_TSS2: [
- {
+ CAR.LEXUS_ES_TSS2: [{
36: 8, 37: 8, 114: 5, 119: 6, 120: 4, 170: 8, 180: 8, 186: 4, 401: 8, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 544: 4, 550: 8, 552: 4, 562: 6, 608: 8, 610: 8, 643: 7, 658: 8, 705: 8, 728: 8, 740: 5, 761: 8, 764: 8, 765: 8, 800: 8, 810: 2, 812: 8, 814: 8, 818: 8, 824: 8, 830: 7, 835: 8, 836: 8, 865: 8, 869: 7, 870: 7, 871: 2, 877: 8, 881: 8, 882: 8, 885: 8, 889: 8, 896: 8, 898: 8, 900: 6, 902: 6, 905: 8, 913: 8, 918: 8, 921: 8, 933: 8, 934: 8, 935: 8, 944: 8, 945: 8, 951: 8, 955: 8, 956: 8, 976: 1, 987: 8, 998: 5, 999: 7, 1000: 8, 1001: 8, 1002: 8, 1014: 8, 1017: 8, 1020: 8, 1041: 8, 1042: 8, 1044: 8, 1056: 8, 1059: 1, 1076: 8, 1077: 8, 1082: 8, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1164: 8, 1165: 8, 1166: 8, 1167: 8, 1172: 8, 1228: 8, 1235: 8, 1237: 8, 1264: 8, 1279: 8, 1541: 8, 1552: 8, 1553: 8, 1556: 8, 1557: 8, 1568: 8, 1570: 8, 1571: 8, 1572: 8, 1575: 8, 1592: 8, 1594: 8, 1595: 8, 1649: 8, 1696: 8, 1775: 8, 1777: 8, 1779: 8, 1786: 8, 1787: 8, 1788: 8, 1789: 8, 1904: 8, 1912: 8
}],
CAR.LEXUS_ESH_TSS2: [
diff --git a/selfdrive/car/vin.py b/selfdrive/car/vin.py
index 76fd34ca6d..eac0316db4 100755
--- a/selfdrive/car/vin.py
+++ b/selfdrive/car/vin.py
@@ -80,7 +80,7 @@ def get_vin(logcan, sendcan, bus, query_time=1.):
# 1s max of VIN query time
while frame < query_time * 100:
- a = messaging.recv_one(logcan)
+ a = messaging.get_one_can(logcan)
for can in a.can:
vin_query.check_response(can)
@@ -92,7 +92,6 @@ def get_vin(logcan, sendcan, bus, query_time=1.):
if __name__ == "__main__":
- from selfdrive.services import service_list
- logcan = messaging.sub_sock(service_list['can'].port)
- sendcan = messaging.pub_sock(service_list['sendcan'].port)
+ logcan = messaging.sub_sock('can')
+ sendcan = messaging.pub_sock('sendcan')
print(get_vin(logcan, sendcan, 0))
diff --git a/selfdrive/car/volkswagen/__init__.py b/selfdrive/car/volkswagen/__init__.py
new file mode 100644
index 0000000000..8b13789179
--- /dev/null
+++ b/selfdrive/car/volkswagen/__init__.py
@@ -0,0 +1 @@
+
diff --git a/selfdrive/car/volkswagen/carcontroller.py b/selfdrive/car/volkswagen/carcontroller.py
new file mode 100644
index 0000000000..4ec662dce4
--- /dev/null
+++ b/selfdrive/car/volkswagen/carcontroller.py
@@ -0,0 +1,188 @@
+from cereal import car
+from selfdrive.car import apply_std_steer_torque_limits
+from selfdrive.car.volkswagen import volkswagencan
+from selfdrive.car.volkswagen.values import DBC, MQB_LDW_MESSAGES, BUTTON_STATES, CarControllerParams
+from selfdrive.can.packer import CANPacker
+
+VisualAlert = car.CarControl.HUDControl.VisualAlert
+
+
+class CarController():
+ def __init__(self, canbus, car_fingerprint):
+ self.apply_steer_last = 0
+ self.car_fingerprint = car_fingerprint
+
+ # Setup detection helper. Routes commands to an appropriate CAN bus number.
+ self.canbus = canbus
+ self.packer_gw = CANPacker(DBC[car_fingerprint]['pt'])
+
+ self.hcaSameTorqueCount = 0
+ self.hcaEnabledFrameCount = 0
+ self.graButtonStatesToSend = None
+ self.graMsgSentCount = 0
+ self.graMsgStartFramePrev = 0
+ self.graMsgBusCounterPrev = 0
+
+ def update(self, enabled, CS, frame, actuators, visual_alert, audible_alert, leftLaneVisible, rightLaneVisible):
+ """ Controls thread """
+
+ P = CarControllerParams
+
+ # Send CAN commands.
+ can_sends = []
+ canbus = self.canbus
+
+ #--------------------------------------------------------------------------
+ # #
+ # Prepare HCA_01 Heading Control Assist messages with steering torque. #
+ # #
+ #--------------------------------------------------------------------------
+
+ # The factory camera sends at 50Hz while steering and 1Hz when not. When
+ # OP is active, Panda filters HCA_01 from the factory camera and OP emits
+ # HCA_01 at 50Hz. Rate switching creates some confusion in Cabana and
+ # doesn't seem to add value at this time. The rack will accept HCA_01 at
+ # 100Hz if we want to control at finer resolution in the future.
+ if frame % P.HCA_STEP == 0:
+
+ # FAULT AVOIDANCE: HCA must not be enabled at standstill. Also stop
+ # commanding HCA if there's a fault, so the steering rack recovers.
+ if enabled and not (CS.standstill or CS.steeringFault):
+
+ # FAULT AVOIDANCE: Requested HCA torque must not exceed 3.0 Nm. This
+ # is inherently handled by scaling to STEER_MAX. The rack doesn't seem
+ # to care about up/down rate, but we have some evidence it may do its
+ # own rate limiting, and matching OP helps for accurate tuning.
+ apply_steer = int(round(actuators.steer * P.STEER_MAX))
+ apply_steer = apply_std_steer_torque_limits(apply_steer, self.apply_steer_last, CS.steeringTorque, P)
+
+ # FAULT AVOIDANCE: HCA must not be enabled for >360 seconds. Sending
+ # a single frame with HCA disabled is an effective workaround.
+ if apply_steer == 0:
+ # We can usually reset the timer for free, just by disabling HCA
+ # when apply_steer is exactly zero, which happens by chance during
+ # many steer torque direction changes. This could be expanded with
+ # a small dead-zone to capture all zero crossings, but not seeing a
+ # major need at this time.
+ hcaEnabled = False
+ self.hcaEnabledFrameCount = 0
+ else:
+ self.hcaEnabledFrameCount += 1
+ if self.hcaEnabledFrameCount >= 118 * (100 / P.HCA_STEP): # 118s
+ # The Kansas I-70 Crosswind Problem: if we truly do need to steer
+ # in one direction for > 360 seconds, we have to disable HCA for a
+ # frame while actively steering. Testing shows we can just set the
+ # disabled flag, and keep sending non-zero torque, which keeps the
+ # Panda torque rate limiting safety happy. Do so 3x within the 360
+ # second window for safety and redundancy.
+ hcaEnabled = False
+ self.hcaEnabledFrameCount = 0
+ else:
+ hcaEnabled = True
+ # FAULT AVOIDANCE: HCA torque must not be static for > 6 seconds.
+ # This is to detect the sending camera being stuck or frozen. OP
+ # can trip this on a curve if steering is saturated. Avoid this by
+ # reducing torque 0.01 Nm for one frame. Do so 3x within the 6
+ # second period for safety and redundancy.
+ if self.apply_steer_last == apply_steer:
+ self.hcaSameTorqueCount += 1
+ if self.hcaSameTorqueCount > 1.9 * (100 / P.HCA_STEP): # 1.9s
+ apply_steer -= (1, -1)[apply_steer < 0]
+ self.hcaSameTorqueCount = 0
+ else:
+ self.hcaSameTorqueCount = 0
+
+ else:
+ # Continue sending HCA_01 messages, with the enable flags turned off.
+ hcaEnabled = False
+ apply_steer = 0
+
+ self.apply_steer_last = apply_steer
+ idx = (frame / P.HCA_STEP) % 16
+ can_sends.append(volkswagencan.create_mqb_steering_control(self.packer_gw, canbus.gateway, apply_steer,
+ idx, hcaEnabled))
+
+ #--------------------------------------------------------------------------
+ # #
+ # Prepare LDW_02 HUD messages with lane borders, confidence levels, and #
+ # the LKAS status LED. #
+ # #
+ #--------------------------------------------------------------------------
+
+ # The factory camera emits this message at 10Hz. When OP is active, Panda
+ # filters LDW_02 from the factory camera and OP emits LDW_02 at 10Hz.
+
+ if frame % P.LDW_STEP == 0:
+ hcaEnabled = True if enabled and not CS.standstill else False
+
+ if visual_alert == VisualAlert.steerRequired:
+ hud_alert = MQB_LDW_MESSAGES["laneAssistTakeOverSilent"]
+ else:
+ hud_alert = MQB_LDW_MESSAGES["none"]
+
+ can_sends.append(volkswagencan.create_mqb_hud_control(self.packer_gw, canbus.gateway, hcaEnabled,
+ CS.steeringPressed, hud_alert, leftLaneVisible,
+ rightLaneVisible))
+
+ #--------------------------------------------------------------------------
+ # #
+ # Prepare GRA_ACC_01 ACC control messages with button press events. #
+ # #
+ #--------------------------------------------------------------------------
+
+ # The car sends this message at 33hz. OP sends it on-demand only for
+ # virtual button presses.
+ #
+ # First create any virtual button press event needed by openpilot, to sync
+ # stock ACC with OP disengagement, or to auto-resume from stop.
+
+ if frame > self.graMsgStartFramePrev + P.GRA_VBP_STEP:
+ if not enabled and CS.accEnabled:
+ # Cancel ACC if it's engaged with OP disengaged.
+ self.graButtonStatesToSend = BUTTON_STATES.copy()
+ self.graButtonStatesToSend["cancel"] = True
+ elif enabled and CS.standstill:
+ # Blip the Resume button if we're engaged at standstill.
+ # FIXME: This is a naive implementation, improve with visiond or radar input.
+ # A subset of MQBs like to "creep" too aggressively with this implementation.
+ self.graButtonStatesToSend = BUTTON_STATES.copy()
+ self.graButtonStatesToSend["resumeCruise"] = True
+
+ # OP/Panda can see this message but can't filter it when integrated at the
+ # R242 LKAS camera. It could do so if integrated at the J533 gateway, but
+ # we need a generalized solution that works for either. The message is
+ # counter-protected, so we need to time our transmissions very precisely
+ # to achieve fast and fault-free switching between message flows accepted
+ # at the J428 ACC radar.
+ #
+ # Example message flow on the bus, frequency of 33Hz (GRA_ACC_STEP):
+ #
+ # CAR: 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6
+ # EON: 3 4 5 6 7 8 9 A B C D E F 0 1 2 GG^
+ #
+ # If OP needs to send a button press, it waits to see a GRA_ACC_01 message
+ # counter change, and then immediately follows up with the next increment.
+ # The OP message will be sent within about 1ms of the car's message, which
+ # is about 2ms before the car's next message is expected. OP sends for an
+ # arbitrary duration of 16 messages / ~0.5 sec, in lockstep with each new
+ # message from the car.
+ #
+ # Because OP's counter is synced to the car, J428 immediately accepts the
+ # OP messages as valid. Further messages from the car get discarded as
+ # duplicates without a fault. When OP stops sending, the extra time gap
+ # (GG) to the next valid car message is less than 1 * GRA_ACC_STEP. J428
+ # tolerates the gap just fine and control returns to the car immediately.
+
+ if CS.graMsgBusCounter != self.graMsgBusCounterPrev:
+ self.graMsgBusCounterPrev = CS.graMsgBusCounter
+ if self.graButtonStatesToSend is not None:
+ if self.graMsgSentCount == 0:
+ self.graMsgStartFramePrev = frame
+ idx = (CS.graMsgBusCounter + 1) % 16
+ can_sends.append(volkswagencan.create_mqb_acc_buttons_control(self.packer_gw, canbus.extended, self.graButtonStatesToSend, CS, idx))
+ self.graMsgSentCount += 1
+ if self.graMsgSentCount >= 16:
+ self.graButtonStatesToSend = None
+ self.graMsgSentCount = 0
+
+ return can_sends
diff --git a/selfdrive/car/volkswagen/carstate.py b/selfdrive/car/volkswagen/carstate.py
new file mode 100644
index 0000000000..a39cbae8c5
--- /dev/null
+++ b/selfdrive/car/volkswagen/carstate.py
@@ -0,0 +1,229 @@
+import numpy as np
+from cereal import car
+from common.kalman.simple_kalman import KF1D
+from selfdrive.config import Conversions as CV
+from selfdrive.can.parser import CANParser
+from selfdrive.can.can_define import CANDefine
+from selfdrive.car.volkswagen.values import DBC, BUTTON_STATES
+from selfdrive.car.volkswagen.carcontroller import CarControllerParams
+
+GEAR = car.CarState.GearShifter
+
+def get_mqb_gateway_can_parser(CP, canbus):
+ # this function generates lists for signal, messages and initial values
+ signals = [
+ # sig_name, sig_address, default
+ ("LWI_Lenkradwinkel", "LWI_01", 0), # Absolute steering angle
+ ("LWI_VZ_Lenkradwinkel", "LWI_01", 0), # Steering angle sign
+ ("LWI_Lenkradw_Geschw", "LWI_01", 0), # Absolute steering rate
+ ("LWI_VZ_Lenkradw_Geschw", "LWI_01", 0), # Steering rate sign
+ ("ESP_VL_Radgeschw_02", "ESP_19", 0), # ABS wheel speed, front left
+ ("ESP_VR_Radgeschw_02", "ESP_19", 0), # ABS wheel speed, front right
+ ("ESP_HL_Radgeschw_02", "ESP_19", 0), # ABS wheel speed, rear left
+ ("ESP_HR_Radgeschw_02", "ESP_19", 0), # ABS wheel speed, rear right
+ ("ESP_Gierrate", "ESP_02", 0), # Absolute yaw rate
+ ("ESP_VZ_Gierrate", "ESP_02", 0), # Yaw rate sign
+ ("ZV_FT_offen", "Gateway_72", 0), # Door open, driver
+ ("ZV_BT_offen", "Gateway_72", 0), # Door open, passenger
+ ("ZV_HFS_offen", "Gateway_72", 0), # Door open, rear left
+ ("ZV_HBFS_offen", "Gateway_72", 0), # Door open, rear right
+ ("ZV_HD_offen", "Gateway_72", 0), # Trunk or hatch open
+ ("BH_Blinker_li", "Gateway_72", 0), # Left turn signal on
+ ("BH_Blinker_re", "Gateway_72", 0), # Right turn signal on
+ ("GE_Fahrstufe", "Getriebe_11", 0), # Auto trans gear selector position
+ ("AB_Gurtschloss_FA", "Airbag_02", 0), # Seatbelt status, driver
+ ("AB_Gurtschloss_BF", "Airbag_02", 0), # Seatbelt status, passenger
+ ("ESP_Fahrer_bremst", "ESP_05", 0), # Brake pedal pressed
+ ("ESP_Status_Bremsdruck", "ESP_05", 0), # Brakes applied
+ ("ESP_Bremsdruck", "ESP_05", 0), # Brake pressure applied
+ ("MO_Fahrpedalrohwert_01", "Motor_20", 0), # Accelerator pedal value
+ ("MO_Kuppl_schalter", "Motor_14", 0), # Clutch switch
+ ("Driver_Strain", "EPS_01", 0), # Absolute driver torque input
+ ("Driver_Strain_VZ", "EPS_01", 0), # Driver torque input sign
+ ("HCA_Ready", "EPS_01", 0), # Steering rack HCA support configured
+ ("ESP_Tastung_passiv", "ESP_21", 0), # Stability control disabled
+ ("KBI_MFA_v_Einheit_02", "Einheiten_01", 0), # MPH vs KMH speed display
+ ("KBI_Handbremse", "Kombi_01", 0), # Manual handbrake applied
+ ("TSK_Fahrzeugmasse_02", "Motor_16", 0), # Estimated vehicle mass from drivetrain coordinator
+ ("GRA_Hauptschalter", "GRA_ACC_01", 0), # ACC button, on/off
+ ("GRA_Abbrechen", "GRA_ACC_01", 0), # ACC button, cancel
+ ("GRA_Tip_Setzen", "GRA_ACC_01", 0), # ACC button, set
+ ("GRA_Tip_Hoch", "GRA_ACC_01", 0), # ACC button, increase or accel
+ ("GRA_Tip_Runter", "GRA_ACC_01", 0), # ACC button, decrease or decel
+ ("GRA_Tip_Wiederaufnahme", "GRA_ACC_01", 0), # ACC button, resume
+ ("GRA_Verstellung_Zeitluecke", "GRA_ACC_01", 0), # ACC button, time gap adj
+ ("GRA_Typ_Hauptschalter", "GRA_ACC_01", 0), # ACC main button type
+ ("GRA_Tip_Stufe_2", "GRA_ACC_01", 0), # unknown related to stalk type
+ ("GRA_ButtonTypeInfo", "GRA_ACC_01", 0), # unknown related to stalk type
+ ("COUNTER", "GRA_ACC_01", 0), # GRA_ACC_01 CAN message counter
+ ]
+
+ checks = [
+ # sig_address, frequency
+ ("LWI_01", 100), # From J500 Steering Assist with integrated sensors
+ ("EPS_01", 100), # From J500 Steering Assist with integrated sensors
+ ("ESP_19", 100), # From J104 ABS/ESP controller
+ ("ESP_05", 50), # From J104 ABS/ESP controller
+ ("ESP_21", 50), # From J104 ABS/ESP controller
+ ("Motor_20", 50), # From J623 Engine control module
+ ("GRA_ACC_01", 33), # From J??? steering wheel control buttons
+ ("Getriebe_11", 20), # From J743 Auto transmission control module
+ ("Gateway_72", 10), # From J533 CAN gateway (aggregated data)
+ ("Motor_14", 10), # From J623 Engine control module
+ ("Airbag_02", 5), # From J234 Airbag control module
+ ("Kombi_01", 2), # From J285 Instrument cluster
+ ("Motor_16", 2), # From J623 Engine control module
+ ("Einheiten_01", 1), # From J??? not known if gateway, cluster, or BCM
+ ]
+
+ return CANParser(DBC[CP.carFingerprint]['pt'], signals, checks, canbus.gateway)
+
+def get_mqb_extended_can_parser(CP, canbus):
+
+ signals = [
+ # sig_name, sig_address, default
+ ("ACC_Status_ACC", "ACC_06", 0), # ACC engagement status
+ ("ACC_Typ", "ACC_06", 0), # ACC type (follow to stop, stop&go)
+ ("SetSpeed", "ACC_02", 0), # ACC set speed
+ ]
+
+ checks = [
+ # sig_address, frequency
+ ("ACC_06", 50), # From J428 ACC radar control module
+ ("ACC_02", 17), # From J428 ACC radar control module
+ ]
+
+ return CANParser(DBC[CP.carFingerprint]['pt'], signals, checks, canbus.extended)
+
+def parse_gear_shifter(gear, vals):
+ # Return mapping of gearshift position to selected gear.
+
+ val_to_capnp = {'P': GEAR.park, 'R': GEAR.reverse, 'N': GEAR.neutral,
+ 'D': GEAR.drive, 'E': GEAR.eco, 'S': GEAR.sport, 'T': GEAR.manumatic}
+ try:
+ return val_to_capnp[vals[gear]]
+ except KeyError:
+ return "unknown"
+
+class CarState():
+ def __init__(self, CP, canbus):
+ # initialize can parser
+ self.CP = CP
+ self.car_fingerprint = CP.carFingerprint
+ self.can_define = CANDefine(DBC[CP.carFingerprint]['pt'])
+
+ self.shifter_values = self.can_define.dv["Getriebe_11"]['GE_Fahrstufe']
+
+ self.buttonStates = BUTTON_STATES.copy()
+
+ # vEgo Kalman filter
+ dt = 0.01
+ self.v_ego_kf = KF1D(x0=[[0.], [0.]],
+ A=[[1., dt], [0., 1.]],
+ C=[1., 0.],
+ K=[[0.12287673], [0.29666309]])
+
+ def update(self, gw_cp, ex_cp):
+ # Update vehicle speed and acceleration from ABS wheel speeds.
+ self.wheelSpeedFL = gw_cp.vl["ESP_19"]['ESP_VL_Radgeschw_02'] * CV.KPH_TO_MS
+ self.wheelSpeedFR = gw_cp.vl["ESP_19"]['ESP_VR_Radgeschw_02'] * CV.KPH_TO_MS
+ self.wheelSpeedRL = gw_cp.vl["ESP_19"]['ESP_HL_Radgeschw_02'] * CV.KPH_TO_MS
+ self.wheelSpeedRR = gw_cp.vl["ESP_19"]['ESP_HR_Radgeschw_02'] * CV.KPH_TO_MS
+
+ self.vEgoRaw = float(np.mean([self.wheelSpeedFL, self.wheelSpeedFR, self.wheelSpeedRL, self.wheelSpeedRR]))
+ v_ego_x = self.v_ego_kf.update(self.vEgoRaw)
+ self.vEgo = float(v_ego_x[0])
+ self.aEgo = float(v_ego_x[1])
+ self.standstill = self.vEgoRaw < 0.1
+
+ # Update steering angle, rate, yaw rate, and driver input torque. VW send
+ # the sign/direction in a separate signal so they must be recombined.
+ self.steeringAngle = gw_cp.vl["LWI_01"]['LWI_Lenkradwinkel'] * (1,-1)[int(gw_cp.vl["LWI_01"]['LWI_VZ_Lenkradwinkel'])]
+ self.steeringRate = gw_cp.vl["LWI_01"]['LWI_Lenkradw_Geschw'] * (1,-1)[int(gw_cp.vl["LWI_01"]['LWI_VZ_Lenkradwinkel'])]
+ self.steeringTorque = gw_cp.vl["EPS_01"]['Driver_Strain'] * (1,-1)[int(gw_cp.vl["EPS_01"]['Driver_Strain_VZ'])]
+ self.steeringPressed = abs(self.steeringTorque) > CarControllerParams.STEER_DRIVER_ALLOWANCE
+ self.yawRate = gw_cp.vl["ESP_02"]['ESP_Gierrate'] * (1,-1)[int(gw_cp.vl["ESP_02"]['ESP_VZ_Gierrate'])] * CV.DEG_TO_RAD
+
+ # Update gas, brakes, and gearshift.
+ self.gas = gw_cp.vl["Motor_20"]['MO_Fahrpedalrohwert_01'] / 100.0
+ self.gasPressed = self.gas > 0
+ self.brake = gw_cp.vl["ESP_05"]['ESP_Bremsdruck'] / 250.0 # FIXME: this is pressure in Bar, not sure what OP expects
+ self.brakePressed = bool(gw_cp.vl["ESP_05"]['ESP_Fahrer_bremst'])
+ self.brakeLights = bool(gw_cp.vl["ESP_05"]['ESP_Status_Bremsdruck'])
+
+ # Update gear and/or clutch position data.
+ can_gear_shifter = int(gw_cp.vl["Getriebe_11"]['GE_Fahrstufe'])
+ self.gearShifter = parse_gear_shifter(can_gear_shifter, self.shifter_values)
+
+ # Update door and trunk/hatch lid open status.
+ self.doorOpen = any([gw_cp.vl["Gateway_72"]['ZV_FT_offen'],
+ gw_cp.vl["Gateway_72"]['ZV_BT_offen'],
+ gw_cp.vl["Gateway_72"]['ZV_HFS_offen'],
+ gw_cp.vl["Gateway_72"]['ZV_HBFS_offen'],
+ gw_cp.vl["Gateway_72"]['ZV_HD_offen']])
+
+ # Update seatbelt fastened status.
+ self.seatbeltUnlatched = False if gw_cp.vl["Airbag_02"]["AB_Gurtschloss_FA"] == 3 else True
+
+ # Update driver preference for metric. VW stores many different unit
+ # preferences, including separate units for for distance vs. speed.
+ # We use the speed preference for OP.
+ self.displayMetricUnits = not gw_cp.vl["Einheiten_01"]["KBI_MFA_v_Einheit_02"]
+
+ # Update ACC radar status.
+ accStatus = ex_cp.vl["ACC_06"]['ACC_Status_ACC']
+ if accStatus == 1:
+ # ACC okay but disabled
+ self.accFault = False
+ self.accAvailable = False
+ self.accEnabled = False
+ elif accStatus == 2:
+ # ACC okay and enabled, but not currently engaged
+ self.accFault = False
+ self.accAvailable = True
+ self.accEnabled = False
+ elif accStatus in [3, 4, 5]:
+ # ACC okay and enabled, currently engaged and regulating speed (3) or engaged with driver accelerating (4) or overrun (5)
+ self.accFault = False
+ self.accAvailable = True
+ self.accEnabled = True
+ else:
+ # ACC fault of some sort. Seen statuses 6 or 7 for CAN comms disruptions, visibility issues, etc.
+ self.accFault = True
+ self.accAvailable = False
+ self.accEnabled = False
+
+ # Update ACC setpoint. When the setpoint is zero or there's an error, the
+ # radar sends a set-speed of ~90.69 m/s / 203mph.
+ self.accSetSpeed = ex_cp.vl["ACC_02"]['SetSpeed']
+ if self.accSetSpeed > 90: self.accSetSpeed = 0
+
+ # Update control button states for turn signals and ACC controls.
+ self.buttonStates["leftBlinker"] = bool(gw_cp.vl["Gateway_72"]['BH_Blinker_li'])
+ self.buttonStates["leftBlinker"] = bool(gw_cp.vl["Gateway_72"]['BH_Blinker_re'])
+ self.buttonStates["accelCruise"] = bool(gw_cp.vl["GRA_ACC_01"]['GRA_Tip_Hoch'])
+ self.buttonStates["decelCruise"] = bool(gw_cp.vl["GRA_ACC_01"]['GRA_Tip_Runter'])
+ self.buttonStates["cancel"] = bool(gw_cp.vl["GRA_ACC_01"]['GRA_Abbrechen'])
+ self.buttonStates["setCruise"] = bool(gw_cp.vl["GRA_ACC_01"]['GRA_Tip_Setzen'])
+ self.buttonStates["resumeCruise"] = bool(gw_cp.vl["GRA_ACC_01"]['GRA_Tip_Wiederaufnahme'])
+ self.buttonStates["gapAdjustCruise"] = bool(gw_cp.vl["GRA_ACC_01"]['GRA_Verstellung_Zeitluecke'])
+
+ # Read ACC hardware button type configuration info that has to pass thru
+ # to the radar. Ends up being different for steering wheel buttons vs
+ # third stalk type controls.
+ self.graHauptschalter = gw_cp.vl["GRA_ACC_01"]['GRA_Hauptschalter']
+ self.graTypHauptschalter = gw_cp.vl["GRA_ACC_01"]['GRA_Typ_Hauptschalter']
+ self.graButtonTypeInfo = gw_cp.vl["GRA_ACC_01"]['GRA_ButtonTypeInfo']
+ self.graTipStufe2 = gw_cp.vl["GRA_ACC_01"]['GRA_Tip_Stufe_2']
+ # Pick up the GRA_ACC_01 CAN message counter so we can sync to it for
+ # later cruise-control button spamming.
+ self.graMsgBusCounter = gw_cp.vl["GRA_ACC_01"]['COUNTER']
+
+ # Check to make sure the electric power steering rack is configured to
+ # accept and respond to HCA_01 messages and has not encountered a fault.
+ self.steeringFault = not gw_cp.vl["EPS_01"]["HCA_Ready"]
+
+ # Additional safety checks performed in CarInterface.
+ self.parkingBrakeSet = bool(gw_cp.vl["Kombi_01"]['KBI_Handbremse']) # FIXME: need to include an EPB check as well
+ self.stabilityControlDisabled = gw_cp.vl["ESP_21"]['ESP_Tastung_passiv']
+
diff --git a/selfdrive/car/volkswagen/interface.py b/selfdrive/car/volkswagen/interface.py
new file mode 100644
index 0000000000..272c86bece
--- /dev/null
+++ b/selfdrive/car/volkswagen/interface.py
@@ -0,0 +1,242 @@
+from cereal import car
+from selfdrive.config import Conversions as CV
+from selfdrive.controls.lib.drive_helpers import create_event, EventTypes as ET
+from selfdrive.controls.lib.vehicle_model import VehicleModel
+from selfdrive.car.volkswagen.values import CAR, BUTTON_STATES
+from selfdrive.car.volkswagen.carstate import CarState, get_mqb_gateway_can_parser, get_mqb_extended_can_parser
+from common.params import Params
+from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint
+from selfdrive.car.interfaces import CarInterfaceBase
+
+GEAR = car.CarState.GearShifter
+
+class CANBUS:
+ gateway = 0
+ extended = 2
+
+class CarInterface(CarInterfaceBase):
+ def __init__(self, CP, CarController):
+ self.CP = CP
+ self.CC = None
+
+ self.frame = 0
+
+ self.gasPressedPrev = False
+ self.brakePressedPrev = False
+ self.cruiseStateEnabledPrev = False
+ self.displayMetricUnitsPrev = None
+ self.buttonStatesPrev = BUTTON_STATES.copy()
+
+ # *** init the major players ***
+ self.CS = CarState(CP, CANBUS)
+ self.VM = VehicleModel(CP)
+ self.gw_cp = get_mqb_gateway_can_parser(CP, CANBUS)
+ self.ex_cp = get_mqb_extended_can_parser(CP, CANBUS)
+
+ # sending if read only is False
+ if CarController is not None:
+ self.CC = CarController(CANBUS, CP.carFingerprint)
+
+ @staticmethod
+ def compute_gb(accel, speed):
+ return float(accel) / 4.0
+
+ @staticmethod
+ def get_params(candidate, fingerprint=gen_empty_fingerprint(), vin="", has_relay=False):
+ ret = car.CarParams.new_message()
+
+ ret.carFingerprint = candidate
+ ret.isPandaBlack = has_relay
+ ret.carVin = vin
+
+ if candidate == CAR.GOLF:
+ # Set common MQB parameters that will apply globally
+ ret.carName = "volkswagen"
+ ret.safetyModel = car.CarParams.SafetyModel.volkswagen
+ ret.enableCruise = True # Stock ACC still controls acceleration and braking
+ ret.openpilotLongitudinalControl = False
+ ret.steerControlType = car.CarParams.SteerControlType.torque
+ # Steer torque is strongly rate limit and max value is decently high. Off to avoid false positives
+ ret.steerLimitAlert = False
+
+ # Additional common MQB parameters that may be overridden per-vehicle
+ ret.steerRateCost = 0.5
+ ret.steerActuatorDelay = 0.05 # Hopefully all MQB racks are similar here
+ ret.steerMaxBP = [0.] # m/s
+ ret.steerMaxV = [1.]
+
+ # As a starting point for speed-adjusted lateral tuning, use the example
+ # map speed breakpoints from a VW Tiguan (SSP 399 page 9). It's unclear
+ # whether the driver assist map breakpoints have any direct bearing on
+ # HCA assist torque, but if they're good breakpoints for the driver,
+ # they're probably good breakpoints for HCA as well. OP won't be driving
+ # 250kph/155mph but it provides interpolation scaling above 100kmh/62mph.
+ ret.lateralTuning.pid.kpBP = [0., 15 * CV.KPH_TO_MS, 50 * CV.KPH_TO_MS]
+ ret.lateralTuning.pid.kiBP = [0., 15 * CV.KPH_TO_MS, 50 * CV.KPH_TO_MS]
+
+ # FIXME: Per-vehicle parameters need to be reintegrated.
+ # For the time being, per-vehicle stuff is being archived since we
+ # can't auto-detect very well yet. Now that tuning is figured out,
+ # averaged params should work reasonably on a range of cars. Owners
+ # can tweak here, as needed, until we have car type auto-detection.
+
+ ret.mass = 1700 + STD_CARGO_KG
+ ret.wheelbase = 2.75
+ ret.centerToFront = ret.wheelbase * 0.45
+ ret.steerRatio = 15.6
+ ret.lateralTuning.pid.kf = 0.00006
+ ret.lateralTuning.pid.kpV = [0.15, 0.25, 0.60]
+ ret.lateralTuning.pid.kiV = [0.05, 0.05, 0.05]
+ tire_stiffness_factor = 0.6
+
+ ret.enableCamera = True # Stock camera detection doesn't apply to VW
+ ret.transmissionType = car.CarParams.TransmissionType.automatic
+ ret.steerRatioRear = 0.
+
+ # No support for OP longitudinal control on Volkswagen at this time.
+ ret.gasMaxBP = [0.]
+ ret.gasMaxV = [0.]
+ ret.brakeMaxBP = [0.]
+ ret.brakeMaxV = [0.]
+ ret.longitudinalTuning.deadzoneBP = [0.]
+ ret.longitudinalTuning.deadzoneV = [0.]
+ ret.longitudinalTuning.kpBP = [0.]
+ ret.longitudinalTuning.kpV = [0.]
+ ret.longitudinalTuning.kiBP = [0.]
+ ret.longitudinalTuning.kiV = [0.]
+
+ # TODO: get actual value, for now starting with reasonable value for
+ # civic and scaling by mass and wheelbase
+ ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase)
+
+ # TODO: start from empirically derived lateral slip stiffness for the civic and scale by
+ # mass and CG position, so all cars will have approximately similar dyn behaviors
+ ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront,
+ tire_stiffness_factor=tire_stiffness_factor)
+
+ return ret
+
+ # returns a car.CarState
+ def update(self, c, can_strings):
+ canMonoTimes = []
+ events = []
+ buttonEvents = []
+ params = Params()
+ ret = car.CarState.new_message()
+
+ # Process the most recent CAN message traffic, and check for validity
+ self.gw_cp.update_strings(can_strings)
+ self.ex_cp.update_strings(can_strings)
+ self.CS.update(self.gw_cp, self.ex_cp)
+ ret.canValid = self.gw_cp.can_valid and self.ex_cp.can_valid
+
+ # Wheel and vehicle speed, yaw rate
+ ret.wheelSpeeds.fl = self.CS.wheelSpeedFL
+ ret.wheelSpeeds.fr = self.CS.wheelSpeedFR
+ ret.wheelSpeeds.rl = self.CS.wheelSpeedRL
+ ret.wheelSpeeds.rr = self.CS.wheelSpeedRR
+ ret.vEgoRaw = self.CS.vEgoRaw
+ ret.vEgo = self.CS.vEgo
+ ret.aEgo = self.CS.aEgo
+ ret.standstill = self.CS.standstill
+
+ # Steering wheel position, movement, yaw rate, and driver input
+ ret.steeringAngle = self.CS.steeringAngle
+ ret.steeringRate = self.CS.steeringRate
+ ret.steeringTorque = self.CS.steeringTorque
+ ret.steeringPressed = self.CS.steeringPressed
+ ret.yawRate = self.CS.yawRate
+
+ # Gas, brakes and shifting
+ ret.gas = self.CS.gas
+ ret.gasPressed = self.CS.gasPressed
+ ret.brake = self.CS.brake
+ ret.brakePressed = self.CS.brakePressed
+ ret.brakeLights = self.CS.brakeLights
+ ret.gearShifter = self.CS.gearShifter
+
+ # Doors open, seatbelt unfastened
+ ret.doorOpen = self.CS.doorOpen
+ ret.seatbeltUnlatched = self.CS.seatbeltUnlatched
+
+ # Update the EON metric configuration to match the car at first startup,
+ # or if there's been a change.
+ if self.CS.displayMetricUnits != self.displayMetricUnitsPrev:
+ params.put("IsMetric", "1" if self.CS.displayMetricUnits else "0")
+
+ # Blinker switch updates
+ ret.leftBlinker = self.CS.buttonStates["leftBlinker"]
+ ret.rightBlinker = self.CS.buttonStates["rightBlinker"]
+
+ # ACC cruise state
+ ret.cruiseState.available = self.CS.accAvailable
+ ret.cruiseState.enabled = self.CS.accEnabled
+ ret.cruiseState.speed = self.CS.accSetSpeed
+
+ # Check for and process state-change events (button press or release) from
+ # the turn stalk switch or ACC steering wheel/control stalk buttons.
+ for button in self.CS.buttonStates:
+ if self.CS.buttonStates[button] != self.buttonStatesPrev[button]:
+ be = car.CarState.ButtonEvent.new_message()
+ be.type = button
+ be.pressed = self.CS.buttonStates[button]
+ buttonEvents.append(be)
+
+ # Vehicle operation safety checks and events
+ if ret.doorOpen:
+ events.append(create_event('doorOpen', [ET.NO_ENTRY, ET.SOFT_DISABLE]))
+ if ret.seatbeltUnlatched:
+ events.append(create_event('seatbeltNotLatched', [ET.NO_ENTRY, ET.SOFT_DISABLE]))
+ if ret.gearShifter == GEAR.reverse:
+ events.append(create_event('reverseGear', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE]))
+ if not ret.gearShifter in [GEAR.drive, GEAR.eco, GEAR.sport]:
+ events.append(create_event('wrongGear', [ET.NO_ENTRY, ET.SOFT_DISABLE]))
+ if self.CS.stabilityControlDisabled:
+ events.append(create_event('espDisabled', [ET.NO_ENTRY, ET.SOFT_DISABLE]))
+ if self.CS.parkingBrakeSet:
+ events.append(create_event('parkBrake', [ET.NO_ENTRY, ET.USER_DISABLE]))
+
+ # Vehicle health safety checks and events
+ if self.CS.accFault:
+ events.append(create_event('radarFault', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE]))
+ if self.CS.steeringFault:
+ events.append(create_event('steerTempUnavailable', [ET.NO_ENTRY, ET.WARNING]))
+
+ # Per the Comma safety model, disable on pedals rising edge or when brake
+ # is pressed and speed isn't zero.
+ if (ret.gasPressed and not self.gasPressedPrev) or \
+ (ret.brakePressed and (not self.brakePressedPrev or not ret.standstill)):
+ events.append(create_event('pedalPressed', [ET.NO_ENTRY, ET.USER_DISABLE]))
+ if ret.gasPressed:
+ events.append(create_event('pedalPressed', [ET.PRE_ENABLE]))
+
+ # Engagement and longitudinal control using stock ACC. Make sure OP is
+ # disengaged if stock ACC is disengaged.
+ if not ret.cruiseState.enabled:
+ events.append(create_event('pcmDisable', [ET.USER_DISABLE]))
+ # Attempt OP engagement only on rising edge of stock ACC engagement.
+ elif not self.cruiseStateEnabledPrev:
+ events.append(create_event('pcmEnable', [ET.ENABLE]))
+
+ ret.events = events
+ ret.buttonEvents = buttonEvents
+ ret.canMonoTimes = canMonoTimes
+
+ # update previous car states
+ self.gasPressedPrev = ret.gasPressed
+ self.brakePressedPrev = ret.brakePressed
+ self.cruiseStateEnabledPrev = ret.cruiseState.enabled
+ self.displayMetricUnitsPrev = self.CS.displayMetricUnits
+ self.buttonStatesPrev = self.CS.buttonStates.copy()
+
+ # cast to reader so it can't be modified
+ return ret.as_reader()
+
+ def apply(self, c):
+ can_sends = self.CC.update(c.enabled, self.CS, self.frame, c.actuators,
+ c.hudControl.visualAlert,
+ c.hudControl.audibleAlert,
+ c.hudControl.leftLaneVisible,
+ c.hudControl.rightLaneVisible)
+ self.frame += 1
+ return can_sends
diff --git a/selfdrive/car/volkswagen/radar_interface.py b/selfdrive/car/volkswagen/radar_interface.py
new file mode 100644
index 0000000000..b2f7651136
--- /dev/null
+++ b/selfdrive/car/volkswagen/radar_interface.py
@@ -0,0 +1,5 @@
+#!/usr/bin/env python3
+from selfdrive.car.interfaces import RadarInterfaceBase
+
+class RadarInterface(RadarInterfaceBase):
+ pass
diff --git a/selfdrive/car/volkswagen/values.py b/selfdrive/car/volkswagen/values.py
new file mode 100644
index 0000000000..6a1106076c
--- /dev/null
+++ b/selfdrive/car/volkswagen/values.py
@@ -0,0 +1,63 @@
+from selfdrive.car import dbc_dict
+
+class CarControllerParams:
+ HCA_STEP = 2 # HCA_01 message frequency 50Hz
+ LDW_STEP = 10 # LDW_02 message frequency 10Hz
+ GRA_ACC_STEP = 3 # GRA_ACC_01 message frequency 33Hz
+
+ GRA_VBP_STEP = 100 # Send ACC virtual button presses once a second
+ GRA_VBP_COUNT = 16 # Send VBP messages for ~0.5s (GRA_ACC_STEP * 16)
+
+ # Observed documented MQB limits: 3.00 Nm max, rate of change 5.00 Nm/sec.
+ # Limiting both torque and rate-of-change based on real-world testing and
+ # Comma's safety requirements for minimum time to lane departure.
+ STEER_MAX = 250 # Max heading control assist torque 2.50 Nm
+ STEER_DELTA_UP = 4 # Max HCA reached in 1.25s (STEER_MAX / (50Hz * 1.25))
+ STEER_DELTA_DOWN = 10 # Min HCA reached in 0.60s (STEER_MAX / (50Hz * 0.60))
+ STEER_DRIVER_ALLOWANCE = 80
+ STEER_DRIVER_MULTIPLIER = 3 # weight driver torque heavily
+ STEER_DRIVER_FACTOR = 1 # from dbc
+
+BUTTON_STATES = {
+ "leftBlinker": False,
+ "rightBlinker": False,
+ "accelCruise": False,
+ "decelCruise": False,
+ "cancel": False,
+ "setCruise": False,
+ "resumeCruise": False,
+ "gapAdjustCruise": False
+}
+
+MQB_LDW_MESSAGES = {
+ "none": 0, # Nothing to display
+ "laneAssistUnavailChime": 1, # "Lane Assist currently not available." with chime
+ "laneAssistUnavailNoSensorChime": 3, # "Lane Assist not available. No sensor view." with chime
+ "laneAssistTakeOverUrgent": 4, # "Lane Assist: Please Take Over Steering" with urgent beep
+ "emergencyAssistUrgent": 6, # "Emergency Assist: Please Take Over Steering" with urgent beep
+ "laneAssistTakeOverChime": 7, # "Lane Assist: Please Take Over Steering" with chime
+ "laneAssistTakeOverSilent": 8, # "Lane Assist: Please Take Over Steering" silent
+ "emergencyAssistChangingLanes": 9, # "Emergency Assist: Changing lanes..." with urgent beep
+ "laneAssistDeactivated": 10, # "Lane Assist deactivated." silent with persistent icon afterward
+}
+
+class CAR:
+ GOLF = "Volkswagen Golf"
+
+FINGERPRINTS = {
+ CAR.GOLF: [
+ # 76b83eb0245de90e|2019-10-21--17-40-42 - jyoung8607 car
+ {64: 8, 134: 8, 159: 8, 173: 8, 178: 8, 253: 8, 257: 8, 260: 8, 262: 8, 264: 8, 278: 8, 279: 8, 283: 8, 286: 8, 288: 8, 289: 8, 290: 8, 294: 8, 299: 8, 302: 8, 346: 8, 385: 8, 418: 8, 427: 8, 668: 8, 679: 8, 681: 8, 695: 8, 779: 8, 780: 8, 783: 8, 792: 8, 795: 8, 804: 8, 806: 8, 807: 8, 808: 8, 809: 8, 870: 8, 896: 8, 897: 8, 898: 8, 901: 8, 917: 8, 919: 8, 949: 8, 958: 8, 960: 4, 981: 8, 987: 8, 988: 8, 991: 8, 997: 8, 1000: 8, 1019: 8, 1120: 8, 1122: 8, 1123: 8, 1124: 8, 1153: 8, 1162: 8, 1175: 8, 1312: 8, 1385: 8, 1413: 8, 1440: 5, 1514: 8, 1515: 8, 1520: 8, 1600: 8, 1601: 8, 1603: 8, 1605: 8, 1624: 8, 1626: 8, 1629: 8, 1631: 8, 1646: 8, 1648: 8, 1712: 6, 1714: 8, 1716: 8, 1717: 8, 1719: 8, 1720: 8, 1721: 8
+ }],
+}
+
+class ECU:
+ CAM = 0
+
+ECU_FINGERPRINT = {
+ ECU.CAM: [294, 919], # HCA_01 Heading Control Assist, LDW_02 Lane Departure Warning
+}
+
+DBC = {
+ CAR.GOLF: dbc_dict('vw_mqb_2010', None),
+}
diff --git a/selfdrive/car/volkswagen/volkswagencan.py b/selfdrive/car/volkswagen/volkswagencan.py
new file mode 100644
index 0000000000..34f19003d8
--- /dev/null
+++ b/selfdrive/car/volkswagen/volkswagencan.py
@@ -0,0 +1,52 @@
+# CAN controls for MQB platform Volkswagen, Audi, Skoda and SEAT.
+# PQ35/PQ46/NMS, and any future MLB, to come later.
+
+def create_mqb_steering_control(packer, bus, apply_steer, idx, lkas_enabled):
+ values = {
+ "SET_ME_0X3": 0x3,
+ "Assist_Torque": abs(apply_steer),
+ "Assist_Requested": lkas_enabled,
+ "Assist_VZ": 1 if apply_steer < 0 else 0,
+ "HCA_Available": 1,
+ "HCA_Standby": not lkas_enabled,
+ "HCA_Active": lkas_enabled,
+ "SET_ME_0XFE": 0xFE,
+ "SET_ME_0X07": 0x07,
+ }
+ return packer.make_can_msg("HCA_01", bus, values, idx)
+
+def create_mqb_hud_control(packer, bus, hca_enabled, steering_pressed, hud_alert, leftLaneVisible, rightLaneVisible):
+
+ if hca_enabled:
+ leftlanehud = 3 if leftLaneVisible else 1
+ rightlanehud = 3 if rightLaneVisible else 1
+ else:
+ leftlanehud = 2 if leftLaneVisible else 1
+ rightlanehud = 2 if rightLaneVisible else 1
+
+ values = {
+ "LDW_Unknown": 2, # FIXME: possible speed or attention relationship
+ "Kombi_Lamp_Orange": 1 if hca_enabled and steering_pressed else 0,
+ "Kombi_Lamp_Green": 1 if hca_enabled and not steering_pressed else 0,
+ "Left_Lane_Status": leftlanehud,
+ "Right_Lane_Status": rightlanehud,
+ "Alert_Message": hud_alert,
+ }
+ return packer.make_can_msg("LDW_02", bus, values)
+
+def create_mqb_acc_buttons_control(packer, bus, buttonStatesToSend, CS, idx):
+ values = {
+ "GRA_Hauptschalter": CS.graHauptschalter,
+ "GRA_Abbrechen": buttonStatesToSend["cancel"],
+ "GRA_Tip_Setzen": buttonStatesToSend["setCruise"],
+ "GRA_Tip_Hoch": buttonStatesToSend["accelCruise"],
+ "GRA_Tip_Runter": buttonStatesToSend["decelCruise"],
+ "GRA_Tip_Wiederaufnahme": buttonStatesToSend["resumeCruise"],
+ "GRA_Verstellung_Zeitluecke": 3 if buttonStatesToSend["gapAdjustCruise"] else 0,
+ "GRA_Typ_Hauptschalter": CS.graTypHauptschalter,
+ "GRA_Codierung": 2,
+ "GRA_Tip_Stufe_2": CS.graTipStufe2,
+ "GRA_ButtonTypeInfo": CS.graButtonTypeInfo
+ }
+
+ return packer.make_can_msg("GRA_ACC_01", bus, values, idx)
diff --git a/selfdrive/common/params.cc b/selfdrive/common/params.cc
index 0bdf6118a6..6e0e8b186f 100644
--- a/selfdrive/common/params.cc
+++ b/selfdrive/common/params.cc
@@ -9,6 +9,7 @@
#include
#include
#include
+#include
#include