mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-12 05:44:14 +08:00
Compare commits
486 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91bf49bdd4 | ||
|
|
017cbbfa51 | ||
|
|
8773fbf7d9 | ||
|
|
8d4ff30c60 | ||
|
|
be2ba93ca0 | ||
|
|
48425a1fc1 | ||
|
|
84c8790192 | ||
|
|
25681a31e5 | ||
|
|
61bbb52172 | ||
|
|
c9270bfa2f | ||
|
|
0a7d2f4343 | ||
|
|
dc6107dac3 | ||
|
|
5eacdcee9d | ||
|
|
978839a861 | ||
|
|
fbc243aa94 | ||
|
|
cf5c4aeacb | ||
|
|
194d4d7f71 | ||
|
|
5b596aec6f | ||
|
|
09533fee0c | ||
|
|
6ee6161d23 | ||
|
|
4e16a1454d | ||
|
|
d0bdd513cd | ||
|
|
54b920eb79 | ||
|
|
94053536b4 | ||
|
|
cd98235644 | ||
|
|
b539ae3e2d | ||
|
|
c8b4633cd1 | ||
|
|
1ff59baea7 | ||
|
|
53413fa019 | ||
|
|
813d5b9982 | ||
|
|
e453e79bc8 | ||
|
|
b02e848395 | ||
|
|
ed9d5615ba | ||
|
|
8264fd8b93 | ||
|
|
532e7710f3 | ||
|
|
63da1abe2c | ||
|
|
62bd6cee67 | ||
|
|
e8af5d6364 | ||
|
|
386ec39885 | ||
|
|
2a99c660c3 | ||
|
|
be28530ee4 | ||
|
|
15cb2f05c7 | ||
|
|
3595162d1a | ||
|
|
8e97f70b92 | ||
|
|
a9a35894ad | ||
|
|
c3a1a438d8 | ||
|
|
13bdfcdd95 | ||
|
|
9675794969 | ||
|
|
151a504507 | ||
|
|
99da7077ab | ||
|
|
3d941253a5 | ||
|
|
03e764bcb3 | ||
|
|
0d41146fa8 | ||
|
|
7f04682b4c | ||
|
|
a6545b1604 | ||
|
|
2db4cb0e8c | ||
|
|
26d0b8d4ee | ||
|
|
323660961f | ||
|
|
88966b488a | ||
|
|
41fc9c55a0 | ||
|
|
8c2b3d5e37 | ||
|
|
22fc7e9dae | ||
|
|
9f53e446d9 | ||
|
|
7e0ba31ceb | ||
|
|
fe46b24be5 | ||
|
|
a9e94ef9bb | ||
|
|
c9db3ef937 | ||
|
|
9a3dc91b35 | ||
|
|
c5e71d2f37 | ||
|
|
61ce864e28 | ||
|
|
36d0a70b69 | ||
|
|
20a2007d10 | ||
|
|
64701acb68 | ||
|
|
17922bd096 | ||
|
|
16eb74250c | ||
|
|
4a48ef8dbc | ||
|
|
5eda5fc81b | ||
|
|
76ab558ca6 | ||
|
|
60a20537c5 | ||
|
|
71e65750d1 | ||
|
|
2ce741275b | ||
|
|
8cb09e1329 | ||
|
|
17f21c5b6f | ||
|
|
0992311f83 | ||
|
|
a42fea2041 | ||
|
|
4aaf4f437b | ||
|
|
610bb58845 | ||
|
|
4c77b9162e | ||
|
|
cd096d1c2e | ||
|
|
11a7b2d9bf | ||
|
|
be020bdedb | ||
|
|
1e77f2482c | ||
|
|
7fa09edc03 | ||
|
|
13ae651f46 | ||
|
|
c345bb1d8f | ||
|
|
a2b00731cb | ||
|
|
d36b78e273 | ||
|
|
6ab7c27d9b | ||
|
|
a90c3bc8be | ||
|
|
8b3c922cf0 | ||
|
|
d460e0e735 | ||
|
|
a52b947ce2 | ||
|
|
c75137b262 | ||
|
|
6fd3f9bad8 | ||
|
|
d8da18ed54 | ||
|
|
6abd80f116 | ||
|
|
f4b258a082 | ||
|
|
8a9ed94f5f | ||
|
|
ae44a57565 | ||
|
|
78e4e4ea23 | ||
|
|
1c6164e11c | ||
|
|
b93f77ea0e | ||
|
|
dba8e01e54 | ||
|
|
983120bfed | ||
|
|
27803e787b | ||
|
|
24e096d9f0 | ||
|
|
6651d50c81 | ||
|
|
f64c4df8c8 | ||
|
|
00c48f0ba3 | ||
|
|
f78b6fdd17 | ||
|
|
7c537ee201 | ||
|
|
e2d77db22a | ||
|
|
bf5e361b26 | ||
|
|
a7ad4488b9 | ||
|
|
f7fbcfe59d | ||
|
|
1efed2ed00 | ||
|
|
15c43ad722 | ||
|
|
5fcbfcc359 | ||
|
|
672d80735f | ||
|
|
2f5e35035d | ||
|
|
1aafc5b0ef | ||
|
|
9f66b533e2 | ||
|
|
1883bd6135 | ||
|
|
1ba6b0004d | ||
|
|
68b86c7ca8 | ||
|
|
36881b6410 | ||
|
|
fe7e5cf5df | ||
|
|
d8b1588937 | ||
|
|
a2f4d6b5ad | ||
|
|
16d0c4a3e7 | ||
|
|
dd34ccfe28 | ||
|
|
7ccae06bce | ||
|
|
59bd6b8837 | ||
|
|
53c4b90ffc | ||
|
|
f91df07d3f | ||
|
|
0829b0a767 | ||
|
|
9a143c5ab2 | ||
|
|
1e8098c140 | ||
|
|
b5a88f5700 | ||
|
|
c0a3e48d94 | ||
|
|
65e1342e41 | ||
|
|
7ada2abca0 | ||
|
|
9278fad15c | ||
|
|
0aa41e348e | ||
|
|
64a6e9776c | ||
|
|
56b2945de4 | ||
|
|
b686ca87d3 | ||
|
|
1b3b260b4d | ||
|
|
25d43fe15e | ||
|
|
cbc73e55a2 | ||
|
|
9b31da0985 | ||
|
|
3f9059fea8 | ||
|
|
99c81d291f | ||
|
|
530b637d27 | ||
|
|
52e55eb244 | ||
|
|
ec36bc3a39 | ||
|
|
98797fb24e | ||
|
|
127998ca8b | ||
|
|
1da59216b0 | ||
|
|
184ba93833 | ||
|
|
a321836788 | ||
|
|
f5044670fa | ||
|
|
340e0f4a4c | ||
|
|
d8b1e99d77 | ||
|
|
2eebe49940 | ||
|
|
9dae0bfac4 | ||
|
|
2f92d577f9 | ||
|
|
684e7b9f9e | ||
|
|
790732bea3 | ||
|
|
3c25760cc9 | ||
|
|
7834995df4 | ||
|
|
0a7fed9437 | ||
|
|
a201322160 | ||
|
|
d64025cca4 | ||
|
|
58d645cd18 | ||
|
|
76dfb135ca | ||
|
|
27ef9f2236 | ||
|
|
185375ed64 | ||
|
|
7978afabe5 | ||
|
|
e89fd1236f | ||
|
|
bdf6585650 | ||
|
|
4662cfc8d7 | ||
|
|
dd32343342 | ||
|
|
1efa3f0eba | ||
|
|
ca2f30989d | ||
|
|
03f09105c6 | ||
|
|
5a9d89ed42 | ||
|
|
f74a201edc | ||
|
|
342bb13bff | ||
|
|
be5c2aef3a | ||
|
|
6aa1048d15 | ||
|
|
ede869e34a | ||
|
|
2a0f066426 | ||
|
|
113d4c1b70 | ||
|
|
27e0adc434 | ||
|
|
4697568e67 | ||
|
|
21a24446db | ||
|
|
26cc816c1b | ||
|
|
6c1f516bb3 | ||
|
|
737f2ace69 | ||
|
|
f0203614ee | ||
|
|
8b7dfb647f | ||
|
|
15fa6664c0 | ||
|
|
5c8aa7295d | ||
|
|
0207a97040 | ||
|
|
9a79df8a8a | ||
|
|
fdb04d9f69 | ||
|
|
603f3f1a34 | ||
|
|
27f405bb6f | ||
|
|
26da755a1e | ||
|
|
a25e2153a0 | ||
|
|
88246af4c7 | ||
|
|
03f13e614b | ||
|
|
23512ba932 | ||
|
|
ee35b905d7 | ||
|
|
2c9d5afd75 | ||
|
|
860623f157 | ||
|
|
73c1df714d | ||
|
|
b967da5fc1 | ||
|
|
ea35a0043c | ||
|
|
f364a3ee8f | ||
|
|
d21c6591c1 | ||
|
|
ece9cf9480 | ||
|
|
d5f8643e7c | ||
|
|
9cf542d7f7 | ||
|
|
9eb1666a52 | ||
|
|
b78ed77f1d | ||
|
|
d84e64b315 | ||
|
|
0fded2c08b | ||
|
|
67e7f6dc3d | ||
|
|
4d2ff103d6 | ||
|
|
58e716ff48 | ||
|
|
f41cb3b4ec | ||
|
|
b5d8230c3d | ||
|
|
853bcda352 | ||
|
|
4610a6e4d4 | ||
|
|
067f1bfe9e | ||
|
|
e3c934bcc1 | ||
|
|
210db686bb | ||
|
|
30ec405890 | ||
|
|
573a6915fc | ||
|
|
0002cc7c3a | ||
|
|
dc331df1fc | ||
|
|
5c4ae7a2fc | ||
|
|
29bea62ac1 | ||
|
|
024870d16a | ||
|
|
68e56c8017 | ||
|
|
9d76070ab7 | ||
|
|
6ec0d23b7a | ||
|
|
c9dd7fe0e6 | ||
|
|
e32463ee96 | ||
|
|
53c6ca6589 | ||
|
|
e4ed48928b | ||
|
|
b94d598c2d | ||
|
|
860a48765d | ||
|
|
efa97f23a5 | ||
|
|
92c596544d | ||
|
|
2f0b0fb15e | ||
|
|
3e78efacca | ||
|
|
c10a755516 | ||
|
|
3b744f4fba | ||
|
|
b4dd562c43 | ||
|
|
892e14aa92 | ||
|
|
8b7c726bea | ||
|
|
db24b1e838 | ||
|
|
7db592d3b8 | ||
|
|
b7c029c92c | ||
|
|
fdbf1c5938 | ||
|
|
00429e6bbb | ||
|
|
2f8034b2ec | ||
|
|
5501541aa2 | ||
|
|
3d05cca678 | ||
|
|
195139999b | ||
|
|
c9fa92b377 | ||
|
|
dfa7757c40 | ||
|
|
8f3539a27b | ||
|
|
d0715b6562 | ||
|
|
e8ae37e36e | ||
|
|
a2c76acf3b | ||
|
|
a51a60b598 | ||
|
|
7ed5c6554d | ||
|
|
5641fc986d | ||
|
|
c499aa549c | ||
|
|
0a99fe3baa | ||
|
|
8cc32df779 | ||
|
|
8291f35701 | ||
|
|
0f885c87a5 | ||
|
|
a422246dc3 | ||
|
|
906b55a5bd | ||
|
|
e5b2ec4f01 | ||
|
|
5c0935d253 | ||
|
|
97f1ee4a0d | ||
|
|
2d450bc3a8 | ||
|
|
96c923875b | ||
|
|
14b7eadf63 | ||
|
|
402faabd42 | ||
|
|
de79a07745 | ||
|
|
4b2c137489 | ||
|
|
b3654cbcc9 | ||
|
|
d2b8c4f0cb | ||
|
|
50d9c446cf | ||
|
|
6eb1247426 | ||
|
|
faea9a42c4 | ||
|
|
86813e6d37 | ||
|
|
012727ef60 | ||
|
|
9653f9d6a6 | ||
|
|
285c52eb69 | ||
|
|
75db5e854e | ||
|
|
8f6e36f426 | ||
|
|
c4bba32347 | ||
|
|
f0c5ca7227 | ||
|
|
8970cc8d70 | ||
|
|
54f3c2b373 | ||
|
|
2c4e1fd4fa | ||
|
|
401c4026ac | ||
|
|
22f0a89cf8 | ||
|
|
b942ab58e1 | ||
|
|
c29b311583 | ||
|
|
ed72759a48 | ||
|
|
0129a8a4ff | ||
|
|
6839a11685 | ||
|
|
db96b4b912 | ||
|
|
c812915765 | ||
|
|
b70d75d1d0 | ||
|
|
6a02547b42 | ||
|
|
33a75c3506 | ||
|
|
2cfdc67610 | ||
|
|
6f3d10a4c4 | ||
|
|
fe9ce203ee | ||
|
|
589b6187a1 | ||
|
|
6b1efbf185 | ||
|
|
76494ab0be | ||
|
|
b63d51d3ef | ||
|
|
e07853bb5e | ||
|
|
866711ef2e | ||
|
|
ef8e6fb39f | ||
|
|
4568504c41 | ||
|
|
18c6482545 | ||
|
|
b0c83bb9a6 | ||
|
|
ce57ce4898 | ||
|
|
7d9f8c55e0 | ||
|
|
04c26981f0 | ||
|
|
7f6ea03066 | ||
|
|
de33bc4645 | ||
|
|
87fcd4537f | ||
|
|
e9ad7793f0 | ||
|
|
4bdf3b95f3 | ||
|
|
7fca1ba2f4 | ||
|
|
504d00353d | ||
|
|
ce67c75f1f | ||
|
|
95509a58cd | ||
|
|
548608490a | ||
|
|
21b3f5321a | ||
|
|
7953078a31 | ||
|
|
b75d606c91 | ||
|
|
ca3e1ce9b0 | ||
|
|
58744df1c5 | ||
|
|
1181a00fe9 | ||
|
|
71f547219c | ||
|
|
35b08e1e3d | ||
|
|
fd2bead226 | ||
|
|
ae5cb7a0da | ||
|
|
e425c1cf59 | ||
|
|
e3ab9d6460 | ||
|
|
c210011c84 | ||
|
|
d5b884f824 | ||
|
|
2751d87d01 | ||
|
|
8849aa02a3 | ||
|
|
f49e9f4f09 | ||
|
|
f0a6db351e | ||
|
|
53b177b3c1 | ||
|
|
c6df34f55b | ||
|
|
ea6c19638c | ||
|
|
28e3543ec4 | ||
|
|
752df1681a | ||
|
|
7865525451 | ||
|
|
dcacbf606a | ||
|
|
4a5019d925 | ||
|
|
1b7b3b4e66 | ||
|
|
37285038d3 | ||
|
|
c32fb85dbd | ||
|
|
91a731f2ae | ||
|
|
bb2587664a | ||
|
|
e41761eb1b | ||
|
|
9a9ff839a9 | ||
|
|
f66eb5a0a3 | ||
|
|
4f7336f0e4 | ||
|
|
e6e6ad2e1f | ||
|
|
94a27e351f | ||
|
|
28b8043c5b | ||
|
|
78df63a6af | ||
|
|
a69dfe7b20 | ||
|
|
d0c9cd28d1 | ||
|
|
9e1cabde36 | ||
|
|
c7cd8b4459 | ||
|
|
3d628a6fe2 | ||
|
|
51fad4a6c6 | ||
|
|
1a8883fb63 | ||
|
|
a70a821d28 | ||
|
|
a8d110ad74 | ||
|
|
013351a2ee | ||
|
|
ad3f0a348a | ||
|
|
9a411ebf32 | ||
|
|
4188b54c28 | ||
|
|
19010d3766 | ||
|
|
02968cda63 | ||
|
|
098e304118 | ||
|
|
650c45dcc5 | ||
|
|
93f55f3ccf | ||
|
|
569db3c1d2 | ||
|
|
26d97d3374 | ||
|
|
3acfa1b39b | ||
|
|
bbc67f8506 | ||
|
|
8343b56870 | ||
|
|
008d900f81 | ||
|
|
32e5d6cd15 | ||
|
|
28c0797d30 | ||
|
|
7ae657880d | ||
|
|
a701aa7292 | ||
|
|
db67cffb4d | ||
|
|
433f934783 | ||
|
|
0dc6778548 | ||
|
|
c86b52698b | ||
|
|
e5e5aa7ded | ||
|
|
4474b9b371 | ||
|
|
26e966852c | ||
|
|
852166f5cc | ||
|
|
75ac92b90f | ||
|
|
96f8e5158e | ||
|
|
b68f3f7781 | ||
|
|
36bef17224 | ||
|
|
715771bcff | ||
|
|
8e264baaa2 | ||
|
|
8ff147de6d | ||
|
|
71057c586f | ||
|
|
fac22f4038 | ||
|
|
40094779d7 | ||
|
|
2552aa45c3 | ||
|
|
c2972a80f9 | ||
|
|
791a440709 | ||
|
|
13145dd9a7 | ||
|
|
e9c477dcf2 | ||
|
|
8eebd19884 | ||
|
|
a54b35a4d6 | ||
|
|
8a6f7a5e78 | ||
|
|
6752959d4a | ||
|
|
da52d065a4 | ||
|
|
255e45ca58 | ||
|
|
b731b7cf12 | ||
|
|
5f014635e1 | ||
|
|
ef3d8314d3 | ||
|
|
7ef3fd567f | ||
|
|
b773e27ad1 | ||
|
|
a77c0a1098 | ||
|
|
57b9ddf20e | ||
|
|
c7b5fb9116 | ||
|
|
ba97d0e838 | ||
|
|
b8085e2c42 | ||
|
|
c251b312d8 | ||
|
|
14fb17e22f | ||
|
|
a34c87ab46 | ||
|
|
1ad9cc8c67 | ||
|
|
5627d0d7fd | ||
|
|
2cfdbefde8 | ||
|
|
7dabcdace8 | ||
|
|
187a70f760 | ||
|
|
48303589e9 | ||
|
|
8385b27cad | ||
|
|
abd75aedd7 | ||
|
|
daf54ad54d | ||
|
|
94fe677f91 | ||
|
|
3de85098e5 | ||
|
|
5524dc8773 | ||
|
|
19dd5f3e32 | ||
|
|
99cb610b12 | ||
|
|
9d3963559a |
14
.gitignore
vendored
14
.gitignore
vendored
@@ -1,9 +1,13 @@
|
||||
venv/
|
||||
.DS_Store
|
||||
.tags
|
||||
.ipynb_checkpoints
|
||||
.idea
|
||||
.sconsign.dblite
|
||||
model2.png
|
||||
a.out
|
||||
|
||||
*.DSYM
|
||||
*.d
|
||||
*.pyc
|
||||
*.pyo
|
||||
@@ -23,7 +27,17 @@ clcache
|
||||
board/obj/
|
||||
selfdrive/boardd/boardd
|
||||
selfdrive/logcatd/logcatd
|
||||
selfdrive/mapd/default_speeds_by_region.json
|
||||
selfdrive/proclogd/proclogd
|
||||
selfdrive/ui/ui
|
||||
selfdrive/test/tests/plant/out
|
||||
selfdrive/visiond/visiond
|
||||
selfdrive/loggerd/loggerd
|
||||
selfdrive/sensord/gpsd
|
||||
selfdrive/sensord/sensord
|
||||
/src/
|
||||
|
||||
one
|
||||
openpilot
|
||||
xx
|
||||
|
||||
|
||||
9
.gitmodules
vendored
9
.gitmodules
vendored
@@ -1,9 +0,0 @@
|
||||
[submodule "panda"]
|
||||
path = panda
|
||||
url = https://github.com/commaai/panda.git
|
||||
[submodule "opendbc"]
|
||||
path = opendbc
|
||||
url = https://github.com/commaai/opendbc.git
|
||||
[submodule "pyextra"]
|
||||
path = pyextra
|
||||
url = https://github.com/commaai/openpilot-pyextra.git
|
||||
585
.pylintrc
Normal file
585
.pylintrc
Normal file
@@ -0,0 +1,585 @@
|
||||
[MASTER]
|
||||
|
||||
# A comma-separated list of package or module names from where C extensions may
|
||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||
# run arbitrary code
|
||||
extension-pkg-whitelist=scipy
|
||||
|
||||
# Add files or directories to the blacklist. They should be base names, not
|
||||
# paths.
|
||||
ignore=CVS
|
||||
|
||||
# Add files or directories matching the regex patterns to the blacklist. The
|
||||
# regex matches against base names, not paths.
|
||||
ignore-patterns=
|
||||
|
||||
# Python code to execute, usually for sys.path manipulation such as
|
||||
# pygtk.require().
|
||||
#init-hook=
|
||||
|
||||
# Use multiple processes to speed up Pylint.
|
||||
jobs=4
|
||||
|
||||
# List of plugins (as comma separated values of python modules names) to load,
|
||||
# usually to register additional checkers.
|
||||
load-plugins=
|
||||
|
||||
# Pickle collected data for later comparisons.
|
||||
persistent=yes
|
||||
|
||||
# Specify a configuration file.
|
||||
#rcfile=
|
||||
|
||||
# When enabled, pylint would attempt to guess common misconfiguration and emit
|
||||
# user-friendly hints instead of false-positive error messages
|
||||
suggestion-mode=yes
|
||||
|
||||
# Allow loading of arbitrary C extensions. Extensions are imported into the
|
||||
# active Python interpreter and may run arbitrary code.
|
||||
unsafe-load-any-extension=no
|
||||
|
||||
|
||||
[MESSAGES CONTROL]
|
||||
|
||||
# Only show warnings with the listed confidence levels. Leave empty to show
|
||||
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
|
||||
confidence=
|
||||
|
||||
# Disable the message, report, category or checker with the given id(s). You
|
||||
# can either give multiple identifiers separated by comma (,) or put this
|
||||
# option multiple times (only on the command line, not in the configuration
|
||||
# file where it should appear only once).You can also use "--disable=all" to
|
||||
# disable everything first and then reenable specific checks. For example, if
|
||||
# you want to run only the similarities checker, you can use "--disable=all
|
||||
# --enable=similarities". If you want to run only the classes checker, but have
|
||||
# no Warning level messages displayed, use"--disable=all --enable=classes
|
||||
# --disable=W"
|
||||
disable=print-statement,
|
||||
parameter-unpacking,
|
||||
unpacking-in-except,
|
||||
old-raise-syntax,
|
||||
backtick,
|
||||
long-suffix,
|
||||
old-ne-operator,
|
||||
old-octal-literal,
|
||||
import-star-module-level,
|
||||
non-ascii-bytes-literal,
|
||||
raw-checker-failed,
|
||||
bad-inline-option,
|
||||
locally-disabled,
|
||||
locally-enabled,
|
||||
file-ignored,
|
||||
suppressed-message,
|
||||
useless-suppression,
|
||||
deprecated-pragma,
|
||||
apply-builtin,
|
||||
basestring-builtin,
|
||||
buffer-builtin,
|
||||
cmp-builtin,
|
||||
coerce-builtin,
|
||||
execfile-builtin,
|
||||
file-builtin,
|
||||
long-builtin,
|
||||
raw_input-builtin,
|
||||
reduce-builtin,
|
||||
standarderror-builtin,
|
||||
unicode-builtin,
|
||||
xrange-builtin,
|
||||
coerce-method,
|
||||
delslice-method,
|
||||
getslice-method,
|
||||
setslice-method,
|
||||
no-absolute-import,
|
||||
old-division,
|
||||
dict-iter-method,
|
||||
dict-view-method,
|
||||
next-method-called,
|
||||
metaclass-assignment,
|
||||
indexing-exception,
|
||||
raising-string,
|
||||
reload-builtin,
|
||||
oct-method,
|
||||
hex-method,
|
||||
nonzero-method,
|
||||
cmp-method,
|
||||
input-builtin,
|
||||
round-builtin,
|
||||
intern-builtin,
|
||||
unichr-builtin,
|
||||
map-builtin-not-iterating,
|
||||
zip-builtin-not-iterating,
|
||||
range-builtin-not-iterating,
|
||||
filter-builtin-not-iterating,
|
||||
using-cmp-argument,
|
||||
eq-without-hash,
|
||||
div-method,
|
||||
idiv-method,
|
||||
rdiv-method,
|
||||
exception-message-attribute,
|
||||
invalid-str-codec,
|
||||
sys-max-int,
|
||||
bad-python3-import,
|
||||
deprecated-string-function,
|
||||
deprecated-str-translate-call,
|
||||
deprecated-itertools-function,
|
||||
deprecated-types-field,
|
||||
next-method-defined,
|
||||
dict-items-not-iterating,
|
||||
dict-keys-not-iterating,
|
||||
dict-values-not-iterating,
|
||||
bad-indentation,
|
||||
line-too-long,
|
||||
missing-docstring,
|
||||
multiple-statements,
|
||||
bad-continuation,
|
||||
invalid-name,
|
||||
too-many-arguments,
|
||||
too-many-locals,
|
||||
superfluous-parens,
|
||||
bad-whitespace,
|
||||
too-many-instance-attributes,
|
||||
wrong-import-position,
|
||||
ungrouped-imports,
|
||||
wrong-import-order,
|
||||
protected-access,
|
||||
trailing-whitespace,
|
||||
too-many-branches,
|
||||
too-few-public-methods,
|
||||
too-many-statements,
|
||||
trailing-newlines,
|
||||
attribute-defined-outside-init,
|
||||
too-many-return-statements,
|
||||
too-many-public-methods,
|
||||
unused-argument,
|
||||
old-style-class,
|
||||
no-init,
|
||||
len-as-condition,
|
||||
unneeded-not,
|
||||
no-self-use,
|
||||
multiple-imports,
|
||||
no-else-return,
|
||||
logging-not-lazy,
|
||||
fixme,
|
||||
redefined-outer-name,
|
||||
unused-variable,
|
||||
unsubscriptable-object,
|
||||
expression-not-assigned,
|
||||
too-many-boolean-expressions,
|
||||
consider-using-ternary,
|
||||
invalid-unary-operand-type,
|
||||
relative-import,
|
||||
deprecated-lambda
|
||||
|
||||
|
||||
# Enable the message, report, category or checker with the given id(s). You can
|
||||
# either give multiple identifier separated by comma (,) or put this option
|
||||
# multiple time (only on the command line, not in the configuration file where
|
||||
# it should appear only once). See also the "--disable" option for examples.
|
||||
enable=c-extension-no-member
|
||||
|
||||
|
||||
[REPORTS]
|
||||
|
||||
# Python expression which should return a note less than 10 (10 is the highest
|
||||
# note). You have access to the variables errors warning, statement which
|
||||
# respectively contain the number of errors / warnings messages and the total
|
||||
# number of statements analyzed. This is used by the global evaluation report
|
||||
# (RP0004).
|
||||
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
|
||||
|
||||
# Template used to display messages. This is a python new-style format string
|
||||
# used to format the message information. See doc for all details
|
||||
#msg-template=
|
||||
|
||||
# Set the output format. Available formats are text, parseable, colorized, json
|
||||
# and msvs (visual studio).You can also give a reporter class, eg
|
||||
# mypackage.mymodule.MyReporterClass.
|
||||
output-format=text
|
||||
|
||||
# Tells whether to display a full report or only the messages
|
||||
reports=no
|
||||
|
||||
# Activate the evaluation score.
|
||||
score=yes
|
||||
|
||||
|
||||
[REFACTORING]
|
||||
|
||||
# Maximum number of nested blocks for function / method body
|
||||
max-nested-blocks=5
|
||||
|
||||
# Complete name of functions that never returns. When checking for
|
||||
# inconsistent-return-statements if a never returning function is called then
|
||||
# it will be considered as an explicit return statement and no message will be
|
||||
# printed.
|
||||
never-returning-functions=optparse.Values,sys.exit
|
||||
|
||||
|
||||
[LOGGING]
|
||||
|
||||
# Logging modules to check that the string format arguments are in logging
|
||||
# function parameter format
|
||||
logging-modules=logging
|
||||
|
||||
|
||||
[SPELLING]
|
||||
|
||||
# Limits count of emitted suggestions for spelling mistakes
|
||||
max-spelling-suggestions=4
|
||||
|
||||
# Spelling dictionary name. Available dictionaries: none. To make it working
|
||||
# install python-enchant package.
|
||||
spelling-dict=
|
||||
|
||||
# List of comma separated words that should not be checked.
|
||||
spelling-ignore-words=
|
||||
|
||||
# A path to a file that contains private dictionary; one word per line.
|
||||
spelling-private-dict-file=
|
||||
|
||||
# Tells whether to store unknown words to indicated private dictionary in
|
||||
# --spelling-private-dict-file option instead of raising a message.
|
||||
spelling-store-unknown-words=no
|
||||
|
||||
|
||||
[MISCELLANEOUS]
|
||||
|
||||
# List of note tags to take in consideration, separated by a comma.
|
||||
notes=FIXME,
|
||||
XXX,
|
||||
TODO
|
||||
|
||||
|
||||
[SIMILARITIES]
|
||||
|
||||
# Ignore comments when computing similarities.
|
||||
ignore-comments=yes
|
||||
|
||||
# Ignore docstrings when computing similarities.
|
||||
ignore-docstrings=yes
|
||||
|
||||
# Ignore imports when computing similarities.
|
||||
ignore-imports=no
|
||||
|
||||
# Minimum lines number of a similarity.
|
||||
min-similarity-lines=4
|
||||
|
||||
|
||||
[TYPECHECK]
|
||||
|
||||
# List of decorators that produce context managers, such as
|
||||
# contextlib.contextmanager. Add to this list to register other decorators that
|
||||
# produce valid context managers.
|
||||
contextmanager-decorators=contextlib.contextmanager
|
||||
|
||||
# List of members which are set dynamically and missed by pylint inference
|
||||
# system, and so shouldn't trigger E1101 when accessed. Python regular
|
||||
# expressions are accepted.
|
||||
generated-members=capnp.* cereal.* pygame.* zmq.* setproctitle.* smbus2.* usb1.* serial.* cv2.*
|
||||
|
||||
# Tells whether missing members accessed in mixin class should be ignored. A
|
||||
# mixin class is detected if its name ends with "mixin" (case insensitive).
|
||||
ignore-mixin-members=yes
|
||||
|
||||
# This flag controls whether pylint should warn about no-member and similar
|
||||
# checks whenever an opaque object is returned when inferring. The inference
|
||||
# can return multiple potential results while evaluating a Python object, but
|
||||
# some branches might not be evaluated, which results in partial inference. In
|
||||
# that case, it might be useful to still emit no-member and other checks for
|
||||
# the rest of the inferred objects.
|
||||
ignore-on-opaque-inference=yes
|
||||
|
||||
# List of class names for which member attributes should not be checked (useful
|
||||
# for classes with dynamically set attributes). This supports the use of
|
||||
# qualified names.
|
||||
ignored-classes=optparse.Values,thread._local,_thread._local
|
||||
|
||||
# List of module names for which member attributes should not be checked
|
||||
# (useful for modules/projects where namespaces are manipulated during runtime
|
||||
# and thus existing member attributes cannot be deduced by static analysis. It
|
||||
# supports qualified module names, as well as Unix pattern matching.
|
||||
ignored-modules=flask setproctitle usb1 flask.ext.socketio smbus2 usb1.*
|
||||
|
||||
# Show a hint with possible names when a member name was not found. The aspect
|
||||
# of finding the hint is based on edit distance.
|
||||
missing-member-hint=yes
|
||||
|
||||
# The minimum edit distance a name should have in order to be considered a
|
||||
# similar match for a missing member name.
|
||||
missing-member-hint-distance=1
|
||||
|
||||
# The total number of similar names that should be taken in consideration when
|
||||
# showing a hint for a missing member.
|
||||
missing-member-max-choices=1
|
||||
|
||||
|
||||
[VARIABLES]
|
||||
|
||||
# List of additional names supposed to be defined in builtins. Remember that
|
||||
# you should avoid to define new builtins when possible.
|
||||
additional-builtins=
|
||||
|
||||
# Tells whether unused global variables should be treated as a violation.
|
||||
allow-global-unused-variables=yes
|
||||
|
||||
# List of strings which can identify a callback function by name. A callback
|
||||
# name must start or end with one of those strings.
|
||||
callbacks=cb_,
|
||||
_cb
|
||||
|
||||
# A regular expression matching the name of dummy variables (i.e. expectedly
|
||||
# not used).
|
||||
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
|
||||
|
||||
# Argument names that match this expression will be ignored. Default to name
|
||||
# with leading underscore
|
||||
ignored-argument-names=_.*|^ignored_|^unused_
|
||||
|
||||
# Tells whether we should check for unused import in __init__ files.
|
||||
init-import=no
|
||||
|
||||
# List of qualified module names which can have objects that can redefine
|
||||
# builtins.
|
||||
redefining-builtins-modules=six.moves,past.builtins,future.builtins
|
||||
|
||||
|
||||
[FORMAT]
|
||||
|
||||
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
|
||||
expected-line-ending-format=
|
||||
|
||||
# Regexp for a line that is allowed to be longer than the limit.
|
||||
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
|
||||
|
||||
# Number of spaces of indent required inside a hanging or continued line.
|
||||
indent-after-paren=4
|
||||
|
||||
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
|
||||
# tab).
|
||||
indent-string=' '
|
||||
|
||||
# Maximum number of characters on a single line.
|
||||
max-line-length=100
|
||||
|
||||
# Maximum number of lines in a module
|
||||
max-module-lines=1000
|
||||
|
||||
# List of optional constructs for which whitespace checking is disabled. `dict-
|
||||
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
|
||||
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
|
||||
# `empty-line` allows space-only lines.
|
||||
no-space-check=trailing-comma,
|
||||
dict-separator
|
||||
|
||||
# Allow the body of a class to be on the same line as the declaration if body
|
||||
# contains single statement.
|
||||
single-line-class-stmt=no
|
||||
|
||||
# Allow the body of an if to be on the same line as the test if there is no
|
||||
# else.
|
||||
single-line-if-stmt=no
|
||||
|
||||
|
||||
[BASIC]
|
||||
|
||||
# Naming style matching correct argument names
|
||||
argument-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct argument names. Overrides argument-
|
||||
# naming-style
|
||||
#argument-rgx=
|
||||
|
||||
# Naming style matching correct attribute names
|
||||
attr-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct attribute names. Overrides attr-naming-
|
||||
# style
|
||||
#attr-rgx=
|
||||
|
||||
# Bad variable names which should always be refused, separated by a comma
|
||||
bad-names=foo,
|
||||
bar,
|
||||
baz,
|
||||
toto,
|
||||
tutu,
|
||||
tata
|
||||
|
||||
# Naming style matching correct class attribute names
|
||||
class-attribute-naming-style=any
|
||||
|
||||
# Regular expression matching correct class attribute names. Overrides class-
|
||||
# attribute-naming-style
|
||||
#class-attribute-rgx=
|
||||
|
||||
# Naming style matching correct class names
|
||||
class-naming-style=PascalCase
|
||||
|
||||
# Regular expression matching correct class names. Overrides class-naming-style
|
||||
#class-rgx=
|
||||
|
||||
# Naming style matching correct constant names
|
||||
const-naming-style=UPPER_CASE
|
||||
|
||||
# Regular expression matching correct constant names. Overrides const-naming-
|
||||
# style
|
||||
#const-rgx=
|
||||
|
||||
# Minimum line length for functions/classes that require docstrings, shorter
|
||||
# ones are exempt.
|
||||
docstring-min-length=-1
|
||||
|
||||
# Naming style matching correct function names
|
||||
function-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct function names. Overrides function-
|
||||
# naming-style
|
||||
#function-rgx=
|
||||
|
||||
# Good variable names which should always be accepted, separated by a comma
|
||||
good-names=i,
|
||||
j,
|
||||
k,
|
||||
ex,
|
||||
Run,
|
||||
_
|
||||
|
||||
# Include a hint for the correct naming format with invalid-name
|
||||
include-naming-hint=no
|
||||
|
||||
# Naming style matching correct inline iteration names
|
||||
inlinevar-naming-style=any
|
||||
|
||||
# Regular expression matching correct inline iteration names. Overrides
|
||||
# inlinevar-naming-style
|
||||
#inlinevar-rgx=
|
||||
|
||||
# Naming style matching correct method names
|
||||
method-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct method names. Overrides method-naming-
|
||||
# style
|
||||
#method-rgx=
|
||||
|
||||
# Naming style matching correct module names
|
||||
module-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct module names. Overrides module-naming-
|
||||
# style
|
||||
#module-rgx=
|
||||
|
||||
# Colon-delimited sets of names that determine each other's naming style when
|
||||
# the name regexes allow several styles.
|
||||
name-group=
|
||||
|
||||
# Regular expression which should only match function or class names that do
|
||||
# not require a docstring.
|
||||
no-docstring-rgx=^_
|
||||
|
||||
# List of decorators that produce properties, such as abc.abstractproperty. Add
|
||||
# to this list to register other decorators that produce valid properties.
|
||||
property-classes=abc.abstractproperty
|
||||
|
||||
# Naming style matching correct variable names
|
||||
variable-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct variable names. Overrides variable-
|
||||
# naming-style
|
||||
#variable-rgx=
|
||||
|
||||
|
||||
[DESIGN]
|
||||
|
||||
# Maximum number of arguments for function / method
|
||||
max-args=5
|
||||
|
||||
# Maximum number of attributes for a class (see R0902).
|
||||
max-attributes=7
|
||||
|
||||
# Maximum number of boolean expressions in a if statement
|
||||
max-bool-expr=5
|
||||
|
||||
# Maximum number of branch for function / method body
|
||||
max-branches=12
|
||||
|
||||
# Maximum number of locals for function / method body
|
||||
max-locals=15
|
||||
|
||||
# Maximum number of parents for a class (see R0901).
|
||||
max-parents=7
|
||||
|
||||
# Maximum number of public methods for a class (see R0904).
|
||||
max-public-methods=20
|
||||
|
||||
# Maximum number of return / yield for function / method body
|
||||
max-returns=6
|
||||
|
||||
# Maximum number of statements in function / method body
|
||||
max-statements=50
|
||||
|
||||
# Minimum number of public methods for a class (see R0903).
|
||||
min-public-methods=2
|
||||
|
||||
|
||||
[CLASSES]
|
||||
|
||||
# List of method names used to declare (i.e. assign) instance attributes.
|
||||
defining-attr-methods=__init__,
|
||||
__new__,
|
||||
setUp
|
||||
|
||||
# List of member names, which should be excluded from the protected access
|
||||
# warning.
|
||||
exclude-protected=_asdict,
|
||||
_fields,
|
||||
_replace,
|
||||
_source,
|
||||
_make
|
||||
|
||||
# List of valid names for the first argument in a class method.
|
||||
valid-classmethod-first-arg=cls
|
||||
|
||||
# List of valid names for the first argument in a metaclass class method.
|
||||
valid-metaclass-classmethod-first-arg=mcs
|
||||
|
||||
|
||||
[IMPORTS]
|
||||
|
||||
# Allow wildcard imports from modules that define __all__.
|
||||
allow-wildcard-with-all=no
|
||||
|
||||
# Analyse import fallback blocks. This can be used to support both Python 2 and
|
||||
# 3 compatible code, which means that the block might have code that exists
|
||||
# only in one or another interpreter, leading to false positives when analysed.
|
||||
analyse-fallback-blocks=no
|
||||
|
||||
# Deprecated modules which should not be used, separated by a comma
|
||||
deprecated-modules=regsub,
|
||||
TERMIOS,
|
||||
Bastion,
|
||||
rexec
|
||||
|
||||
# Create a graph of external dependencies in the given file (report RP0402 must
|
||||
# not be disabled)
|
||||
ext-import-graph=
|
||||
|
||||
# Create a graph of every (i.e. internal and external) dependencies in the
|
||||
# given file (report RP0402 must not be disabled)
|
||||
import-graph=
|
||||
|
||||
# Create a graph of internal dependencies in the given file (report RP0402 must
|
||||
# not be disabled)
|
||||
int-import-graph=
|
||||
|
||||
# Force import order to recognize a module as part of the standard
|
||||
# compatibility libraries.
|
||||
known-standard-library=
|
||||
|
||||
# Force import order to recognize a module as part of a third party library.
|
||||
known-third-party=enchant
|
||||
|
||||
|
||||
[EXCEPTIONS]
|
||||
|
||||
# Exceptions that will emit a warning when being caught. Defaults to
|
||||
# "Exception"
|
||||
overgeneral-exceptions=Exception
|
||||
@@ -3,10 +3,5 @@ sudo: required
|
||||
services:
|
||||
- docker
|
||||
|
||||
install:
|
||||
- docker build -t tmppilot -f Dockerfile.openpilot .
|
||||
|
||||
script:
|
||||
- docker run --rm
|
||||
-v "$(pwd)"/selfdrive/test/plant/out:/tmp/openpilot/selfdrive/test/plant/out
|
||||
tmppilot /bin/sh -c 'cd /tmp/openpilot/selfdrive/test/plant && ./runtest.sh'
|
||||
- ./run_docker_tests.sh
|
||||
|
||||
31
CONTRIBUTING.md
Normal file
31
CONTRIBUTING.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# How to contribute
|
||||
|
||||
Our software is open source so you can solve your own problems without needing help from others. And if you solve a problem and are so kind, you can upstream it for the rest of the world to use.
|
||||
|
||||
Most open source development activity is coordinated through our [Discord](https://discord.comma.ai). A lot of documentation is available on our [medium](https://medium.com/@comma_ai/)
|
||||
|
||||
## Getting Started
|
||||
|
||||
* Join our [Discord](https://discord.comma.ai)
|
||||
* Make sure you have a [GitHub account](https://github.com/signup/free)
|
||||
* Fork [our repositories](https://github.com/commaai) on GitHub
|
||||
|
||||
## Testing
|
||||
|
||||
### Local Testing
|
||||
|
||||
You can test your changes on your machine by running `run_docker_tests.sh`. This will run some automated tests in docker against your code.
|
||||
|
||||
### Automated Testing
|
||||
|
||||
All PRs are automatically checked by travis. Check out `.travis.yml` for what travis runs. Any new tests sould be added to travis.
|
||||
|
||||
### Code Style and Linting
|
||||
|
||||
Code is automatically check for style by travis as part of the automated tests. You can also run these yourself by running `check_code_quality.sh`.
|
||||
|
||||
## Car Ports (openpilot)
|
||||
|
||||
We've released a [Model Port guide](https://medium.com/@comma_ai/openpilot-port-guide-for-toyota-models-e5467f4b5fe6) for porting to Toyota/Lexus models.
|
||||
|
||||
If you port openpilot to a substantially new car brand, see this more generic [Brand Port guide](https://medium.com/@comma_ai/how-to-write-a-car-port-for-openpilot-7ce0785eda84). You might also be eligible for a bounty. See our bounties at [comma.ai/bounties.html](https://comma.ai/bounties.html)
|
||||
@@ -1,13 +1,57 @@
|
||||
FROM ubuntu:16.04
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
RUN apt-get update && apt-get install -y build-essential clang vim screen wget bzip2 git libglib2.0-0 python-pip capnproto libcapnp-dev libzmq5-dev libffi-dev
|
||||
RUN apt-get update && apt-get install -y \
|
||||
autoconf \
|
||||
build-essential \
|
||||
bzip2 \
|
||||
clang \
|
||||
git \
|
||||
libarchive-dev \
|
||||
libavcodec-dev \
|
||||
libavdevice-dev \
|
||||
libavfilter-dev \
|
||||
libavresample-dev \
|
||||
libavutil-dev \
|
||||
libffi-dev \
|
||||
libglib2.0-0 \
|
||||
libssl-dev \
|
||||
libswscale-dev \
|
||||
libtool \
|
||||
libusb-1.0-0 \
|
||||
libzmq5-dev \
|
||||
ocl-icd-libopencl1 \
|
||||
ocl-icd-opencl-dev \
|
||||
opencl-headers \
|
||||
pkg-config \
|
||||
python-pip \
|
||||
wget
|
||||
|
||||
RUN pip install numpy==1.11.2 scipy==0.18.1 matplotlib
|
||||
COPY phonelibs/install_capnp.sh /tmp/install_capnp.sh
|
||||
RUN /tmp/install_capnp.sh
|
||||
|
||||
COPY requirements_openpilot.txt /tmp/
|
||||
RUN pip install -r /tmp/requirements_openpilot.txt
|
||||
RUN pip install --upgrade pip==18.0
|
||||
RUN pip install pipenv==2018.11.26
|
||||
|
||||
COPY Pipfile /tmp/
|
||||
COPY Pipfile.lock /tmp/
|
||||
RUN cd /tmp && pipenv install --deploy --system
|
||||
|
||||
ENV PYTHONPATH /tmp/openpilot:$PYTHONPATH
|
||||
|
||||
COPY . /tmp/openpilot
|
||||
RUN git clone --branch v0.6 https://github.com/commaai/openpilot-tools.git /tmp/openpilot/tools
|
||||
RUN pip install -r /tmp/openpilot/tools/requirements.txt
|
||||
RUN pip install fastcluster==1.1.20 scipy==0.19.1
|
||||
|
||||
COPY ./.pylintrc /tmp/openpilot/.pylintrc
|
||||
COPY ./common /tmp/openpilot/common
|
||||
COPY ./cereal /tmp/openpilot/cereal
|
||||
COPY ./opendbc /tmp/openpilot/opendbc
|
||||
COPY ./selfdrive /tmp/openpilot/selfdrive
|
||||
COPY ./phonelibs /tmp/openpilot/phonelibs
|
||||
COPY ./pyextra /tmp/openpilot/pyextra
|
||||
COPY ./panda /tmp/openpilot/panda
|
||||
|
||||
RUN mkdir -p /tmp/openpilot/selfdrive/test/out
|
||||
RUN make -C /tmp/openpilot/selfdrive/controls/lib/longitudinal_mpc clean
|
||||
RUN make -C /tmp/openpilot/selfdrive/controls/lib/lateral_mpc clean
|
||||
|
||||
7
LICENSE
Normal file
7
LICENSE
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright (c) 2018, Comma.ai, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
9
Makefile
9
Makefile
@@ -1,6 +1,9 @@
|
||||
|
||||
code_dir := $(shell pwd)
|
||||
|
||||
# TODO: Add a global build system
|
||||
|
||||
.PHONY: all
|
||||
|
||||
# TODO: Add a global build system to openpilot
|
||||
all:
|
||||
cd /data/openpilot/selfdrive && PYTHONPATH=/data/openpilot PREPAREONLY=1 /data/openpilot/selfdrive/manager.py
|
||||
cd selfdrive && PYTHONPATH=$(code_dir) PREPAREONLY=1 ./manager.py
|
||||
|
||||
|
||||
143
Pipfile
Normal file
143
Pipfile
Normal file
@@ -0,0 +1,143 @@
|
||||
[[source]]
|
||||
name = "pypi"
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
|
||||
[dev-packages]
|
||||
ipython = "<6.0"
|
||||
aenum = "*"
|
||||
azure-batch = "==4.1.3"
|
||||
azure-common = "==1.1.16"
|
||||
azure-nspkg = "==3.0.1"
|
||||
azure-storage-blob = "==1.3.1"
|
||||
azure-storage-common = "==1.3.0"
|
||||
azure-storage-nspkg = "==3.0.0"
|
||||
bincopy = "*"
|
||||
bleach = "==1.5.0"
|
||||
boto = "*"
|
||||
"boto3" = "*"
|
||||
celery = "*"
|
||||
control = "*"
|
||||
datadog = "*"
|
||||
decorator = "*"
|
||||
dlib = "*"
|
||||
dominate = "*"
|
||||
elasticsearch = "*"
|
||||
entium = "==0.1.4"
|
||||
fasteners = "*"
|
||||
future = "*"
|
||||
futures = "*"
|
||||
gevent = "*"
|
||||
pycocotools = {git = "https://github.com/cocodataset/cocoapi.git",subdirectory = "PythonAPI"}
|
||||
gunicorn = "*"
|
||||
"h5py" = "*"
|
||||
hexdump = "*"
|
||||
"html5lib" = "==0.9999999"
|
||||
imageio = "*"
|
||||
intervaltree = "*"
|
||||
ipykernel = "<5.0"
|
||||
joblib = "*"
|
||||
json-logging-py = "*"
|
||||
jupyter = "*"
|
||||
libarchive = "*"
|
||||
lru-dict = "*"
|
||||
lxml = "*"
|
||||
matplotlib = "==2.2.3"
|
||||
"mpld3" = "*"
|
||||
msgpack-python = "*"
|
||||
nbstripout = "*"
|
||||
nose-parameterized = "*"
|
||||
numpy = "==1.14.5"
|
||||
osmium = "==2.15.0"
|
||||
pbr = "==5.1.3"
|
||||
percache = "*"
|
||||
pprofile = "*"
|
||||
psutil = "*"
|
||||
pycurl = "*"
|
||||
git-pylint-commit-hook = "==2.5.1"
|
||||
pymongo = "*"
|
||||
"pynmea2" = "*"
|
||||
pypolyline = "==0.1.17"
|
||||
pysendfile = "*"
|
||||
python-logstash = "*"
|
||||
pyvcd = "*"
|
||||
redis = "*"
|
||||
redlock = "*"
|
||||
"s2sphere" = "*"
|
||||
scikit-image = "*"
|
||||
"subprocess32" = "*"
|
||||
supervisor = "*"
|
||||
tenacity = "*"
|
||||
tensorflow-gpu = "==1.13.0rc0"
|
||||
"transforms3d" = "*"
|
||||
utm = "*"
|
||||
"v4l2" = "*"
|
||||
visdom = "*"
|
||||
PyJWT = "==1.4.1"
|
||||
PyMySQL = "==0.9.2"
|
||||
Theano = "*"
|
||||
Werkzeug = "*"
|
||||
"backports.lzma" = "*"
|
||||
Flask-Cors = "*"
|
||||
Flask-SocketIO = "*"
|
||||
"GeoAlchemy2" = "*"
|
||||
Keras = ">=2.1.6"
|
||||
keras-maskrcnn = "*"
|
||||
keras-retinanet = "*"
|
||||
Pygments = "*"
|
||||
PyNaCl = "*"
|
||||
"PySDL2" = "*"
|
||||
reverse_geocoder = "*"
|
||||
Shapely = "*"
|
||||
SQLAlchemy = "==1.2.7"
|
||||
uWSGI = "*"
|
||||
scipy = "*"
|
||||
fastcluster = "==1.1.25"
|
||||
backports-abc = "*"
|
||||
pygame = "*"
|
||||
simplejson = "*"
|
||||
python-logstash-async = "*"
|
||||
pandas = "*"
|
||||
seaborn = "*"
|
||||
|
||||
[packages]
|
||||
overpy = {git = "https://github.com/commaai/python-overpy.git",ref = "f86529af402d4642e1faeb146671c40284007323"}
|
||||
atomicwrites = "*"
|
||||
cffi = "*"
|
||||
crcmod = "*"
|
||||
hexdump = "*"
|
||||
libusb1 = "*"
|
||||
numpy = "*"
|
||||
psutil = "*"
|
||||
pycapnp = "*"
|
||||
cryptography = "*"
|
||||
pyserial = "*"
|
||||
python-dateutil = "*"
|
||||
pyzmq = "*"
|
||||
raven = "*"
|
||||
requests = "*"
|
||||
setproctitle = "*"
|
||||
six = "*"
|
||||
smbus2 = "*"
|
||||
sympy = "*"
|
||||
tqdm = "*"
|
||||
Cython = "*"
|
||||
PyYAML = "*"
|
||||
websocket_client = "*"
|
||||
Logentries = {git = "https://github.com/commaai/le_python.git",ref = "5eef8f5be5929d33973e1b10e686fa0cdcd6792f"}
|
||||
urllib3 = "*"
|
||||
chardet = "*"
|
||||
idna = "*"
|
||||
gunicorn = "*"
|
||||
utm = "*"
|
||||
json-rpc = "*"
|
||||
Flask = "*"
|
||||
PyJWT = "*"
|
||||
"Jinja2" = "*"
|
||||
nose = "*"
|
||||
pyflakes = "*"
|
||||
pylint = "*"
|
||||
pycryptodome = "*"
|
||||
|
||||
[requires]
|
||||
python_version = "2.7"
|
||||
2860
Pipfile.lock
generated
Normal file
2860
Pipfile.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
249
README.md
249
README.md
@@ -1,108 +1,235 @@
|
||||
[](#)
|
||||
|
||||
Welcome to openpilot
|
||||
======
|
||||
|
||||
[openpilot](http://github.com/commaai/openpilot) is an open source driving agent.
|
||||
[openpilot](http://github.com/commaai/openpilot) is an open source driving agent. 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).
|
||||
|
||||
Currently it performs the functions of Adaptive Cruise Control (ACC) and Lane Keeping Assist System (LKAS) for Hondas and Acuras. It's about on par with Tesla Autopilot at launch, 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.
|
||||
|
||||
The openpilot codebase has been written to be concise and enable rapid prototyping. We look forward to your contributions - improving real vehicle automation has never been easier.
|
||||
Table of Contents
|
||||
=======================
|
||||
|
||||
Here are [some](https://www.youtube.com/watch?v=9OwTJFuDI7g) [videos](https://www.youtube.com/watch?v=64Wvt5pYQmE) [of](https://www.youtube.com/watch?v=6IW7Nejsr3A) [it](https://www.youtube.com/watch?v=-VN1YcC83nA) [running](https://www.youtube.com/watch?v=EQJZvVeihZk). And a really cool [tutorial](https://www.youtube.com/watch?v=PwOnsT2UW5o).
|
||||
* [Community](#community)
|
||||
* [Hardware](#hardware)
|
||||
* [Supported Cars](#supported-cars)
|
||||
* [Community Maintained Cars](#community-maintained-cars)
|
||||
* [In Progress Cars](#in-progress-cars)
|
||||
* [How can I add support for my car?](#how-can-i-add-support-for-my-car)
|
||||
* [Directory structure](#directory-structure)
|
||||
* [User Data / chffr Account / Crash Reporting](#user-data--chffr-account--crash-reporting)
|
||||
* [Testing on PC](#testing-on-pc)
|
||||
* [Contributing](#contributing)
|
||||
* [Licensing](#licensing)
|
||||
|
||||
---
|
||||
|
||||
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).
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><a href="https://www.youtube.com/watch?v=ICOIin4p70w" title="YouTube" rel="noopener"><img src="https://i.imgur.com/gBTo7yB.png"></a></td>
|
||||
<td><a href="https://www.youtube.com/watch?v=1zCtj3ckGFo" title="YouTube" rel="noopener"><img src="https://i.imgur.com/gNhhcep.png"></a></td>
|
||||
<td><a href="https://www.youtube.com/watch?v=Qd2mjkBIRx0" title="YouTube" rel="noopener"><img src="https://i.imgur.com/tFnSexp.png"></a></td>
|
||||
<td><a href="https://www.youtube.com/watch?v=ju12vlBm59E" title="YouTube" rel="noopener"><img src="https://i.imgur.com/3BKiJVy.png"></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="https://www.youtube.com/watch?v=Z5VY5FzgNt4" title="YouTube" rel="noopener"><img src="https://i.imgur.com/3I9XOK2.png"></a></td>
|
||||
<td><a href="https://www.youtube.com/watch?v=blnhZC7OmMg" title="YouTube" rel="noopener"><img src="https://i.imgur.com/f9IgX6s.png"></a></td>
|
||||
<td><a href="https://www.youtube.com/watch?v=iRkz7FuJsA8" title="YouTube" rel="noopener"><img src="https://i.imgur.com/Vo5Zvmn.png"></a></td>
|
||||
<td><a href="https://www.youtube.com/watch?v=IHjEqAKDqjM" title="YouTube" rel="noopener"><img src="https://i.imgur.com/V9Zd81n.png"></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Hardware
|
||||
------
|
||||
|
||||
Right now openpilot supports the [neo research platform](http://github.com/commaai/neo) for vehicle control. We'd like to support other platforms as well.
|
||||
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.
|
||||
|
||||
Install openpilot on a neo device by entering ``https://openpilot.comma.ai`` during NEOS setup.
|
||||
|
||||
Supported Cars
|
||||
------
|
||||
|
||||
- Acura ILX 2016 with AcuraWatch Plus
|
||||
- Due to use of the cruise control for gas, it can only be enabled above 25 mph
|
||||
| Make | Model | Supported Package | Lateral | Longitudinal | No Accel Below | No Steer Below | Giraffe |
|
||||
| ---------------------| -------------------------| ---------------------| --------| ---------------| -----------------| ---------------|-------------------|
|
||||
| Acura | ILX 2016-18 | AcuraWatch Plus | Yes | Yes | 25mph<sup>1</sup>| 25mph | Nidec |
|
||||
| Acura | RDX 2016-18 | AcuraWatch Plus | Yes | Yes | 25mph<sup>1</sup>| 12mph | Nidec |
|
||||
| Buick<sup>3</sup> | Regal 2018 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom<sup>7</sup>|
|
||||
| Chevrolet<sup>3</sup>| Malibu 2017 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom<sup>7</sup>|
|
||||
| Chevrolet<sup>3</sup>| Volt 2017-18 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom<sup>7</sup>|
|
||||
| Cadillac<sup>3</sup> | ATS 2018 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom<sup>7</sup>|
|
||||
| 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 |
|
||||
| GMC<sup>3</sup> | Acadia Denali 2018 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom<sup>7</sup>|
|
||||
| Holden<sup>3</sup> | Astra 2017 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom<sup>7</sup>|
|
||||
| Honda | Accord 2018 | 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 | 25mph<sup>1</sup>| 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 | Odyssey 2018-19 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 0mph | Inverted Nidec |
|
||||
| Honda | Passport 2019 | All | Yes | Yes | 25mph<sup>1</sup>| 12mph | Inverted Nidec |
|
||||
| Honda | Pilot 2016-18 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph | Nidec |
|
||||
| Honda | Pilot 2019 | All | Yes | Yes | 25mph<sup>1</sup>| 12mph | Inverted Nidec |
|
||||
| Honda | Ridgeline 2017-19 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph | Nidec |
|
||||
| Hyundai | Santa Fe 2019 | All | Yes | Stock | 0mph | 0mph | Custom<sup>6</sup>|
|
||||
| Hyundai | Elantra 2017-19 | SCC + LKAS | Yes | Stock | 19mph | 34mph | Custom<sup>6</sup>|
|
||||
| Hyundai | Genesis 2018 | All | Yes | Stock | 19mph | 34mph | Custom<sup>6</sup>|
|
||||
| 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 | Custom<sup>6</sup>|
|
||||
| Kia | Sorento 2018 | All | Yes | Stock | 0mph | 0mph | Custom<sup>6</sup>|
|
||||
| Kia | Stinger 2018 | SCC + LKAS | Yes | Stock | 0mph | 0mph | Custom<sup>6</sup>|
|
||||
| Lexus | ES Hybrid 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
|
||||
| Lexus | RX Hybrid 2016-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
|
||||
| Subaru | Crosstrek 2018 | EyeSight | Yes | Stock | 0mph | 0mph | Custom<sup>4</sup>|
|
||||
| Subaru | Impreza 2019 | EyeSight | Yes | Stock | 0mph | 0mph | Custom<sup>4</sup>|
|
||||
| Toyota | Avalon 2016 | TSS-P | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
|
||||
| Toyota | Avalon 2017-18 | All | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
|
||||
| Toyota | Camry 2018-19 | All | Yes | Stock | 0mph<sup>5</sup> | 0mph | Toyota |
|
||||
| Toyota | C-HR 2017-19 | All | Yes | Stock | 0mph | 0mph | Toyota |
|
||||
| Toyota | Corolla 2017-19 | All | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
|
||||
| Toyota | Corolla 2020 | All | Yes | Yes | 0mph | 0mph | Toyota |
|
||||
| Toyota | Corolla Hatchback 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
|
||||
| Toyota | Highlander 2017-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
|
||||
| Toyota | Highlander Hybrid 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
|
||||
| Toyota | Prius 2016 | TSS-P | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
|
||||
| Toyota | Prius 2017-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
|
||||
| Toyota | Prius Prime 2017-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
|
||||
| Toyota | Rav4 2016 | TSS-P | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
|
||||
| Toyota | Rav4 2017-18 | All | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
|
||||
| Toyota | Rav4 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
|
||||
| Toyota | Rav4 Hybrid 2017-18 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
|
||||
| Toyota | Sienna 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
|
||||
|
||||
- Honda Civic 2016 with Honda Sensing
|
||||
- Due to limitations in steering firmware, steering is disabled below 12 mph
|
||||
<sup>1</sup>[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).*** <br />
|
||||
<sup>2</sup>When 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). <br />
|
||||
<sup>3</sup>[GM installation guide](https://zoneos.com/volt/). <br />
|
||||
<sup>4</sup>Subaru Giraffe is DIY. <br />
|
||||
<sup>5</sup>28mph for Camry 4CYL L, 4CYL LE and 4CYL SE which don't have Full-Speed Range Dynamic Radar Cruise Control. <br />
|
||||
<sup>6</sup>Open 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. <br />
|
||||
<sup>7</sup>Community built Giraffe, find more information [here](https://zoneos.com/shop/). <br />
|
||||
|
||||
- Honda CR-V Touring 2015-2016 (very alpha!)
|
||||
- Can only be enabled above 25 mph
|
||||
Community Maintained Cars
|
||||
------
|
||||
|
||||
| Make | Model | Supported Package | Lateral | Longitudinal | No Accel Below | No Steer Below | Giraffe |
|
||||
| ---------------------| -------------------------| ---------------------| --------| ---------------| -----------------| ---------------|-------------------|
|
||||
| Honda | Fit 2018 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph | Inverted Nidec |
|
||||
| Tesla | Model S 2012-13 | All | Yes | Not yet | Not applicable | 0mph | Custom<sup>8</sup>|
|
||||
|
||||
[[Honda Fit Pull Request]](https://github.com/commaai/openpilot/pull/266). <br />
|
||||
[[Tesla Model S Pull Request]](https://github.com/commaai/openpilot/pull/246) <br />
|
||||
<sup>8</sup>Community built Giraffe, find more information here [Community Tesla Giraffe](https://github.com/jeankalud/neo/tree/tesla_giraffe/giraffe/tesla) <br />
|
||||
|
||||
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.
|
||||
|
||||
In Progress Cars
|
||||
------
|
||||
- All TSS-P Toyota with Steering Assist and LSS-P Lexus with Steering Assist or Lane Keep Assist.
|
||||
- Only remaining Toyota cars with no port yet are the Avalon and the Sienna.
|
||||
- All Hyundai with SmartSense.
|
||||
- All Kia with SCC and LKAS.
|
||||
- All Chrysler, Jeep, Fiat with Adaptive Cruise Control and LaneSense.
|
||||
|
||||
How can I add support for my car?
|
||||
------
|
||||
|
||||
If your car has adaptive cruise control and lane keep assist, you are in luck. Using a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle/) and [cabana](https://community.comma.ai/cabana/), you can understand how to make your car drive by wire.
|
||||
|
||||
We've written guides for [Brand](https://medium.com/@comma_ai/how-to-write-a-car-port-for-openpilot-7ce0785eda84) and [Model](https://medium.com/@comma_ai/openpilot-port-guide-for-toyota-models-e5467f4b5fe6) ports. These guides might help you after you have the basics figured out.
|
||||
|
||||
- BMW, Audi, Volvo, and Mercedes all use [FlexRay](https://en.wikipedia.org/wiki/FlexRay) and can be supported after [FlexRay support](https://github.com/commaai/openpilot/pull/463) is merged.
|
||||
- We put time into a Ford port, but the steering has a 10 second cutout limitation that makes it unusable.
|
||||
- The 2016-2017 Honda Accord uses a custom signaling protocol for steering that's unlikely to ever be upstreamed.
|
||||
|
||||
Directory structure
|
||||
------
|
||||
|
||||
- cereal -- The messaging spec used for all logs on the phone
|
||||
- common -- Library like functionality we've developed here
|
||||
- opendbc -- Files showing how to interpret data from cars
|
||||
- panda -- Code used to communicate on CAN and LIN
|
||||
- phonelibs -- Libraries used on the phone
|
||||
- selfdrive -- Code needed to drive the car
|
||||
- assets -- Fonts for ui
|
||||
- boardd -- Daemon to talk to the board
|
||||
- car -- Code that talks to the car and implements CarInterface
|
||||
- common -- Shared C/C++ code for the daemons
|
||||
- controls -- Python controls (PID loops etc) for the car
|
||||
- debug -- Tools to help you debug and do car ports
|
||||
- logcatd -- Android logcat as a service
|
||||
- loggerd -- Logger and uploader of car data
|
||||
- proclogd -- Logs information from proc
|
||||
- radar -- Code that talks to the radar and implements RadarInterface
|
||||
- sensord -- IMU / GPS interface code
|
||||
- test/plant -- Car simulator running code through virtual maneuvers
|
||||
- ui -- The UI
|
||||
- visiond -- embedded vision pipeline
|
||||
.
|
||||
├── apk # The apk files used for the UI
|
||||
├── cereal # The messaging spec used for all logs on EON
|
||||
├── common # Library like functionality we've developed here
|
||||
├── installer/updater # Manages auto-updates of openpilot
|
||||
├── opendbc # Files showing how to interpret data from cars
|
||||
├── panda # Code used to communicate on CAN and LIN
|
||||
├── phonelibs # Libraries used on EON
|
||||
├── pyextra # Libraries used on EON
|
||||
└── selfdrive # Code needed to drive the car
|
||||
├── assets # Fonts and images for UI
|
||||
├── athena # Allows communication with the app
|
||||
├── boardd # Daemon to talk to the board
|
||||
├── can # Helpers for parsing CAN messages
|
||||
├── car # Car specific code to read states and control actuators
|
||||
├── common # Shared C/C++ code for the daemons
|
||||
├── controls # Perception, planning and controls
|
||||
├── debug # Tools to help you debug and do car ports
|
||||
├── locationd # Soon to be home of precise location
|
||||
├── logcatd # Android logcat as a service
|
||||
├── loggerd # Logger and uploader of car data
|
||||
├── proclogd # Logs information from proc
|
||||
├── sensord # IMU / GPS interface code
|
||||
├── test # Car simulator running code through virtual maneuvers
|
||||
├── ui # The UI
|
||||
└── visiond # Vision pipeline
|
||||
|
||||
To understand how the services interact, see `selfdrive/service_list.yaml`
|
||||
|
||||
User Data / chffr Account / Crash Reporting
|
||||
------
|
||||
|
||||
By default, openpilot creates an account and includes a client for chffr, our dashcam app. We use your data to train better models and improve openpilot for everyone.
|
||||
|
||||
It's open source software, so you are free to disable it if you wish.
|
||||
|
||||
It logs the road facing camera, CAN, GPS, IMU, magnetometer, thermal sensors, crashes, and operating system logs.
|
||||
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.
|
||||
|
||||
Testing on PC
|
||||
------
|
||||
|
||||
There is rudimentary infrastructure to run a basic simulation and generate a report of openpilot's behavior in different scenarios.
|
||||
Check out [openpilot-tools](https://github.com/commaai/openpilot-tools): lots of tools you can use to replay driving data, test and develop openpilot from your pc.
|
||||
|
||||
Also, within openpilot there is a rudimentary infrastructure to run a basic simulation and generate a report of openpilot's behavior in different longitudinal control scenarios.
|
||||
|
||||
```bash
|
||||
# Requires working docker
|
||||
./run_docker_tests.sh
|
||||
```
|
||||
|
||||
The results are written to `selfdrive/test/plant/out/index.html`
|
||||
|
||||
More extensive testing infrastructure and simulation environments are coming soon.
|
||||
|
||||
Adding Car Support
|
||||
------
|
||||
|
||||
comma.ai offers [bounties](http://comma.ai/bounties.html) for adding additional car support.
|
||||
|
||||
CR-V Touring support came in through this program. Chevy Volt is close. Accord is close as well.
|
||||
|
||||
User Data / chffr Account / Crash Reporting
|
||||
------
|
||||
|
||||
By default openpilot creates an account and includes a client for chffr, our dashcam app. We use your data to train better models and improve openpilot for everyone.
|
||||
|
||||
It's open source software, so you are free to disable it if you wish.
|
||||
|
||||
It logs the road facing camera, CAN, GPS, IMU, magnetometer, thermal sensors, crashes, and operating system logs.
|
||||
It does not log the user facing camera or the microphone.
|
||||
|
||||
By using it, you agree to [our privacy policy](https://beta.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.
|
||||
|
||||
Contributing
|
||||
------
|
||||
|
||||
We welcome both pull requests and issues on
|
||||
[github](http://github.com/commaai/openpilot). See the TODO file for a list of
|
||||
good places to start.
|
||||
We welcome both pull requests and issues on [github](http://github.com/commaai/openpilot). Bug fixes and new car ports encouraged.
|
||||
|
||||
Want to get paid to work on openpilot? [comma.ai is hiring](http://comma.ai/positions.html)
|
||||
We also have a [bounty program](https://comma.ai/bounties.html).
|
||||
|
||||
Want to get paid to work on openpilot? [comma.ai is hiring](https://comma.ai/jobs/)
|
||||
|
||||
Licensing
|
||||
------
|
||||
|
||||
openpilot is released under the MIT license.
|
||||
openpilot is released under the MIT license. Some parts of the software are released under other licenses as specified.
|
||||
|
||||
Any user of this software shall indemnify and hold harmless Comma.ai, Inc. and its directors, officers, employees, agents, stockholders, affiliates, subcontractors and customers from and against all allegations, claims, actions, suits, demands, damages, liabilities, obligations, losses, settlements, judgments, costs and expenses (including without limitation attorneys’ fees and costs) which arise out of, relate to or result from any use of this software by user.
|
||||
|
||||
**THIS IS ALPHA QUALITY SOFTWARE FOR RESEARCH PURPOSES ONLY. THIS IS NOT A PRODUCT.
|
||||
YOU ARE RESPONSIBLE FOR COMPLYING WITH LOCAL LAWS AND REGULATIONS.
|
||||
NO WARRANTY EXPRESSED OR IMPLIED.**
|
||||
|
||||
---
|
||||
|
||||
<img src="https://d1qb2nb5cznatu.cloudfront.net/startups/i/1061157-bc7e9bf3b246ece7322e6ffe653f6af8-medium_jpg.jpg?buster=1458363130" width="75"></img> <img src="https://cdn-images-1.medium.com/max/1600/1*C87EjxGeMPrkTuVRVWVg4w.png" width="225"></img>
|
||||
|
||||
36
README_chffrplus.md
Normal file
36
README_chffrplus.md
Normal file
@@ -0,0 +1,36 @@
|
||||
Welcome to chffrplus
|
||||
======
|
||||
|
||||
[chffrplus](https://github.com/commaai/chffrplus) is an open source dashcam.
|
||||
|
||||
This is the shipping reference software for the comma EON Dashcam DevKit. It keeps many of the niceities of [openpilot](https://github.com/commaai/openpilot), like high quality sensors, great camera, and good autostart and stop. Though unlike openpilot, it cannot control your car. chffrplus can interface with your car through a [panda](https://shop.comma.ai/products/panda-obd-ii-dongle), but just like our dashcam app [chffr](https://getchffr.com/), it is read only.
|
||||
|
||||
It integrates with the rest of the comma ecosystem, so you can view your drives on the [chffr](https://getchffr.com/) app for Android or iOS, and reverse engineer your car with [cabana](https://community.comma.ai/cabana/?demo=1).
|
||||
|
||||
|
||||
Hardware
|
||||
------
|
||||
|
||||
Right now chffrplus supports the [EON Dashcam DevKit](https://shop.comma.ai/products/eon-dashcam-devkit) for hardware to run on.
|
||||
|
||||
Install chffrplus on a EON device by entering ``https://chffrplus.comma.ai`` during NEOS setup.
|
||||
|
||||
|
||||
User Data / chffr Account / Crash Reporting
|
||||
------
|
||||
|
||||
By default chffrplus creates an account and includes a client for chffr, our dashcam app.
|
||||
|
||||
It's open source software, so you are free to disable it if you wish.
|
||||
|
||||
It logs the road facing camera, CAN, GPS, IMU, magnetometer, thermal sensors, crashes, and operating system logs.
|
||||
It does not log the user facing camera or the microphone.
|
||||
|
||||
By using it, you agree to [our privacy policy](https://beta.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.
|
||||
|
||||
|
||||
Licensing
|
||||
------
|
||||
|
||||
chffrplus is released under the MIT license.
|
||||
|
||||
313
RELEASES.md
313
RELEASES.md
@@ -1,3 +1,315 @@
|
||||
Version 0.6.1 (2019-07-21)
|
||||
========================
|
||||
* Remote SSH with comma prime and [ssh.comma.ai](https://ssh.comma.ai)
|
||||
* Panda code Misra-c2012 compliance, tested against cppcheck coverage
|
||||
* Lockout openpilot after 3 terminal alerts for driver distracted or unresponsive
|
||||
* Toyota Sienna support thanks to wocsor!
|
||||
|
||||
Version 0.6 (2019-07-01)
|
||||
========================
|
||||
* New model, with double the pixels and ten times the temporal context!
|
||||
* Car should not take exits when in the right lane
|
||||
* openpilot uses only ~65% of the CPU (down from 75%)
|
||||
* Routes visible in connect/explorer after only 0.2% is uploaded (qlogs)
|
||||
* loggerd and sensord are open source, every line of openpilot is now open
|
||||
* 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
|
||||
* Various other stability improvements
|
||||
|
||||
Version 0.5.13 (2019-05-31)
|
||||
==========================
|
||||
* Reduce panda power consumption by 70%, down to 80mW, when car is off (not for GM)
|
||||
* Reduce EON power consumption by 40%, down to 1100mW, when car is off
|
||||
* Reduce CPU utilization by 20% and improve stability
|
||||
* Temporarily remove mapd functionalities to improve stability
|
||||
* Add openpilot record-only mode for unsupported cars
|
||||
* Synchronize controlsd to boardd to reduce latency
|
||||
* Remove panda support for Subaru giraffe
|
||||
|
||||
Version 0.5.12 (2019-05-16)
|
||||
==========================
|
||||
* Improve lateral control for the Prius and Prius Prime
|
||||
* Compress logs before writing to disk
|
||||
* Remove old driving data when storage reaches 90% full
|
||||
* Fix small offset in following distance
|
||||
* Various small CPU optimizations
|
||||
* Improve offroad power consumption: require NEOS Update
|
||||
* Add default speed limits for Estonia thanks to martinl!
|
||||
* Subaru Crosstrek support thanks to martinl!
|
||||
* Toyota Avalon support thanks to njbrown09!
|
||||
* Toyota Rav4 with TSS 2.0 support thanks to wocsor!
|
||||
* Toyota Corolla with TSS 2.0 support thanks to wocsor!
|
||||
|
||||
Version 0.5.11 (2019-04-17)
|
||||
========================
|
||||
* Add support for Subaru
|
||||
* Reduce panda power consumption by 60% when car is off
|
||||
* Fix controlsd lag every 6 minutes. This would sometimes cause disengagements
|
||||
* Fix bug in controls with new angle-offset learner in MPC
|
||||
* Reduce cpu consumption of ubloxd by rewriting it in C++
|
||||
* Improve driver monitoring model and face detection
|
||||
* Improve performance of visiond and ui
|
||||
* Honda Passport 2019 support
|
||||
* Lexus RX Hybrid 2019 support thanks to schomems!
|
||||
* Improve road selection heuristic in mapd
|
||||
* Add Lane Departure Warning to dashboard for Toyota thanks to arne182
|
||||
|
||||
Version 0.5.10 (2019-03-19)
|
||||
========================
|
||||
* Self-tuning vehicle parameters: steering offset, tire stiffness and steering ratio
|
||||
* Improve longitudinal control at low speed when lead vehicle harshly decelerates
|
||||
* Fix panda bug going unexpectedly in DCP mode when EON is connected
|
||||
* Reduce white panda power consumption by 500mW when EON is disconnected by turning off WIFI
|
||||
* New Driver Monitoring Model
|
||||
* Support QR codes for login using comma connect
|
||||
* Refactor comma pedal FW and use CRC-8 checksum algorithm for safety. Reflashing pedal is required.
|
||||
Please see `#hw-pedal` on [discord](discord.comma.ai) for assistance updating comma pedal.
|
||||
* Additional speed limit rules for Germany thanks to arne182
|
||||
* Allow negative speed limit offsets
|
||||
|
||||
Version 0.5.9 (2019-02-10)
|
||||
========================
|
||||
* Improve calibration using a dedicated neural network
|
||||
* Abstract planner in its own process to remove lags in controls process
|
||||
* Improve speed limits with country/region defaults by road type
|
||||
* Reduce mapd data usage with gzip thanks to eFiniLan
|
||||
* Zip log files in the background to reduce disk usage
|
||||
* Kia Optima support thanks to emmertex!
|
||||
* Buick Regal 2018 support thanks to HOYS!
|
||||
* Comma pedal support for Toyota thanks to wocsor! Note: tuning needed and not maintained by comma
|
||||
* Chrysler Pacifica and Jeep Grand Cherokee support thanks to adhintz!
|
||||
|
||||
Version 0.5.8 (2019-01-17)
|
||||
========================
|
||||
* Open sourced visiond
|
||||
* Auto-slowdown for upcoming turns
|
||||
* Chrysler/Jeep/Fiat support thanks to adhintz!
|
||||
* Honda Civic 2019 support thanks to csouers!
|
||||
* Improve use of car display in Toyota thanks to arne182!
|
||||
* No data upload when connected to Android or iOS hotspots and "Enable Upload Over Cellular" setting is off
|
||||
* EON stops charging when 12V battery drops below 11.8V
|
||||
|
||||
Version 0.5.7 (2018-12-06)
|
||||
========================
|
||||
* Speed limit from OpenStreetMap added to UI
|
||||
* Highlight speed limit when speed exceeds road speed limit plus a delta
|
||||
* Option to limit openpilot max speed to road speed limit plus a delta
|
||||
* Cadillac ATS support thanks to vntarasov!
|
||||
* GMC Acadia support thanks to CryptoKylan!
|
||||
* Decrease GPU power consumption
|
||||
* NEOSv8 autoupdate
|
||||
|
||||
Version 0.5.6 (2018-11-16)
|
||||
========================
|
||||
* Refresh settings layout and add feature descriptions
|
||||
* In Honda, keep stock camera on for logging and extra stock features; new openpilot giraffe setting is 0111!
|
||||
* In Toyota, option to keep stock camera on for logging and extra stock features (e.g. AHB); 120Ohm resistor required on giraffe.
|
||||
* Improve camera calibration stability
|
||||
* More tuning to Honda positive accelerations
|
||||
* Reduce brake pump use on Hondas
|
||||
* Chevrolet Malibu support thanks to tylergets!
|
||||
* Holden Astra support thanks to AlexHill!
|
||||
|
||||
Version 0.5.5 (2018-10-20)
|
||||
========================
|
||||
* Increase allowed Honda positive accelerations
|
||||
* Fix sporadic unexpected braking when passing semi-trucks in Toyota
|
||||
* Fix gear reading bug in Hyundai Elantra thanks to emmertex!
|
||||
|
||||
Version 0.5.4 (2018-09-25)
|
||||
========================
|
||||
* New Driving Model
|
||||
* New Driver Monitoring Model
|
||||
* Improve longitudinal mpc in mid-low speed braking
|
||||
* Honda Accord hybrid support thanks to energee!
|
||||
* Ship mpc binaries and sensibly reduce build time
|
||||
* Calibration more stable
|
||||
* More Hyundai and Kia cars supported thanks to emmertex!
|
||||
* Various GM Volt improvements thanks to vntarasov!
|
||||
|
||||
Version 0.5.3 (2018-09-03)
|
||||
========================
|
||||
* Hyundai Santa Fe support!
|
||||
* Honda Pilot 2019 support thanks to energee!
|
||||
* Toyota Highlander support thanks to daehahn!
|
||||
* Improve steering tuning for Honda Odyssey
|
||||
|
||||
Version 0.5.2 (2018-08-16)
|
||||
========================
|
||||
* New calibration: more accurate, a lot faster, open source!
|
||||
* Enable orbd
|
||||
* Add little endian support to CAN packer
|
||||
* Fix fingerprint for Honda Accord 1.5T
|
||||
* Improve driver monitoring model
|
||||
|
||||
Version 0.5.1 (2018-08-01)
|
||||
========================
|
||||
* Fix radar error on Civic sedan 2018
|
||||
* Improve thermal management logic
|
||||
* Alpha Toyota C-HR and Camry support!
|
||||
* Auto-switch Driver Monitoring to 3 min counter when inaccurate
|
||||
|
||||
Version 0.5 (2018-07-11)
|
||||
========================
|
||||
* Driver Monitoring (beta) option in settings!
|
||||
* Make visiond, loggerd and UI use less resources
|
||||
* 60 FPS UI
|
||||
* Better car parameters for most cars
|
||||
* New sidebar with stats
|
||||
* Remove Waze and Spotify to free up system resources
|
||||
* Remove rear view mirror option
|
||||
* Calibration 3x faster
|
||||
|
||||
Version 0.4.7.2 (2018-06-25)
|
||||
==========================
|
||||
* Fix loggerd lag issue
|
||||
* No longer prompt for updates
|
||||
* Mitigate right lane hugging for properly mounted EON (procedure on wiki)
|
||||
|
||||
Version 0.4.7.1 (2018-06-18)
|
||||
==========================
|
||||
* Fix Acura ILX steer faults
|
||||
* Fix bug in mock car
|
||||
|
||||
Version 0.4.7 (2018-06-15)
|
||||
==========================
|
||||
* New model!
|
||||
* GM Volt (and CT6 lateral) support!
|
||||
* Honda Bosch lateral support!
|
||||
* Improve actuator modeling to reduce lateral wobble
|
||||
* Minor refactor of car abstraction layer
|
||||
* Hack around orbd startup issue
|
||||
|
||||
Version 0.4.6 (2018-05-18)
|
||||
==========================
|
||||
* NEOSv6 required! Will autoupdate
|
||||
* Stability improvements
|
||||
* Fix all memory leaks
|
||||
* Update C++ compiler to clang6
|
||||
* Improve front camera exposure
|
||||
|
||||
Version 0.4.5 (2018-04-27)
|
||||
==========================
|
||||
* Release notes added to the update popup
|
||||
* Improve auto shut-off logic to disallow empty battery
|
||||
* Added onboarding instructions
|
||||
* Include orbd, the first piece of new calibration algorithm
|
||||
* Show remaining upload data instead of file numbers
|
||||
* Fix UI bugs
|
||||
* Fix memory leaks
|
||||
|
||||
Version 0.4.4 (2018-04-13)
|
||||
==========================
|
||||
* EON are flipped! Flip your EON's mount!
|
||||
* Alpha Honda Ridgeline support thanks to energee!
|
||||
* Support optional front camera recording
|
||||
* Upload over cellular toggle now applies to all files, not just video
|
||||
* Increase acceleration when closing lead gap
|
||||
* User now prompted for future updates
|
||||
* NEO no longer supported :(
|
||||
|
||||
Version 0.4.3.2 (2018-03-29)
|
||||
============================
|
||||
* Improve autofocus
|
||||
* Improve driving when only one lane line is detected
|
||||
* Added fingerprint for Toyota Corolla LE
|
||||
* Fixed Toyota Corolla steer error
|
||||
* Full-screen driving UI
|
||||
* Improved path drawing
|
||||
|
||||
Version 0.4.3.1 (2018-03-19)
|
||||
============================
|
||||
* Improve autofocus
|
||||
* Add check for MPC solution error
|
||||
* Make first distracted warning visual only
|
||||
|
||||
Version 0.4.3 (2018-03-13)
|
||||
==========================
|
||||
* Add HDR and autofocus
|
||||
* Update UI aesthetic
|
||||
* Grey panda works in Waze
|
||||
* Add alpha support for 2017 Honda Pilot
|
||||
* Slight increase in acceleration response from stop
|
||||
* Switch CAN sending to use CANPacker
|
||||
* Fix pulsing acceleration regression on Honda
|
||||
* Fix openpilot bugs when stock system is in use
|
||||
* Change starting logic for chffrplus to use battery voltage
|
||||
|
||||
Version 0.4.2 (2018-02-05)
|
||||
==========================
|
||||
* Add alpha support for 2017 Lexus RX Hybrid
|
||||
* Add alpha support for 2018 ACURA RDX
|
||||
* Updated fingerprint to include Toyota Rav4 SE and Prius Prime
|
||||
* Bugfixes for Acura ILX and Honda Odyssey
|
||||
|
||||
Version 0.4.1 (2018-01-30)
|
||||
==========================
|
||||
* Add alpha support for 2017 Toyota Corolla
|
||||
* Add alpha support for 2018 Honda Odyssey with Honda Sensing
|
||||
* Add alpha support for Grey Panda
|
||||
* Refactored car abstraction layer to make car ports easier
|
||||
* Increased steering torque limit on Honda CR-V by 30%
|
||||
|
||||
Version 0.4.0.2 (2018-01-18)
|
||||
==========================
|
||||
* Add focus adjustment slider
|
||||
* Minor bugfixes
|
||||
|
||||
Version 0.4.0.1 (2017-12-21)
|
||||
==========================
|
||||
* New UI to match chffrplus
|
||||
* Improved lateral control tuning to fix oscillations on Civic
|
||||
* Add alpha support for 2017 Toyota Rav4 Hybrid
|
||||
* Reduced CPU usage
|
||||
* Removed unnecessary utilization of fan at max speed
|
||||
* Minor bug fixes
|
||||
|
||||
Version 0.3.9 (2017-11-21)
|
||||
==========================
|
||||
* Add alpha support for 2017 Toyota Prius
|
||||
* Improved longitudinal control using model predictive control
|
||||
* Enable Forward Collision Warning
|
||||
* Acura ILX now maintains openpilot engaged at standstill when brakes are applied
|
||||
|
||||
Version 0.3.8.2 (2017-10-30)
|
||||
==========================
|
||||
* Add alpha support for 2017 Toyota RAV4
|
||||
* Smoother lateral control
|
||||
* Stay silent if stock system is connected through giraffe
|
||||
* Minor bug fixes
|
||||
|
||||
Version 0.3.7 (2017-09-30)
|
||||
==========================
|
||||
* Improved lateral control using model predictive control
|
||||
* Improved lane centering
|
||||
* Improved GPS
|
||||
* Reduced tendency of path deviation near right side exits
|
||||
* Enable engagement while the accelerator pedal is pressed
|
||||
* Enable engagement while the brake pedal is pressed, when stationary and with lead vehicle within 5m
|
||||
* Disable engagement when park brake or brake hold are active
|
||||
* Fixed sporadic longitudinal pulsing in Civic
|
||||
* Cleanups to vehicle interface
|
||||
|
||||
Version 0.3.6.1 (2017-08-15)
|
||||
============================
|
||||
* Mitigate low speed steering oscillations on some vehicles
|
||||
* Include board steering check for CR-V
|
||||
|
||||
Version 0.3.6 (2017-08-08)
|
||||
==========================
|
||||
* Fix alpha CR-V support
|
||||
* Improved GPS
|
||||
* Fix display of target speed not always matching HUD
|
||||
* Increased acceleration after stop
|
||||
* Mitigated some vehicles driving too close to the right line
|
||||
|
||||
Version 0.3.5 (2017-07-30)
|
||||
==========================
|
||||
* Fix bug where new devices would not begin calibration
|
||||
* Minor robustness improvements
|
||||
|
||||
Version 0.3.4 (2017-07-28)
|
||||
==========================
|
||||
* Improved model trained on more data
|
||||
@@ -102,4 +414,3 @@ Version 0.1 (2016-11-29)
|
||||
* Lane keep assist is working
|
||||
* Support for Acura ILX 2016 with AcuraWatch Plus
|
||||
* Support for Honda Civic 2016 Touring Edition
|
||||
|
||||
|
||||
161
SAFETY.md
161
SAFETY.md
@@ -1,36 +1,151 @@
|
||||
openpilot Safety
|
||||
======
|
||||
|
||||
openpilot is an Adaptive Cruise Control and Lane Keeping Assist System. Like
|
||||
other ACC and LKAS systems, openpilot requires the driver to be alert and to pay
|
||||
attention at all times. We repeat, **driver alertness is necessary, but not
|
||||
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
|
||||
pay attention at all times. We repeat, **driver alertness is necessary, but not
|
||||
sufficient, for openpilot to be used safely**.
|
||||
|
||||
Even with an attentive driver, we must make further efforts for the system to be
|
||||
In order to enforce driver alertness, openpilot includes a driver monitoring feature
|
||||
that alerts the driver when distracted.
|
||||
|
||||
However, even with an attentive driver, we must make further efforts for the system to be
|
||||
safe. We have designed openpilot with two other safety considerations.
|
||||
|
||||
1. The vehicle must always be controllable by the driver.
|
||||
1. The driver must always be capable to immediately retake manual control of the vehicle,
|
||||
by stepping on either pedal or by pressing the cancel button.
|
||||
2. The vehicle must not alter its trajectory too quickly for the driver to safely
|
||||
react.
|
||||
react. This means that while the system is engaged, the actuators are constrained
|
||||
to operate within reasonable limits.
|
||||
|
||||
To address these, we came up with two safety principles.
|
||||
Following are details of the car specific safety implementations:
|
||||
|
||||
Honda/Acura
|
||||
------
|
||||
|
||||
- While the system is engaged, gas, brake and steer commands are subject to the same limits used by
|
||||
the stock system.
|
||||
|
||||
- Without an interceptor, the gas is controlled by the Powertrain Control Module (PCM).
|
||||
The PCM limits acceleration to what is reasonable for a cruise control system. With an
|
||||
interceptor, the gas is clipped to 60%.
|
||||
|
||||
- The brake is controlled by the 0x1FA CAN message. This message allows full
|
||||
braking, although the panda firmware and openpilot clip it to 1/4th of the max.
|
||||
This is approximately 0.3g of braking.
|
||||
|
||||
- Steering is controlled by the 0xE4 CAN message. The Electronic Power Steering (EPS)
|
||||
controller in the car limits the torque to a very small amount, so regardless of the
|
||||
message, the controller cannot jerk the wheel.
|
||||
|
||||
- Brake and gas pedal pressed signals are contained in the 0x17C CAN message. A rising edge of
|
||||
either signals triggers a disengagement, which is enforced by the panda firmware and by openpilot. The
|
||||
white led on the panda signifies if the panda is allowing control messages.
|
||||
|
||||
1. Enforced disengagements. Step on either pedal or press the cancel button to
|
||||
retake manual control of the car immediately.
|
||||
- These are hard enforced by the board, and soft enforced by the software. The
|
||||
green led on the board signifies if the board is allowing control messages.
|
||||
- Honda CAN uses both a counter and a checksum to ensure integrity and prevent
|
||||
replay of the same message.
|
||||
|
||||
2. Actuation limits. While the system is engaged, the actuators are constrained
|
||||
to operate within reasonable limits; the same limits used by the stock system on
|
||||
the Honda.
|
||||
- Without an interceptor, the gas is controlled by the PCM. The PCM limits
|
||||
acceleration to what is reasonable for a cruise control system. With an
|
||||
interceptor, the gas is clipped to 60% in longcontrol.py
|
||||
- The brake is controlled by the 0x1FA CAN message. This message allows full
|
||||
braking, although the board and the software clip it to 1/4th of the max.
|
||||
This is around .3g of braking.
|
||||
- Steering is controlled by the 0xE4 CAN message. The EPS controller in the
|
||||
car limits the torque to a very small amount, so regardless of the message,
|
||||
the controller cannot jerk the wheel.
|
||||
Toyota/Lexus
|
||||
------
|
||||
|
||||
- While the system is engaged, gas, brake and steer commands are subject to the same limits used by
|
||||
the stock system.
|
||||
|
||||
- With the stock Driving Support Unit (DSU) connected (or in DSU-less models like Camry and C-HR),
|
||||
the acceleration is controlled by the stock system and is subject to the stock adaptive cruise
|
||||
control limits. Without the stock DSU connected, the acceleration command is controlled by the
|
||||
0x343 CAN message and its value is limited between .3g of deceleration and .15g of acceleration
|
||||
by the panda firmware and by openpilot. The acceleration command is ignored by the Engine Control
|
||||
Module (ECM) while the cruise control system is disengaged.
|
||||
|
||||
- Steering torque is controlled through the 0x2E4 CAN message and it's limited by the panda firmware and by
|
||||
openpilot to a value between -1500 and 1500. In addition, the vehicle EPS unit will not respond to
|
||||
commands outside these limits. A steering torque rate limit is enforced by the panda firmware and by
|
||||
openpilot, so that the commanded steering torque must rise from 0 to max value no faster than
|
||||
1.5s. Commanded steering torque is limited by the panda firmware and by openpilot to be no more than 350
|
||||
units above the actual EPS generated motor torque to ensure limited differences between
|
||||
commanded and actual torques.
|
||||
|
||||
- Brake and gas pedal pressed signals are contained in the 0x224 and 0x1D2 CAN messages,
|
||||
respectively. A rising edge of either signals triggers a disengagement, which is enforced by the
|
||||
panda firmware and by openpilot. Additionally, the cruise control system disengages on the rising edge of
|
||||
the brake pedal pressed signal.
|
||||
|
||||
- The cruise control system state is contained in the 0x1D2 message. No control messages are
|
||||
allowed if the cruise control system is not active. This is enforced by openpilot and the
|
||||
panda firmware. The white led on the panda signifies if the panda is allowing control messages.
|
||||
|
||||
GM/Chevrolet
|
||||
------
|
||||
|
||||
- While the system is engaged, gas, brake and steer commands are subject to the same limits used by
|
||||
the stock system.
|
||||
|
||||
- The gas and regen are controlled by the 0x2CB message and it's limited by the panda firmware and by
|
||||
openpilot to a value between 1404 and 3072. the minimum value correspond to a mild decel due to regen,
|
||||
while 3072 correspond to approximately 0.18g of acceleration from stop.
|
||||
|
||||
- The friction brakes are controlled by the 0x315 message and its value is limited by the panda firmware
|
||||
and openpilot to 350. This is approximately 0.3g of braking.
|
||||
|
||||
- Steering torque is controlled through the 0x180 CAN message and it's limited by the panda firmware and by
|
||||
openpilot to a value between -300 and 300. In addition, the vehicle EPS unit will fault for
|
||||
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
|
||||
driver's will.
|
||||
|
||||
- Brake pedal and gas pedal potentiometer signals are contained in the 0xF1 and 0x1A1 CAN messages,
|
||||
respectively. A rising edge of either signals triggers a disengagement, which is enforced by the
|
||||
panda firmware and by openpilot. Additionally, the cruise control system disengages on the rising edge of
|
||||
the brake pedal pressed signal. The regen paddle pressed signal is in the 0xBD message. When the
|
||||
regen paddle is pressed, a disengagement is enforced by both the firmware and by openpilot.
|
||||
|
||||
- GM CAN uses both a counter and a checksum to ensure integrity and prevent
|
||||
replay of the same message.
|
||||
|
||||
Hyundai/Kia (Lateral only)
|
||||
------
|
||||
|
||||
- While the system is engaged, steer commands are subject to the same limits used by
|
||||
the stock system.
|
||||
|
||||
- Steering torque is controlled through the 0x340 CAN message and it's limited by the panda firmware and by
|
||||
openpilot to a value between -255 and 255. In addition, the vehicle EPS unit will fault for
|
||||
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
|
||||
driver's will.
|
||||
|
||||
Chrysler/Jeep/Fiat (Lateral only)
|
||||
------
|
||||
|
||||
- While the system is engaged, steer commands are subject to the same limits used by
|
||||
the stock system.
|
||||
|
||||
- Steering torque is controlled through the 0x292 CAN message and it's limited by the panda firmware and by
|
||||
openpilot to a value between -261 and 261. In addition, the vehicle EPS unit will fault for
|
||||
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.87s. Commanded steering torque is limited by the panda firmware and by openpilot to be no more than 80
|
||||
units above the actual EPS generated motor torque to ensure limited differences between
|
||||
commanded and actual torques.
|
||||
|
||||
Subaru (Lateral only)
|
||||
------
|
||||
|
||||
- While the system is engaged, steer commands are subject to the same limits used by
|
||||
the stock system.
|
||||
|
||||
- Steering torque is controlled through the 0x122 CAN message and it's limited by the panda firmware and by
|
||||
openpilot to a value between -255 and 255. In addition, the vehicle EPS unit will fault for
|
||||
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
|
||||
driver's will.
|
||||
|
||||
**Extra note**: comma.ai strongly discourages the use of openpilot forks with safety code either missing or
|
||||
not fully meeting the above requirements.
|
||||
|
||||
BIN
apk/ai.comma.plus.black.apk
Normal file
BIN
apk/ai.comma.plus.black.apk
Normal file
Binary file not shown.
BIN
apk/ai.comma.plus.frame.apk
Normal file
BIN
apk/ai.comma.plus.frame.apk
Normal file
Binary file not shown.
BIN
selfdrive/visiond/visiond → apk/ai.comma.plus.offroad.apk
Executable file → Normal file
BIN
selfdrive/visiond/visiond → apk/ai.comma.plus.offroad.apk
Executable file → Normal file
Binary file not shown.
Binary file not shown.
5
cereal/.gitignore
vendored
5
cereal/.gitignore
vendored
@@ -1 +1,6 @@
|
||||
gen
|
||||
node_modules
|
||||
package-lock.json
|
||||
*.pyc
|
||||
__pycache__
|
||||
|
||||
|
||||
@@ -1,4 +1,62 @@
|
||||
-include build_from_src.mk
|
||||
PWD := $(shell pwd)
|
||||
|
||||
release:
|
||||
@echo "cereal: this is a release"
|
||||
SRCS := log.capnp car.capnp
|
||||
|
||||
GENS := gen/cpp/car.capnp.c++ gen/cpp/log.capnp.c++
|
||||
JS := gen/js/car.capnp.js gen/js/log.capnp.js
|
||||
|
||||
UNAME_M ?= $(shell uname -m)
|
||||
|
||||
GENS += gen/c/car.capnp.c gen/c/log.capnp.c gen/c/include/c++.capnp.h gen/c/include/java.capnp.h
|
||||
|
||||
ifeq ($(UNAME_M),x86_64)
|
||||
|
||||
ifneq (, $(shell which capnpc-java))
|
||||
GENS += gen/java/Car.java gen/java/Log.java
|
||||
else
|
||||
$(warning capnpc-java not found, skipping java build)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(UNAME_M),aarch64)
|
||||
CAPNPC=PATH=$(PWD)/../phonelibs/capnp-cpp/aarch64/bin/:$$PATH capnpc
|
||||
else
|
||||
CAPNPC=capnpc
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: $(GENS)
|
||||
js: $(JS)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf gen
|
||||
rm -rf node_modules
|
||||
rm -rf package-lock.json
|
||||
|
||||
gen/c/%.capnp.c: %.capnp
|
||||
@echo "[ CAPNPC C ] $@"
|
||||
mkdir -p gen/c/
|
||||
$(CAPNPC) '$<' -o c:gen/c/
|
||||
|
||||
gen/js/%.capnp.js: %.capnp
|
||||
@echo "[ CAPNPC JavaScript ] $@"
|
||||
mkdir -p gen/js/
|
||||
sh ./generate_javascript.sh
|
||||
|
||||
gen/cpp/%.capnp.c++: %.capnp
|
||||
@echo "[ CAPNPC C++ ] $@"
|
||||
mkdir -p gen/cpp/
|
||||
$(CAPNPC) '$<' -o c++:gen/cpp/
|
||||
|
||||
gen/java/Car.java gen/java/Log.java: $(SRCS)
|
||||
@echo "[ CAPNPC java ] $@"
|
||||
mkdir -p gen/java/
|
||||
$(CAPNPC) $^ -o java:gen/java
|
||||
|
||||
# c-capnproto needs some empty headers
|
||||
gen/c/include/c++.capnp.h gen/c/include/java.capnp.h:
|
||||
mkdir -p gen/c/include
|
||||
touch '$@'
|
||||
|
||||
@@ -4,17 +4,5 @@ import capnp
|
||||
CEREAL_PATH = os.path.dirname(os.path.abspath(__file__))
|
||||
capnp.remove_import_hook()
|
||||
|
||||
if os.getenv("NEWCAPNP"):
|
||||
import tempfile
|
||||
import pyximport
|
||||
|
||||
importers = pyximport.install(build_dir=os.path.join(tempfile.gettempdir(), ".pyxbld"))
|
||||
try:
|
||||
import cereal.gen.cython.log_capnp_cython as log
|
||||
import cereal.gen.cython.car_capnp_cython as car
|
||||
finally:
|
||||
pyximport.uninstall(*importers)
|
||||
del importers
|
||||
else:
|
||||
log = capnp.load(os.path.join(CEREAL_PATH, "log.capnp"))
|
||||
car = capnp.load(os.path.join(CEREAL_PATH, "car.capnp"))
|
||||
log = capnp.load(os.path.join(CEREAL_PATH, "log.capnp"))
|
||||
car = capnp.load(os.path.join(CEREAL_PATH, "car.capnp"))
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
SRCS := log.capnp car.capnp
|
||||
|
||||
GENS := gen/cpp/car.capnp.c++ gen/cpp/log.capnp.c++
|
||||
|
||||
|
||||
UNAME_M := $(shell uname -m)
|
||||
|
||||
# only generate C++ for docker tests
|
||||
ifneq ($(OPTEST),1)
|
||||
GENS += gen/c/car.capnp.c gen/c/log.capnp.c gen/c/c++.capnp.h gen/c/java.capnp.h
|
||||
|
||||
# Dont build java on the phone...
|
||||
ifeq ($(UNAME_M),x86_64)
|
||||
GENS += gen/java/Car.java gen/java/Log.java
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: $(GENS)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf gen
|
||||
|
||||
gen/c/%.capnp.c: %.capnp
|
||||
@echo "[ CAPNPC C ] $@"
|
||||
mkdir -p gen/c/
|
||||
capnpc '$<' -o c:gen/c/
|
||||
|
||||
gen/cpp/%.capnp.c++: %.capnp
|
||||
@echo "[ CAPNPC C++ ] $@"
|
||||
mkdir -p gen/cpp/
|
||||
capnpc '$<' -o c++:gen/cpp/
|
||||
|
||||
gen/java/Car.java gen/java/Log.java: $(SRCS)
|
||||
@echo "[ CAPNPC java ] $@"
|
||||
mkdir -p gen/java/
|
||||
capnpc $^ -o java:gen/java
|
||||
|
||||
# c-capnproto needs some empty headers
|
||||
gen/c/c++.capnp.h gen/c/java.capnp.h:
|
||||
mkdir -p gen/c/
|
||||
touch '$@'
|
||||
|
||||
316
cereal/car.capnp
316
cereal/car.capnp
@@ -1,20 +1,101 @@
|
||||
using Cxx = import "c++.capnp";
|
||||
using Cxx = import "./include/c++.capnp";
|
||||
$Cxx.namespace("cereal");
|
||||
|
||||
using Java = import "java.capnp";
|
||||
using Java = import "./include/java.capnp";
|
||||
$Java.package("ai.comma.openpilot.cereal");
|
||||
$Java.outerClassname("Car");
|
||||
|
||||
@0x8e2af1e708af8b8d;
|
||||
|
||||
# ******* events causing controls state machine transition *******
|
||||
|
||||
struct CarEvent @0x9b1657f34caf3ad3 {
|
||||
name @0 :EventName;
|
||||
enable @1 :Bool;
|
||||
noEntry @2 :Bool;
|
||||
warning @3 :Bool;
|
||||
userDisable @4 :Bool;
|
||||
softDisable @5 :Bool;
|
||||
immediateDisable @6 :Bool;
|
||||
preEnable @7 :Bool;
|
||||
permanent @8 :Bool;
|
||||
|
||||
enum EventName @0xbaa8c5d505f727de {
|
||||
# TODO: copy from error list
|
||||
canError @0;
|
||||
steerUnavailable @1;
|
||||
brakeUnavailable @2;
|
||||
gasUnavailable @3;
|
||||
wrongGear @4;
|
||||
doorOpen @5;
|
||||
seatbeltNotLatched @6;
|
||||
espDisabled @7;
|
||||
wrongCarMode @8;
|
||||
steerTempUnavailable @9;
|
||||
reverseGear @10;
|
||||
buttonCancel @11;
|
||||
buttonEnable @12;
|
||||
pedalPressed @13;
|
||||
cruiseDisabled @14;
|
||||
radarCanError @15;
|
||||
dataNeeded @16;
|
||||
speedTooLow @17;
|
||||
outOfSpace @18;
|
||||
overheat @19;
|
||||
calibrationIncomplete @20;
|
||||
calibrationInvalid @21;
|
||||
controlsMismatch @22;
|
||||
pcmEnable @23;
|
||||
pcmDisable @24;
|
||||
noTarget @25;
|
||||
radarFault @26;
|
||||
modelCommIssueDEPRECATED @27;
|
||||
brakeHold @28;
|
||||
parkBrake @29;
|
||||
manualRestart @30;
|
||||
lowSpeedLockout @31;
|
||||
plannerError @32;
|
||||
ipasOverride @33;
|
||||
debugAlert @34;
|
||||
steerTempUnavailableMute @35;
|
||||
resumeRequired @36;
|
||||
preDriverDistracted @37;
|
||||
promptDriverDistracted @38;
|
||||
driverDistracted @39;
|
||||
geofence @40;
|
||||
driverMonitorOn @41;
|
||||
driverMonitorOff @42;
|
||||
preDriverUnresponsive @43;
|
||||
promptDriverUnresponsive @44;
|
||||
driverUnresponsive @45;
|
||||
belowSteerSpeed @46;
|
||||
calibrationProgress @47;
|
||||
lowBattery @48;
|
||||
invalidGiraffeHonda @49;
|
||||
vehicleModelInvalid @50;
|
||||
controlsFailed @51;
|
||||
sensorDataInvalid @52;
|
||||
commIssue @53;
|
||||
tooDistracted @54;
|
||||
posenetInvalid @55;
|
||||
manualSteeringRequired @56;
|
||||
manualSteeringRequiredBlinkersOn @57;
|
||||
}
|
||||
}
|
||||
|
||||
# ******* main car state @ 100hz *******
|
||||
# all speeds in m/s
|
||||
|
||||
struct CarState {
|
||||
errors @0: List(Error);
|
||||
errorsDEPRECATED @0 :List(CarEvent.EventName);
|
||||
events @13 :List(CarEvent);
|
||||
|
||||
# car speed
|
||||
vEgo @1 :Float32; # best estimate of speed
|
||||
vEgo @1 :Float32; # best estimate of speed
|
||||
aEgo @16 :Float32; # best estimate of acceleration
|
||||
vEgoRaw @17 :Float32; # unfiltered speed from CAN sensors
|
||||
yawRate @22 :Float32; # best estimate of yaw rate
|
||||
standstill @18 :Bool;
|
||||
wheelSpeeds @2 :WheelSpeeds;
|
||||
|
||||
# gas pedal, 0.0-1.0
|
||||
@@ -24,17 +105,30 @@ struct CarState {
|
||||
# brake pedal, 0.0-1.0
|
||||
brake @5 :Float32; # this is user pedal only
|
||||
brakePressed @6 :Bool; # this is user pedal only
|
||||
brakeLights @19 :Bool;
|
||||
|
||||
# steering wheel
|
||||
steeringAngle @7 :Float32; # deg
|
||||
steeringRate @15 :Float32; # deg/s
|
||||
steeringTorque @8 :Float32; # TODO: standardize units
|
||||
steeringPressed @9 :Bool; # if the user is using the steering wheel
|
||||
|
||||
# cruise state
|
||||
cruiseState @10 :CruiseState;
|
||||
|
||||
# gear
|
||||
gearShifter @14 :GearShifter;
|
||||
|
||||
# button presses
|
||||
buttonEvents @11 :List(ButtonEvent);
|
||||
leftBlinker @20 :Bool;
|
||||
rightBlinker @21 :Bool;
|
||||
genericToggle @23 :Bool;
|
||||
|
||||
# lock info
|
||||
doorOpen @24 :Bool;
|
||||
seatbeltUnlatched @25 :Bool;
|
||||
canValid @26 :Bool;
|
||||
|
||||
# which packets this state came from
|
||||
canMonoTimes @12: List(UInt64);
|
||||
@@ -48,31 +142,29 @@ struct CarState {
|
||||
}
|
||||
|
||||
struct CruiseState {
|
||||
enabled @0: Bool;
|
||||
speed @1: Float32;
|
||||
available @2: Bool;
|
||||
enabled @0 :Bool;
|
||||
speed @1 :Float32;
|
||||
available @2 :Bool;
|
||||
speedOffset @3 :Float32;
|
||||
standstill @4 :Bool;
|
||||
}
|
||||
|
||||
enum Error {
|
||||
# TODO: copy from error list
|
||||
commIssue @0;
|
||||
steerUnavailable @1;
|
||||
brakeUnavailable @2;
|
||||
gasUnavailable @3;
|
||||
wrongGear @4;
|
||||
doorOpen @5;
|
||||
seatbeltNotLatched @6;
|
||||
espDisabled @7;
|
||||
wrongCarMode @8;
|
||||
steerTempUnavailable @9;
|
||||
reverseGear @10;
|
||||
# ...
|
||||
enum GearShifter {
|
||||
unknown @0;
|
||||
park @1;
|
||||
drive @2;
|
||||
neutral @3;
|
||||
reverse @4;
|
||||
sport @5;
|
||||
low @6;
|
||||
brake @7;
|
||||
}
|
||||
|
||||
|
||||
# send on change
|
||||
struct ButtonEvent {
|
||||
pressed @0: Bool;
|
||||
type @1: Type;
|
||||
pressed @0 :Bool;
|
||||
type @1 :Type;
|
||||
|
||||
enum Type {
|
||||
unknown @0;
|
||||
@@ -90,30 +182,35 @@ struct CarState {
|
||||
|
||||
# ******* radar state @ 20hz *******
|
||||
|
||||
struct RadarState {
|
||||
errors @0: List(Error);
|
||||
points @1: List(RadarPoint);
|
||||
struct RadarData @0x888ad6581cf0aacb {
|
||||
errors @0 :List(Error);
|
||||
points @1 :List(RadarPoint);
|
||||
|
||||
# which packets this state came from
|
||||
canMonoTimes @2: List(UInt64);
|
||||
canMonoTimes @2 :List(UInt64);
|
||||
|
||||
enum Error {
|
||||
notValid @0;
|
||||
canError @0;
|
||||
fault @1;
|
||||
wrongConfig @2;
|
||||
}
|
||||
|
||||
# similar to LiveTracks
|
||||
# is one timestamp valid for all? I think so
|
||||
struct RadarPoint {
|
||||
trackId @0: UInt64; # no trackId reuse
|
||||
trackId @0 :UInt64; # no trackId reuse
|
||||
|
||||
# these 3 are the minimum required
|
||||
dRel @1: Float32; # m from the front bumper of the car
|
||||
yRel @2: Float32; # m
|
||||
vRel @3: Float32; # m/s
|
||||
dRel @1 :Float32; # m from the front bumper of the car
|
||||
yRel @2 :Float32; # m
|
||||
vRel @3 :Float32; # m/s
|
||||
|
||||
# these are optional and valid if they are not NaN
|
||||
aRel @4: Float32; # m/s^2
|
||||
yvRel @5: Float32; # m/s
|
||||
aRel @4 :Float32; # m/s^2
|
||||
yvRel @5 :Float32; # m/s
|
||||
|
||||
# some radars flag measurements VS estimates
|
||||
measured @6 :Bool;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,17 +218,26 @@ struct RadarState {
|
||||
|
||||
struct CarControl {
|
||||
# must be true for any actuator commands to work
|
||||
enabled @0: Bool;
|
||||
enabled @0 :Bool;
|
||||
active @7 :Bool;
|
||||
|
||||
# range from 0.0 - 1.0
|
||||
gas @1: Float32;
|
||||
brake @2: Float32;
|
||||
gasDEPRECATED @1 :Float32;
|
||||
brakeDEPRECATED @2 :Float32;
|
||||
steeringTorqueDEPRECATED @3 :Float32;
|
||||
|
||||
# range from -1.0 - 1.0
|
||||
steeringTorque @3 :Float32;
|
||||
actuators @6 :Actuators;
|
||||
|
||||
cruiseControl @4: CruiseControl;
|
||||
hudControl @5: HUDControl;
|
||||
cruiseControl @4 :CruiseControl;
|
||||
hudControl @5 :HUDControl;
|
||||
|
||||
struct Actuators {
|
||||
# range from 0.0 - 1.0
|
||||
gas @0: Float32;
|
||||
brake @1: Float32;
|
||||
# range from -1.0 - 1.0
|
||||
steer @2: Float32;
|
||||
steerAngle @3: Float32;
|
||||
}
|
||||
|
||||
struct CruiseControl {
|
||||
cancel @0: Bool;
|
||||
@@ -147,6 +253,10 @@ struct CarControl {
|
||||
leadVisible @3: Bool;
|
||||
visualAlert @4: VisualAlert;
|
||||
audibleAlert @5: AudibleAlert;
|
||||
rightLaneVisible @6: Bool;
|
||||
leftLaneVisible @7: Bool;
|
||||
rightLaneDepart @8: Bool;
|
||||
leftLaneDepart @9: Bool;
|
||||
|
||||
enum VisualAlert {
|
||||
# these are the choices from the Honda
|
||||
@@ -164,13 +274,13 @@ struct CarControl {
|
||||
# these are the choices from the Honda
|
||||
# map as good as you can for your car
|
||||
none @0;
|
||||
beepSingle @1;
|
||||
beepTriple @2;
|
||||
beepRepeated @3;
|
||||
chimeSingle @4;
|
||||
chimeDouble @5;
|
||||
chimeRepeated @6;
|
||||
chimeContinuous @7;
|
||||
chimeEngage @1;
|
||||
chimeDisengage @2;
|
||||
chimeError @3;
|
||||
chimeWarning1 @4;
|
||||
chimeWarning2 @5;
|
||||
chimeWarningRepeat @6;
|
||||
chimePrompt @7;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,26 +288,104 @@ struct CarControl {
|
||||
# ****** car param ******
|
||||
|
||||
struct CarParams {
|
||||
carName @0: Text;
|
||||
radarName @1: Text;
|
||||
carFingerprint @11: Text;
|
||||
carName @0 :Text;
|
||||
carFingerprint @1 :Text;
|
||||
|
||||
enableGasInterceptor @2 :Bool;
|
||||
enableCruise @3 :Bool;
|
||||
enableCamera @4 :Bool;
|
||||
enableDsu @5 :Bool; # driving support unit
|
||||
enableApgs @6 :Bool; # advanced parking guidance system
|
||||
|
||||
minEnableSpeed @7 :Float32;
|
||||
minSteerSpeed @8 :Float32;
|
||||
safetyModel @9 :SafetyModel;
|
||||
safetyParam @10 :Int16;
|
||||
|
||||
steerMaxBP @11 :List(Float32);
|
||||
steerMaxV @12 :List(Float32);
|
||||
gasMaxBP @13 :List(Float32);
|
||||
gasMaxV @14 :List(Float32);
|
||||
brakeMaxBP @15 :List(Float32);
|
||||
brakeMaxV @16 :List(Float32);
|
||||
|
||||
enableSteer @2: Bool;
|
||||
enableGas @3: Bool;
|
||||
enableBrake @4: Bool;
|
||||
enableCruise @5: Bool;
|
||||
|
||||
# things about the car in the manual
|
||||
wheelBase @6: Float32; # in meters
|
||||
steerRatio @7: Float32;
|
||||
mass @17 :Float32; # [kg] running weight
|
||||
wheelbase @18 :Float32; # [m] distance from rear to front axle
|
||||
centerToFront @19 :Float32; # [m] GC distance to front axle
|
||||
steerRatio @20 :Float32; # [] ratio between front wheels and steering wheel angles
|
||||
steerRatioRear @21 :Float32; # [] rear steering ratio wrt front steering (usually 0)
|
||||
|
||||
# things we can derive
|
||||
slipFactor @8: Float32;
|
||||
rotationalInertia @22 :Float32; # [kg*m2] body rotational inertia
|
||||
tireStiffnessFront @23 :Float32; # [N/rad] front tire coeff of stiff
|
||||
tireStiffnessRear @24 :Float32; # [N/rad] rear tire coeff of stiff
|
||||
|
||||
# Kp and Ki for the lateral control
|
||||
steerKp @9: Float32;
|
||||
steerKi @10: Float32;
|
||||
longitudinalTuning @25 :LongitudinalPIDTuning;
|
||||
lateralTuning :union {
|
||||
pid @26 :LateralPIDTuning;
|
||||
indi @27 :LateralINDITuning;
|
||||
}
|
||||
|
||||
# TODO: Kp and Ki for long control, perhaps not needed?
|
||||
steerLimitAlert @28 :Bool;
|
||||
|
||||
vEgoStopping @29 :Float32; # Speed at which the car goes into stopping state
|
||||
directAccelControl @30 :Bool; # Does the car have direct accel control or just gas/brake
|
||||
stoppingControl @31 :Bool; # Does the car allows full control even at lows speeds when stopping
|
||||
startAccel @32 :Float32; # Required acceleraton to overcome creep braking
|
||||
steerRateCost @33 :Float32; # Lateral MPC cost on steering rate
|
||||
steerControlType @34 :SteerControlType;
|
||||
radarOffCan @35 :Bool; # True when radar objects aren't visible on CAN
|
||||
|
||||
steerActuatorDelay @36 :Float32; # Steering wheel actuator delay in seconds
|
||||
openpilotLongitudinalControl @37 :Bool; # is openpilot doing the longitudinal control?
|
||||
carVin @38 :Text; # VIN number queried during fingerprinting
|
||||
|
||||
struct LateralPIDTuning {
|
||||
kpBP @0 :List(Float32);
|
||||
kpV @1 :List(Float32);
|
||||
kiBP @2 :List(Float32);
|
||||
kiV @3 :List(Float32);
|
||||
kf @4 :Float32;
|
||||
}
|
||||
|
||||
struct LongitudinalPIDTuning {
|
||||
kpBP @0 :List(Float32);
|
||||
kpV @1 :List(Float32);
|
||||
kiBP @2 :List(Float32);
|
||||
kiV @3 :List(Float32);
|
||||
deadzoneBP @4 :List(Float32);
|
||||
deadzoneV @5 :List(Float32);
|
||||
}
|
||||
|
||||
|
||||
struct LateralINDITuning {
|
||||
outerLoopGain @0 :Float32;
|
||||
innerLoopGain @1 :Float32;
|
||||
timeConstant @2 :Float32;
|
||||
actuatorEffectiveness @3 :Float32;
|
||||
}
|
||||
|
||||
|
||||
enum SafetyModel {
|
||||
# does NOT match board setting
|
||||
noOutput @0;
|
||||
honda @1;
|
||||
toyota @2;
|
||||
elm327 @3;
|
||||
gm @4;
|
||||
hondaBosch @5;
|
||||
ford @6;
|
||||
cadillac @7;
|
||||
hyundai @8;
|
||||
chrysler @9;
|
||||
tesla @10;
|
||||
subaru @11;
|
||||
}
|
||||
|
||||
enum SteerControlType {
|
||||
torque @0;
|
||||
angle @1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
26
cereal/generate_javascript.sh
Executable file
26
cereal/generate_javascript.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
rm -r gen/ts
|
||||
rm -r gen/js
|
||||
|
||||
mkdir gen/ts
|
||||
mkdir gen/js
|
||||
|
||||
echo "Installing needed npm modules"
|
||||
npm i capnpc-ts capnp-ts
|
||||
|
||||
capnpc -o node_modules/.bin/capnpc-ts:gen/ts log.capnp car.capnp
|
||||
capnpc -o node_modules/.bin/capnpc-ts:gen/ts car.capnp
|
||||
|
||||
cat log.capnp | egrep '\([a-zA-Z]*\.[^\s]+\.[^s]+\)' | sed 's/^.*([a-zA-Z]*\.\([a-zA-Z.]*\)).*/\1/' | while read line
|
||||
do
|
||||
TOKEN=`echo $line | sed 's/\./_/g'`
|
||||
ROOT=`echo $line | sed 's/\..*$//g'`
|
||||
cat gen/ts/log.capnp.ts | grep '^import.*'${TOKEN}
|
||||
if [[ "$?" == "1" ]]
|
||||
then
|
||||
sed -i 's/^\(import {.*\)'${ROOT}'\(,*\) \(.*\)$/\1'${ROOT}', '${TOKEN}'\2 \3/' ./gen/ts/log.capnp.ts
|
||||
fi
|
||||
done
|
||||
|
||||
tsc ./gen/ts/* --lib es2015 --outDir ./gen/js
|
||||
39
cereal/install_capnp.sh
Executable file
39
cereal/install_capnp.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
set -e
|
||||
echo "Installing capnp"
|
||||
|
||||
cd /tmp
|
||||
VERSION=0.6.1
|
||||
wget https://capnproto.org/capnproto-c++-${VERSION}.tar.gz
|
||||
tar xvf capnproto-c++-${VERSION}.tar.gz
|
||||
cd capnproto-c++-${VERSION}
|
||||
CXXFLAGS="-fPIC" ./configure
|
||||
|
||||
make -j4
|
||||
|
||||
# manually build binaries statically
|
||||
g++ -std=gnu++11 -I./src -I./src -DKJ_HEADER_WARNINGS -DCAPNP_HEADER_WARNINGS -DCAPNP_INCLUDE_DIR=\"/usr/local/include\" -pthread -O2 -DNDEBUG -pthread -pthread -o .libs/capnp src/capnp/compiler/module-loader.o src/capnp/compiler/capnp.o ./.libs/libcapnpc.a ./.libs/libcapnp.a ./.libs/libkj.a -lpthread -pthread
|
||||
|
||||
g++ -std=gnu++11 -I./src -I./src -DKJ_HEADER_WARNINGS -DCAPNP_HEADER_WARNINGS -DCAPNP_INCLUDE_DIR=\"/usr/local/include\" -pthread -O2 -DNDEBUG -pthread -pthread -o .libs/capnpc-c++ src/capnp/compiler/capnpc-c++.o ./.libs/libcapnp.a ./.libs/libkj.a -lpthread -pthread
|
||||
|
||||
g++ -std=gnu++11 -I./src -I./src -DKJ_HEADER_WARNINGS -DCAPNP_HEADER_WARNINGS -DCAPNP_INCLUDE_DIR=\"/usr/local/include\" -pthread -O2 -DNDEBUG -pthread -pthread -o .libs/capnpc-capnp src/capnp/compiler/capnpc-capnp.o ./.libs/libcapnp.a ./.libs/libkj.a -lpthread -pthread
|
||||
|
||||
cp .libs/capnp /usr/local/bin/
|
||||
ln -s /usr/local/bin/capnp /usr/local/bin/capnpc
|
||||
cp .libs/capnpc-c++ /usr/local/bin/
|
||||
cp .libs/capnpc-capnp /usr/local/bin/
|
||||
cp .libs/*.a /usr/local/lib
|
||||
|
||||
cd /tmp
|
||||
echo "Installing c-capnp"
|
||||
git clone https://github.com/commaai/c-capnproto.git
|
||||
cd c-capnproto
|
||||
git submodule update --init --recursive
|
||||
autoreconf -f -i -s
|
||||
CXXFLAGS="-fPIC" ./configure
|
||||
make -j4
|
||||
|
||||
# manually build binaries statically
|
||||
gcc -fPIC -o .libs/capnpc-c compiler/capnpc-c.o compiler/schema.capnp.o compiler/str.o ./.libs/libcapnp_c.a
|
||||
|
||||
cp .libs/capnpc-c /usr/local/bin/
|
||||
cp .libs/*.a /usr/local/lib
|
||||
986
cereal/log.capnp
986
cereal/log.capnp
File diff suppressed because it is too large
Load Diff
53
cereal/maptile.capnp
Normal file
53
cereal/maptile.capnp
Normal file
@@ -0,0 +1,53 @@
|
||||
using Cxx = import "./include/c++.capnp";
|
||||
$Cxx.namespace("cereal");
|
||||
|
||||
using Java = import "./include/java.capnp";
|
||||
$Java.package("ai.comma.openpilot.cereal");
|
||||
$Java.outerClassname("Map");
|
||||
|
||||
@0xa086df597ef5d7a0;
|
||||
|
||||
# Geometry
|
||||
struct Point {
|
||||
x @0: Float64;
|
||||
y @1: Float64;
|
||||
z @2: Float64;
|
||||
}
|
||||
|
||||
struct PolyLine {
|
||||
points @0: List(Point);
|
||||
}
|
||||
|
||||
# Map features
|
||||
struct Lane {
|
||||
id @0 :Text;
|
||||
|
||||
leftBoundary @1 :LaneBoundary;
|
||||
rightBoundary @2 :LaneBoundary;
|
||||
|
||||
leftAdjacentId @3 :Text;
|
||||
rightAdjacentId @4 :Text;
|
||||
|
||||
inboundIds @5 :List(Text);
|
||||
outboundIds @6 :List(Text);
|
||||
|
||||
struct LaneBoundary {
|
||||
polyLine @0 :PolyLine;
|
||||
startHeading @1 :Float32; # WRT north
|
||||
}
|
||||
}
|
||||
|
||||
# Map tiles
|
||||
struct TileSummary {
|
||||
version @0 :Text;
|
||||
updatedAt @1 :UInt64; # Millis since epoch
|
||||
|
||||
level @2 :UInt8;
|
||||
x @3 :UInt16;
|
||||
y @4 :UInt16;
|
||||
}
|
||||
|
||||
struct MapTile {
|
||||
summary @0 :TileSummary;
|
||||
lanes @1 :List(Lane);
|
||||
}
|
||||
11
check_code_quality.sh
Normal file
11
check_code_quality.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
pyflakes $(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")
|
||||
RESULT=$? & 3
|
||||
fi
|
||||
|
||||
[ $RESULT -ne 0 ] && exit 1
|
||||
exit 0
|
||||
4
common/basedir.py
Normal file
4
common/basedir.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import os
|
||||
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../"))
|
||||
|
||||
|
||||
16
common/clock.pyx
Normal file
16
common/clock.pyx
Normal file
@@ -0,0 +1,16 @@
|
||||
from posix.time cimport clock_gettime, timespec, CLOCK_BOOTTIME, CLOCK_MONOTONIC_RAW
|
||||
|
||||
cdef double readclock(int clock_id):
|
||||
cdef timespec ts
|
||||
cdef double current
|
||||
|
||||
clock_gettime(clock_id, &ts)
|
||||
current = ts.tv_sec + (ts.tv_nsec / 1000000000.)
|
||||
return current
|
||||
|
||||
|
||||
def monotonic_time():
|
||||
return readclock(CLOCK_MONOTONIC_RAW)
|
||||
|
||||
def sec_since_boot():
|
||||
return readclock(CLOCK_BOOTTIME)
|
||||
@@ -1,36 +0,0 @@
|
||||
"""Install exception handler for process crash."""
|
||||
import os
|
||||
import sys
|
||||
|
||||
if os.getenv("NOLOG"):
|
||||
def capture_exception(*exc_info):
|
||||
pass
|
||||
def bind_user(**kwargs):
|
||||
pass
|
||||
def bind_extra(**kwargs):
|
||||
pass
|
||||
def install():
|
||||
pass
|
||||
else:
|
||||
from raven import Client
|
||||
from raven.transport.http import HTTPTransport
|
||||
|
||||
client = Client('https://1994756b5e6f41cf939a4c65de45f4f2:cefebaf3a8aa40d182609785f7189bd7@app.getsentry.com/77924',
|
||||
install_sys_hook=False, transport=HTTPTransport)
|
||||
|
||||
capture_exception = client.captureException
|
||||
|
||||
def bind_user(**kwargs):
|
||||
client.user_context(kwargs)
|
||||
|
||||
def bind_extra(**kwargs):
|
||||
client.extra_context(kwargs)
|
||||
|
||||
def install():
|
||||
# installs a sys.excepthook
|
||||
__excepthook__ = sys.excepthook
|
||||
def handle_exception(*exc_info):
|
||||
if exc_info[0] not in (KeyboardInterrupt, SystemExit):
|
||||
client.captureException(exc_info=exc_info)
|
||||
__excepthook__(*exc_info)
|
||||
sys.excepthook = handle_exception
|
||||
208
common/dbc.py
208
common/dbc.py
@@ -1,31 +1,34 @@
|
||||
import re
|
||||
import os
|
||||
import struct
|
||||
import bitstring
|
||||
from collections import namedtuple
|
||||
import sys
|
||||
import numbers
|
||||
from collections import namedtuple, defaultdict
|
||||
|
||||
def int_or_float(s):
|
||||
# return number, trying to maintain int format
|
||||
try:
|
||||
return int(s)
|
||||
except ValueError:
|
||||
if s.isdigit():
|
||||
return int(s, 10)
|
||||
else:
|
||||
return float(s)
|
||||
|
||||
DBCSignal = namedtuple(
|
||||
"DBCSignal", ["name", "start_bit", "size", "is_little_endian", "is_signed",
|
||||
"factor", "offset", "tmin", "tmax", "units"])
|
||||
|
||||
|
||||
class dbc(object):
|
||||
def __init__(self, fn):
|
||||
self.name, _ = os.path.splitext(os.path.basename(fn))
|
||||
with open(fn) as f:
|
||||
self.txt = f.read().split("\n")
|
||||
self.txt = f.readlines()
|
||||
self._warned_addresses = set()
|
||||
|
||||
# regexps from https://github.com/ebroecker/canmatrix/blob/master/canmatrix/importdbc.py
|
||||
bo_regexp = re.compile("^BO\_ (\w+) (\w+) *: (\w+) (\w+)")
|
||||
sg_regexp = re.compile("^SG\_ (\w+) : (\d+)\|(\d+)@(\d+)([\+|\-]) \(([0-9.+\-eE]+),([0-9.+\-eE]+)\) \[([0-9.+\-eE]+)\|([0-9.+\-eE]+)\] \"(.*)\" (.*)")
|
||||
sgm_regexp = re.compile("^SG\_ (\w+) (\w+) *: (\d+)\|(\d+)@(\d+)([\+|\-]) \(([0-9.+\-eE]+),([0-9.+\-eE]+)\) \[([0-9.+\-eE]+)\|([0-9.+\-eE]+)\] \"(.*)\" (.*)")
|
||||
bo_regexp = re.compile(r"^BO\_ (\w+) (\w+) *: (\w+) (\w+)")
|
||||
sg_regexp = re.compile(r"^SG\_ (\w+) : (\d+)\|(\d+)@(\d+)([\+|\-]) \(([0-9.+\-eE]+),([0-9.+\-eE]+)\) \[([0-9.+\-eE]+)\|([0-9.+\-eE]+)\] \"(.*)\" (.*)")
|
||||
sgm_regexp = re.compile(r"^SG\_ (\w+) (\w+) *: (\d+)\|(\d+)@(\d+)([\+|\-]) \(([0-9.+\-eE]+),([0-9.+\-eE]+)\) \[([0-9.+\-eE]+)\|([0-9.+\-eE]+)\] \"(.*)\" (.*)")
|
||||
val_regexp = re.compile(r"VAL\_ (\w+) (\w+) (\s*[-+]?[0-9]+\s+\".+?\"[^;]*)")
|
||||
|
||||
# A dictionary which maps message ids to tuples ((name, size), signals).
|
||||
# name is the ASCII name of the message.
|
||||
@@ -34,6 +37,9 @@ class dbc(object):
|
||||
# signals is a list of DBCSignal in order of increasing start_bit.
|
||||
self.msgs = {}
|
||||
|
||||
# A dictionary which maps message ids to a list of tuples (signal name, definition value pairs)
|
||||
self.def_vals = defaultdict(list)
|
||||
|
||||
# lookup to bit reverse each byte
|
||||
self.bits_index = [(i & ~0b111) + ((-i-1) & 0b111) for i in xrange(64)]
|
||||
|
||||
@@ -45,10 +51,13 @@ class dbc(object):
|
||||
dat = bo_regexp.match(l)
|
||||
|
||||
if dat is None:
|
||||
print "bad BO", l
|
||||
print("bad BO {0}".format(l))
|
||||
|
||||
name = dat.group(2)
|
||||
size = int(dat.group(3))
|
||||
ids = int(dat.group(1), 0) # could be hex
|
||||
if ids in self.msgs:
|
||||
sys.exit("Duplicate address detected %d %s" % (ids, self.name))
|
||||
|
||||
self.msgs[ids] = ((name, size), [])
|
||||
|
||||
@@ -59,8 +68,9 @@ class dbc(object):
|
||||
if dat is None:
|
||||
dat = sgm_regexp.match(l)
|
||||
go = 1
|
||||
|
||||
if dat is None:
|
||||
print "bad SG", l
|
||||
print("bad SG {0}".format(l))
|
||||
|
||||
sgname = dat.group(1)
|
||||
start_bit = int(dat.group(go+2))
|
||||
@@ -77,9 +87,54 @@ class dbc(object):
|
||||
DBCSignal(sgname, start_bit, signal_size, is_little_endian,
|
||||
is_signed, factor, offset, tmin, tmax, units))
|
||||
|
||||
for msg in self.msgs.viewvalues():
|
||||
if l.startswith("VAL_ "):
|
||||
# new signal value/definition
|
||||
dat = val_regexp.match(l)
|
||||
|
||||
if dat is None:
|
||||
print("bad VAL {0}".format(l))
|
||||
|
||||
ids = int(dat.group(1), 0) # could be hex
|
||||
sgname = dat.group(2)
|
||||
defvals = dat.group(3)
|
||||
|
||||
defvals = defvals.replace("?",r"\?") #escape sequence in C++
|
||||
defvals = defvals.split('"')[:-1]
|
||||
|
||||
defs = defvals[1::2]
|
||||
#cleanup, convert to UPPER_CASE_WITH_UNDERSCORES
|
||||
for i,d in enumerate(defs):
|
||||
d = defs[i].strip().upper()
|
||||
defs[i] = d.replace(" ","_")
|
||||
|
||||
defvals[1::2] = defs
|
||||
defvals = '"'+"".join(str(i) for i in defvals)+'"'
|
||||
|
||||
self.def_vals[ids].append((sgname, defvals))
|
||||
|
||||
for msg in self.msgs.values():
|
||||
msg[1].sort(key=lambda x: x.start_bit)
|
||||
|
||||
self.msg_name_to_address = {}
|
||||
for address, m in self.msgs.items():
|
||||
name = m[0][0]
|
||||
self.msg_name_to_address[name] = address
|
||||
|
||||
def lookup_msg_id(self, msg_id):
|
||||
if not isinstance(msg_id, numbers.Number):
|
||||
msg_id = self.msg_name_to_address[msg_id]
|
||||
return msg_id
|
||||
|
||||
def reverse_bytes(self, x):
|
||||
return ((x & 0xff00000000000000) >> 56) | \
|
||||
((x & 0x00ff000000000000) >> 40) | \
|
||||
((x & 0x0000ff0000000000) >> 24) | \
|
||||
((x & 0x000000ff00000000) >> 8) | \
|
||||
((x & 0x00000000ff000000) << 8) | \
|
||||
((x & 0x0000000000ff0000) << 24) | \
|
||||
((x & 0x000000000000ff00) << 40) | \
|
||||
((x & 0x00000000000000ff) << 56)
|
||||
|
||||
def encode(self, msg_id, dd):
|
||||
"""Encode a CAN message using the dbc.
|
||||
|
||||
@@ -87,35 +142,42 @@ class dbc(object):
|
||||
msg_id: The message ID.
|
||||
dd: A dictionary mapping signal name to signal data.
|
||||
"""
|
||||
# TODO: Stop using bitstring, which is super slow.
|
||||
msg_id = self.lookup_msg_id(msg_id)
|
||||
|
||||
msg_def = self.msgs[msg_id]
|
||||
size = msg_def[0][1]
|
||||
|
||||
bsf = bitstring.Bits(hex="00"*size)
|
||||
result = 0
|
||||
for s in msg_def[1]:
|
||||
ival = dd.get(s.name)
|
||||
if ival is not None:
|
||||
|
||||
b2 = s.size
|
||||
if s.is_little_endian:
|
||||
b1 = s.start_bit
|
||||
else:
|
||||
b1 = (s.start_bit // 8) * 8 + (-s.start_bit - 1) % 8
|
||||
bo = 64 - (b1 + s.size)
|
||||
|
||||
ival = (ival / s.factor) - s.offset
|
||||
ival = int(round(ival))
|
||||
|
||||
# should pack this
|
||||
if s.is_signed and ival < 0:
|
||||
ival = (1 << b2) + ival
|
||||
|
||||
shift = b1 if s.is_little_endian else bo
|
||||
mask = ((1 << b2) - 1) << shift
|
||||
dat = (ival & ((1 << b2) - 1)) << shift
|
||||
|
||||
if s.is_little_endian:
|
||||
ss = s.start_bit
|
||||
else:
|
||||
ss = self.bits_index[s.start_bit]
|
||||
mask = self.reverse_bytes(mask)
|
||||
dat = self.reverse_bytes(dat)
|
||||
|
||||
result &= ~mask
|
||||
result |= dat
|
||||
|
||||
if s.is_signed:
|
||||
tbs = bitstring.Bits(int=ival, length=s.size)
|
||||
else:
|
||||
tbs = bitstring.Bits(uint=ival, length=s.size)
|
||||
|
||||
lpad = bitstring.Bits(bin="0b"+"0"*ss)
|
||||
rpad = bitstring.Bits(bin="0b"+"0"*(8*size-(ss+s.size)))
|
||||
tbs = lpad+tbs+rpad
|
||||
|
||||
bsf |= tbs
|
||||
return bsf.tobytes()
|
||||
result = struct.pack('>Q', result)
|
||||
return result[:size]
|
||||
|
||||
def decode(self, x, arr=None, debug=False):
|
||||
"""Decode a CAN message using the dbc.
|
||||
@@ -134,7 +196,7 @@ class dbc(object):
|
||||
|
||||
Returns (None, None) if the message could not be decoded.
|
||||
"""
|
||||
|
||||
|
||||
if arr is None:
|
||||
out = {}
|
||||
else:
|
||||
@@ -143,53 +205,85 @@ class dbc(object):
|
||||
msg = self.msgs.get(x[0])
|
||||
if msg is None:
|
||||
if x[0] not in self._warned_addresses:
|
||||
print("WARNING: Unknown message address {}".format(x[0]))
|
||||
#print("WARNING: Unknown message address {}".format(x[0]))
|
||||
self._warned_addresses.add(x[0])
|
||||
return None, None
|
||||
|
||||
name = msg[0][0]
|
||||
if debug:
|
||||
print name
|
||||
print(name)
|
||||
|
||||
blen = 8*len(x[2])
|
||||
|
||||
st = x[2].rjust(8, '\x00')
|
||||
st = x[2].ljust(8, '\x00')
|
||||
le, be = None, None
|
||||
|
||||
for s in msg[1]:
|
||||
if arr is not None and s[0] not in arr:
|
||||
continue
|
||||
|
||||
# big or little endian?
|
||||
# see http://vi-firmware.openxcplatform.com/en/master/config/bit-numbering.html
|
||||
if s[3] is False:
|
||||
ss = self.bits_index[s[1]]
|
||||
if be is None:
|
||||
be = struct.unpack(">Q", st)[0]
|
||||
x2_int = be
|
||||
data_bit_pos = (blen - (ss + s[2]))
|
||||
start_bit = s[1]
|
||||
signal_size = s[2]
|
||||
little_endian = s[3]
|
||||
signed = s[4]
|
||||
factor = s[5]
|
||||
offset = s[6]
|
||||
|
||||
b2 = signal_size
|
||||
if little_endian:
|
||||
b1 = start_bit
|
||||
else:
|
||||
b1 = (start_bit // 8) * 8 + (-start_bit - 1) % 8
|
||||
bo = 64 - (b1 + signal_size)
|
||||
|
||||
if little_endian:
|
||||
if le is None:
|
||||
le = struct.unpack("<Q", st)[0]
|
||||
x2_int = le
|
||||
ss = s[1]
|
||||
data_bit_pos = ss
|
||||
shift_amount = b1
|
||||
tmp = le
|
||||
else:
|
||||
if be is None:
|
||||
be = struct.unpack(">Q", st)[0]
|
||||
shift_amount = bo
|
||||
tmp = be
|
||||
|
||||
if data_bit_pos < 0:
|
||||
if shift_amount < 0:
|
||||
continue
|
||||
ival = (x2_int >> data_bit_pos) & ((1 << (s[2])) - 1)
|
||||
|
||||
if s[4] and (ival & (1<<(s[2]-1))): # signed
|
||||
ival -= (1<<s[2])
|
||||
tmp = (tmp >> shift_amount) & ((1 << b2) - 1)
|
||||
if signed and (tmp >> (b2 - 1)):
|
||||
tmp -= (1 << b2)
|
||||
|
||||
# control the offset
|
||||
ival = (ival * s[5]) + s[6]
|
||||
#if debug:
|
||||
# print "%40s %2d %2d %7.2f %s" % (s[0], s[1], s[2], ival, s[-1])
|
||||
tmp = tmp * factor + offset
|
||||
|
||||
# if debug:
|
||||
# print("%40s %2d %2d %7.2f %s" % (s[0], s[1], s[2], tmp, s[-1]))
|
||||
|
||||
if arr is None:
|
||||
out[s[0]] = ival
|
||||
out[s[0]] = tmp
|
||||
else:
|
||||
out[arr.index(s[0])] = ival
|
||||
out[arr.index(s[0])] = tmp
|
||||
return name, out
|
||||
|
||||
|
||||
def get_signals(self, msg):
|
||||
msg = self.lookup_msg_id(msg)
|
||||
return [sgs.name for sgs in self.msgs[msg][1]]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from opendbc import DBC_PATH
|
||||
import numpy as np
|
||||
|
||||
dbc_test = dbc(os.path.join(DBC_PATH, 'toyota_prius_2017_pt_generated.dbc'))
|
||||
msg = ('STEER_ANGLE_SENSOR', {'STEER_ANGLE': -6.0, 'STEER_RATE': 4, 'STEER_FRACTION': -0.2})
|
||||
encoded = dbc_test.encode(*msg)
|
||||
decoded = dbc_test.decode((0x25, 0, encoded))
|
||||
assert decoded == msg
|
||||
|
||||
dbc_test = dbc(os.path.join(DBC_PATH, 'hyundai_santa_fe_2019_ccan.dbc'))
|
||||
decoded = dbc_test.decode((0x2b0, 0, "\xfa\xfe\x00\x07\x12"))
|
||||
assert np.isclose(decoded[1]['SAS_Angle'], -26.2)
|
||||
|
||||
msg = ('SAS11', {'SAS_Stat': 7.0, 'MsgCount': 0.0, 'SAS_Angle': -26.200000000000003, 'SAS_Speed': 0.0, 'CheckSum': 0.0})
|
||||
encoded = dbc_test.encode(*msg)
|
||||
decoded = dbc_test.decode((0x2b0, 0, encoded))
|
||||
|
||||
assert decoded == msg
|
||||
|
||||
49
common/ffi_wrapper.py
Normal file
49
common/ffi_wrapper.py
Normal file
@@ -0,0 +1,49 @@
|
||||
import os
|
||||
import sys
|
||||
import fcntl
|
||||
import hashlib
|
||||
from cffi import FFI
|
||||
|
||||
|
||||
def ffi_wrap(name, c_code, c_header, tmpdir="/tmp/ccache", cflags="", libraries=None):
|
||||
if libraries is None:
|
||||
libraries = []
|
||||
|
||||
cache = name + "_" + hashlib.sha1(c_code).hexdigest()
|
||||
try:
|
||||
os.mkdir(tmpdir)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
fd = os.open(tmpdir, 0)
|
||||
fcntl.flock(fd, fcntl.LOCK_EX)
|
||||
try:
|
||||
sys.path.append(tmpdir)
|
||||
try:
|
||||
mod = __import__(cache)
|
||||
except Exception:
|
||||
print("cache miss {0}".format(cache))
|
||||
compile_code(cache, c_code, c_header, tmpdir, cflags, libraries)
|
||||
mod = __import__(cache)
|
||||
finally:
|
||||
os.close(fd)
|
||||
|
||||
return mod.ffi, mod.lib
|
||||
|
||||
|
||||
def compile_code(name, c_code, c_header, directory, cflags="", libraries=None):
|
||||
if libraries is None:
|
||||
libraries = []
|
||||
|
||||
ffibuilder = FFI()
|
||||
ffibuilder.set_source(name, c_code, source_extension='.cpp', libraries=libraries)
|
||||
ffibuilder.cdef(c_header)
|
||||
os.environ['OPT'] = "-fwrapv -O2 -DNDEBUG -std=c++11"
|
||||
os.environ['CFLAGS'] = cflags
|
||||
ffibuilder.compile(verbose=True, debug=False, tmpdir=directory)
|
||||
|
||||
|
||||
def wrap_compiled(name, directory):
|
||||
sys.path.append(directory)
|
||||
mod = __import__(name)
|
||||
return mod.ffi, mod.lib
|
||||
118
common/file_helpers.py
Normal file
118
common/file_helpers.py
Normal file
@@ -0,0 +1,118 @@
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
from atomicwrites import AtomicWriter
|
||||
|
||||
def mkdirs_exists_ok(path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError:
|
||||
if not os.path.isdir(path):
|
||||
raise
|
||||
|
||||
def rm_not_exists_ok(path):
|
||||
try:
|
||||
os.remove(path)
|
||||
except OSError:
|
||||
if os.path.exists(path):
|
||||
raise
|
||||
|
||||
def rm_tree_or_link(path):
|
||||
if os.path.islink(path):
|
||||
os.unlink(path)
|
||||
elif os.path.isdir(path):
|
||||
shutil.rmtree(path)
|
||||
|
||||
def get_tmpdir_on_same_filesystem(path):
|
||||
# TODO(mgraczyk): HACK, we should actually check for which filesystem.
|
||||
normpath = os.path.normpath(path)
|
||||
parts = normpath.split("/")
|
||||
if len(parts) > 1:
|
||||
if parts[1].startswith("raid") or parts[1].startswith("datasets"):
|
||||
if len(parts) > 2 and parts[2] == "runner":
|
||||
return "/{}/runner/tmp".format(parts[1])
|
||||
elif len(parts) > 2 and parts[2] == "aws":
|
||||
return "/{}/aws/tmp".format(parts[1])
|
||||
else:
|
||||
return "/{}/tmp".format(parts[1])
|
||||
elif parts[1] == "aws":
|
||||
return "/aws/tmp"
|
||||
elif parts[1] == "scratch":
|
||||
return "/scratch/tmp"
|
||||
return "/tmp"
|
||||
|
||||
class AutoMoveTempdir(object):
|
||||
def __init__(self, target_path, temp_dir=None):
|
||||
self._target_path = target_path
|
||||
self._path = tempfile.mkdtemp(dir=temp_dir)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self._path
|
||||
|
||||
def close(self):
|
||||
os.rename(self._path, self._target_path)
|
||||
|
||||
def __enter__(self): return self
|
||||
|
||||
def __exit__(self, type, value, traceback):
|
||||
if type is None:
|
||||
self.close()
|
||||
else:
|
||||
shutil.rmtree(self._path)
|
||||
|
||||
class NamedTemporaryDir(object):
|
||||
def __init__(self, temp_dir=None):
|
||||
self._path = tempfile.mkdtemp(dir=temp_dir)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self._path
|
||||
|
||||
def close(self):
|
||||
shutil.rmtree(self._path)
|
||||
|
||||
def __enter__(self): return self
|
||||
|
||||
def __exit__(self, type, value, traceback):
|
||||
self.close()
|
||||
|
||||
def _get_fileobject_func(writer, temp_dir):
|
||||
def _get_fileobject():
|
||||
file_obj = writer.get_fileobject(dir=temp_dir)
|
||||
os.chmod(file_obj.name, 0o644)
|
||||
return file_obj
|
||||
return _get_fileobject
|
||||
|
||||
def atomic_write_on_fs_tmp(path, **kwargs):
|
||||
"""Creates an atomic writer using a temporary file in a temporary directory
|
||||
on the same filesystem as path.
|
||||
"""
|
||||
# TODO(mgraczyk): This use of AtomicWriter relies on implementation details to set the temp
|
||||
# directory.
|
||||
writer = AtomicWriter(path, **kwargs)
|
||||
return writer._open(_get_fileobject_func(writer, get_tmpdir_on_same_filesystem(path)))
|
||||
|
||||
|
||||
def atomic_write_in_dir(path, **kwargs):
|
||||
"""Creates an atomic writer using a temporary file in the same directory
|
||||
as the destination file.
|
||||
"""
|
||||
writer = AtomicWriter(path, **kwargs)
|
||||
return writer._open(_get_fileobject_func(writer, os.path.dirname(path)))
|
||||
|
||||
def atomic_write_in_dir_neos(path, contents, mode=None):
|
||||
"""
|
||||
Atomically writes contents to path using a temporary file in the same directory
|
||||
as path. Useful on NEOS, where `os.link` (required by atomic_write_in_dir) is missing.
|
||||
"""
|
||||
|
||||
f = tempfile.NamedTemporaryFile(delete=False, prefix=".tmp", dir=os.path.dirname(path))
|
||||
f.write(contents)
|
||||
f.flush()
|
||||
if mode is not None:
|
||||
os.fchmod(f.fileno(), mode)
|
||||
os.fsync(f.fileno())
|
||||
f.close()
|
||||
|
||||
os.rename(f.name, path)
|
||||
10
common/filter_simple.py
Normal file
10
common/filter_simple.py
Normal file
@@ -0,0 +1,10 @@
|
||||
class FirstOrderFilter():
|
||||
# first order filter
|
||||
def __init__(self, x0, ts, dt):
|
||||
self.k = (dt / ts) / (1. + dt / ts)
|
||||
self.x = x0
|
||||
|
||||
def update(self, x):
|
||||
self.x = (1. - self.k) * self.x + self.k * x
|
||||
|
||||
|
||||
@@ -1,25 +1,36 @@
|
||||
import os
|
||||
from common.basedir import BASEDIR
|
||||
|
||||
def get_fingerprint_list():
|
||||
# read all the folders in selfdrive/car and return a dict where:
|
||||
# - keys are all the car models for which we have a fingerprint
|
||||
# - values are lists dicts of messages that constitute the unique
|
||||
# CAN fingerprint of each car model and all its variants
|
||||
fingerprints = {}
|
||||
for car_folder in [x[0] for x in os.walk(BASEDIR + '/selfdrive/car')]:
|
||||
try:
|
||||
car_name = car_folder.split('/')[-1]
|
||||
values = __import__('selfdrive.car.%s.values' % car_name, fromlist=['FINGERPRINTS'])
|
||||
if hasattr(values, 'FINGERPRINTS'):
|
||||
car_fingerprints = values.FINGERPRINTS
|
||||
else:
|
||||
continue
|
||||
for f, v in car_fingerprints.items():
|
||||
fingerprints[f] = v
|
||||
except (ImportError, IOError):
|
||||
pass
|
||||
return fingerprints
|
||||
|
||||
|
||||
_FINGERPRINTS = get_fingerprint_list()
|
||||
|
||||
_DEBUG_ADDRESS = {1880: 8} # reserved for debug purposes
|
||||
|
||||
def is_valid_for_fingerprint(msg, car_fingerprint):
|
||||
adr = msg.address
|
||||
# ignore addresses that are more than 11 bits
|
||||
return (adr in car_fingerprint and car_fingerprint[adr] == len(msg.dat)) or adr >= 0x800
|
||||
|
||||
_FINGERPRINTS = {
|
||||
"ACURA ILX 2016 ACURAWATCH PLUS": {
|
||||
1024L: 5, 513L: 5, 1027L: 5, 1029L: 8, 929L: 4, 1057L: 5, 777L: 8, 1034L: 5, 1036L: 8, 398L: 3, 399L: 7, 145L: 8, 660L: 8, 985L: 3, 923L: 2, 542L: 7, 773L: 7, 800L: 8, 432L: 7, 419L: 8, 420L: 8, 1030L: 5, 422L: 8, 808L: 8, 428L: 8, 304L: 8, 819L: 7, 821L: 5, 57L: 3, 316L: 8, 545L: 4, 464L: 8, 1108L: 8, 597L: 8, 342L: 6, 983L: 8, 344L: 8, 804L: 8, 1039L: 8, 476L: 4, 892L: 8, 490L: 8, 1064L: 7, 882L: 2, 884L: 7, 887L: 8, 888L: 8, 380L: 8, 1365L: 5,
|
||||
# sent messages
|
||||
0xe4: 5, 0x1fa: 8, 0x200: 3, 0x30c: 8, 0x33d: 5,
|
||||
},
|
||||
"HONDA CIVIC 2016 TOURING": {
|
||||
1024L: 5, 513L: 5, 1027L: 5, 1029L: 8, 777L: 8, 1036L: 8, 1039L: 8, 1424L: 5, 401L: 8, 148L: 8, 662L: 4, 985L: 3, 795L: 8, 773L: 7, 800L: 8, 545L: 6, 420L: 8, 806L: 8, 808L: 8, 1322L: 5, 427L: 3, 428L: 8, 304L: 8, 432L: 7, 57L: 3, 450L: 8, 929L: 8, 330L: 8, 1302L: 8, 464L: 8, 1361L: 5, 1108L: 8, 597L: 8, 470L: 2, 344L: 8, 804L: 8, 399L: 7, 476L: 7, 1633L: 8, 487L: 4, 892L: 8, 490L: 8, 493L: 5, 884L: 8, 891L: 8, 380L: 8, 1365L: 5,
|
||||
# sent messages
|
||||
0xe4: 5, 0x1fa: 8, 0x200: 3, 0x30c: 8, 0x33d: 5, 0x35e: 8, 0x39f: 8,
|
||||
},
|
||||
"HONDA ACCORD 2016 TOURING": {
|
||||
1024L: 5, 929L: 8, 1027L: 5, 773L: 7, 1601L: 8, 777L: 8, 1036L: 8, 398L: 3, 1039L: 8, 401L: 8, 145L: 8, 1424L: 5, 660L: 8, 661L: 4, 918L: 7, 985L: 3, 923L: 2, 542L: 7, 927L: 8, 800L: 8, 545L: 4, 420L: 8, 422L: 8, 808L: 8, 426L: 8, 1029L: 8, 432L: 7, 57L: 3, 316L: 8, 829L: 5, 1600L: 5, 1089L: 8, 1057L: 5, 780L: 8, 1088L: 8, 464L: 8, 1108L: 8, 597L: 8, 342L: 6, 983L: 8, 344L: 8, 804L: 8, 476L: 4, 1296L: 3, 891L: 8, 1125L: 8, 487L: 4, 892L: 8, 490L: 8, 871L: 8, 1064L: 7, 882L: 2, 884L: 8, 506L: 8, 507L: 1, 380L: 8, 1365L: 5
|
||||
},
|
||||
"HONDA CR-V 2016 TOURING": {
|
||||
57L: 3, 145L: 8, 316L: 8, 340L: 8, 342L: 6, 344L: 8, 380L: 8, 398L: 3, 399L: 6, 401L: 8, 420L: 8, 422L: 8, 426L: 8, 432L: 7, 464L: 8, 474L: 5, 476L: 4, 487L: 4, 490L: 8, 493L: 3, 507L: 1, 542L: 7, 545L: 4, 597L: 8, 660L: 8, 661L: 4, 773L: 7, 777L: 8, 800L: 8, 804L: 8, 808L: 8, 882L: 2, 884L: 7, 888L: 8, 891L: 8, 892L: 8, 923L: 2, 929L: 8, 983L: 8, 985L: 3, 1024L: 5, 1027L: 5, 1029L: 8, 1033L: 5, 1036L: 8, 1039L: 8, 1057L: 5, 1064L: 7, 1108L: 8, 1125L: 8, 1296L: 8, 1365L: 5, 1424L: 5, 1600L: 5, 1601L: 8,
|
||||
# sent messages
|
||||
0x194: 4, 0x1fa: 8, 0x30c: 8, 0x33d: 5,
|
||||
}
|
||||
}
|
||||
|
||||
def eliminate_incompatible_cars(msg, candidate_cars):
|
||||
"""Removes cars that could not have sent msg.
|
||||
@@ -32,51 +43,20 @@ def eliminate_incompatible_cars(msg, candidate_cars):
|
||||
A list containing the subset of candidate_cars that could have sent msg.
|
||||
"""
|
||||
compatible_cars = []
|
||||
|
||||
for car_name in candidate_cars:
|
||||
adr = msg.address
|
||||
if msg.src != 0 or (adr in _FINGERPRINTS[car_name] and
|
||||
_FINGERPRINTS[car_name][adr] == len(msg.dat)):
|
||||
compatible_cars.append(car_name)
|
||||
else:
|
||||
pass
|
||||
#isin = adr in _FINGERPRINTS[car_name]
|
||||
#print "eliminate", car_name, hex(adr), isin, len(msg.dat), msg.dat.encode("hex")
|
||||
car_fingerprints = _FINGERPRINTS[car_name]
|
||||
|
||||
for fingerprint in car_fingerprints:
|
||||
fingerprint.update(_DEBUG_ADDRESS) # add alien debug address
|
||||
|
||||
if is_valid_for_fingerprint(msg, fingerprint):
|
||||
compatible_cars.append(car_name)
|
||||
break
|
||||
|
||||
return compatible_cars
|
||||
|
||||
|
||||
def all_known_cars():
|
||||
"""Returns a list of all known car strings."""
|
||||
return _FINGERPRINTS.keys()
|
||||
|
||||
# **** for use live only ****
|
||||
def fingerprint(logcan):
|
||||
import selfdrive.messaging as messaging
|
||||
from cereal import car
|
||||
from common.realtime import sec_since_boot
|
||||
|
||||
if os.getenv("SIMULATOR") is not None or logcan is None:
|
||||
return ("simulator", None)
|
||||
elif os.getenv("SIMULATOR2") is not None:
|
||||
return ("simulator2", None)
|
||||
|
||||
print "waiting for fingerprint..."
|
||||
candidate_cars = all_known_cars()
|
||||
finger = {}
|
||||
st = None
|
||||
while 1:
|
||||
for a in messaging.drain_sock(logcan, wait_for_one=True):
|
||||
if st is None:
|
||||
st = sec_since_boot()
|
||||
for can in a.can:
|
||||
if can.src == 0:
|
||||
finger[can.address] = len(can.dat)
|
||||
candidate_cars = eliminate_incompatible_cars(can, candidate_cars)
|
||||
|
||||
# if we only have one car choice and it's been 100ms since we got our first message, exit
|
||||
if len(candidate_cars) == 1 and st is not None and (sec_since_boot()-st) > 0.1:
|
||||
break
|
||||
elif len(candidate_cars) == 0:
|
||||
print map(hex, finger.keys())
|
||||
raise Exception("car doesn't match any fingerprints")
|
||||
|
||||
print "fingerprinted", candidate_cars[0]
|
||||
return (candidate_cars[0], finger)
|
||||
return list(_FINGERPRINTS.keys())
|
||||
|
||||
10
common/kalman/Makefile
Normal file
10
common/kalman/Makefile
Normal file
@@ -0,0 +1,10 @@
|
||||
all: simple_kalman_impl.so
|
||||
|
||||
simple_kalman_impl.so: simple_kalman_impl.pyx simple_kalman_impl.pxd simple_kalman_setup.py
|
||||
python2 simple_kalman_setup.py build_ext --inplace
|
||||
rm -rf build
|
||||
rm simple_kalman_impl.c
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f simple_kalman_impl.so
|
||||
@@ -1,6 +1,7 @@
|
||||
# pylint: skip-file
|
||||
from __future__ import print_function
|
||||
import abc
|
||||
import numpy as np
|
||||
import numpy.matlib
|
||||
# The EKF class contains the framework for an Extended Kalman Filter, but must be subclassed to use.
|
||||
# A subclass must implement:
|
||||
# 1) calc_transfer_fun(); see bottom of file for more info.
|
||||
@@ -19,6 +20,7 @@ import numpy.matlib
|
||||
# update() should be called once per sensor, and can be called multiple times between predict steps.
|
||||
# Access and set the state of the filter directly with ekf.state and ekf.covar.
|
||||
|
||||
|
||||
class SensorReading:
|
||||
# Given a perfect model and no noise, data = obs_model * state
|
||||
def __init__(self, data, covar, obs_model):
|
||||
@@ -33,8 +35,8 @@ class SensorReading:
|
||||
|
||||
# A generic sensor class that does no pre-processing of data
|
||||
class SimpleSensor:
|
||||
# obs_model can be
|
||||
# a full obesrvation model matrix, or
|
||||
# obs_model can be
|
||||
# a full observation model matrix, or
|
||||
# an integer or tuple of indices into ekf.state, indicating which variables are being directly observed
|
||||
# covar can be
|
||||
# a full covariance matrix
|
||||
@@ -91,8 +93,8 @@ class EKF:
|
||||
innovation = reading.data - reading.obs_model * self.state
|
||||
|
||||
if self.DEBUG:
|
||||
print "reading:\n",reading.data
|
||||
print "innovation:\n",innovation
|
||||
print("reading:\n",reading.data)
|
||||
print("innovation:\n",innovation)
|
||||
|
||||
# S = H*P*H' + R
|
||||
innovation_covar = reading.obs_model * self.covar * reading.obs_model.T + reading.covar
|
||||
@@ -102,12 +104,12 @@ class EKF:
|
||||
innovation_covar)
|
||||
|
||||
if self.DEBUG:
|
||||
print "gain:\n", kalman_gain
|
||||
print "innovation_covar:\n", innovation_covar
|
||||
print "innovation: ", innovation
|
||||
print "test: ", self.covar * reading.obs_model.T * (
|
||||
print("gain:\n", kalman_gain)
|
||||
print("innovation_covar:\n", innovation_covar)
|
||||
print("innovation: ", innovation)
|
||||
print("test: ", self.covar * reading.obs_model.T * (
|
||||
reading.obs_model * self.covar * reading.obs_model.T + reading.covar *
|
||||
0).I
|
||||
0).I)
|
||||
|
||||
# x = x + K*y
|
||||
self.state += kalman_gain*innovation
|
||||
@@ -123,19 +125,19 @@ class EKF:
|
||||
self.covar = aux_mtrx * self.covar * aux_mtrx.T + kalman_gain * reading.covar * kalman_gain.T
|
||||
|
||||
if self.DEBUG:
|
||||
print "After update"
|
||||
print "state\n", self.state
|
||||
print "covar:\n",self.covar
|
||||
print("After update")
|
||||
print("state\n", self.state)
|
||||
print("covar:\n",self.covar)
|
||||
|
||||
def update_scalar(self, reading):
|
||||
# like update but knowing that measurment is a scalar
|
||||
# like update but knowing that measurement is a scalar
|
||||
# this avoids matrix inversions and speeds up (surprisingly) drived.py a lot
|
||||
|
||||
# innovation = reading.data - np.matmul(reading.obs_model, self.state)
|
||||
# innovation_covar = np.matmul(np.matmul(reading.obs_model, self.covar), reading.obs_model.T) + reading.covar
|
||||
# kalman_gain = np.matmul(self.covar, reading.obs_model.T)/innovation_covar
|
||||
# self.state += np.matmul(kalman_gain, innovation)
|
||||
# aux_mtrx = self.identity - np.matmul(kalman_gain, reading.obs_model)
|
||||
# innovation = reading.data - np.matmul(reading.obs_model, self.state)
|
||||
# innovation_covar = np.matmul(np.matmul(reading.obs_model, self.covar), reading.obs_model.T) + reading.covar
|
||||
# kalman_gain = np.matmul(self.covar, reading.obs_model.T)/innovation_covar
|
||||
# self.state += np.matmul(kalman_gain, innovation)
|
||||
# aux_mtrx = self.identity - np.matmul(kalman_gain, reading.obs_model)
|
||||
# self.covar = np.matmul(aux_mtrx, np.matmul(self.covar, aux_mtrx.T)) + np.matmul(kalman_gain, np.matmul(reading.covar, kalman_gain.T))
|
||||
|
||||
# written without np.matmul
|
||||
@@ -174,7 +176,7 @@ class EKF:
|
||||
|
||||
#! Clip covariance to avoid explosions
|
||||
self.covar = np.clip(self.covar,-1e10,1e10)
|
||||
|
||||
|
||||
@abc.abstractmethod
|
||||
def calc_transfer_fun(self, dt):
|
||||
"""Return a tuple with the transfer function and transfer function jacobian
|
||||
@@ -187,9 +189,10 @@ class EKF:
|
||||
|
||||
Current implementations calculate A and J as functions of state. Control input
|
||||
can be added trivially by adding a control parameter to predict() and calc_tranfer_update(),
|
||||
and using it during calcualtion of A and J
|
||||
and using it during calculation of A and J
|
||||
"""
|
||||
|
||||
|
||||
class FastEKF1D(EKF):
|
||||
"""Fast version of EKF for 1D problems with scalar readings."""
|
||||
|
||||
|
||||
10
common/kalman/simple_kalman.py
Normal file
10
common/kalman/simple_kalman.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# pylint: skip-file
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
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
|
||||
16
common/kalman/simple_kalman_impl.pxd
Normal file
16
common/kalman/simple_kalman_impl.pxd
Normal file
@@ -0,0 +1,16 @@
|
||||
cdef class KF1D:
|
||||
cdef public:
|
||||
double x0_0
|
||||
double x1_0
|
||||
double K0_0
|
||||
double K1_0
|
||||
double A0_0
|
||||
double A0_1
|
||||
double A1_0
|
||||
double A1_1
|
||||
double C0_0
|
||||
double C0_1
|
||||
double A_K_0
|
||||
double A_K_1
|
||||
double A_K_2
|
||||
double A_K_3
|
||||
35
common/kalman/simple_kalman_impl.pyx
Normal file
35
common/kalman/simple_kalman_impl.pyx
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
cdef class KF1D:
|
||||
def __init__(self, x0, A, C, K):
|
||||
self.x0_0 = x0[0][0]
|
||||
self.x1_0 = x0[1][0]
|
||||
self.A0_0 = A[0][0]
|
||||
self.A0_1 = A[0][1]
|
||||
self.A1_0 = A[1][0]
|
||||
self.A1_1 = A[1][1]
|
||||
self.C0_0 = C[0]
|
||||
self.C0_1 = C[1]
|
||||
self.K0_0 = K[0][0]
|
||||
self.K1_0 = K[1][0]
|
||||
|
||||
self.A_K_0 = self.A0_0 - self.K0_0 * self.C0_0
|
||||
self.A_K_1 = self.A0_1 - self.K0_0 * self.C0_1
|
||||
self.A_K_2 = self.A1_0 - self.K1_0 * self.C0_0
|
||||
self.A_K_3 = self.A1_1 - self.K1_0 * self.C0_1
|
||||
|
||||
def update(self, meas):
|
||||
cdef double x0_0 = self.A_K_0 * self.x0_0 + self.A_K_1 * self.x1_0 + self.K0_0 * meas
|
||||
cdef double x1_0 = self.A_K_2 * self.x0_0 + self.A_K_3 * self.x1_0 + self.K1_0 * meas
|
||||
self.x0_0 = x0_0
|
||||
self.x1_0 = x1_0
|
||||
|
||||
return [self.x0_0, self.x1_0]
|
||||
|
||||
@property
|
||||
def x(self):
|
||||
return [[self.x0_0], [self.x1_0]]
|
||||
|
||||
@x.setter
|
||||
def x(self, x):
|
||||
self.x0_0 = x[0][0]
|
||||
self.x1_0 = x[1][0]
|
||||
23
common/kalman/simple_kalman_old.py
Normal file
23
common/kalman/simple_kalman_old.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import numpy as np
|
||||
|
||||
|
||||
class KF1D:
|
||||
# this EKF assumes constant covariance matrix, so calculations are much simpler
|
||||
# the Kalman gain also needs to be precomputed using the control module
|
||||
|
||||
def __init__(self, x0, A, C, K):
|
||||
self.x = x0
|
||||
self.A = A
|
||||
self.C = C
|
||||
self.K = K
|
||||
|
||||
self.A_K = self.A - np.dot(self.K, self.C)
|
||||
|
||||
# K matrix needs to be pre-computed as follow:
|
||||
# import control
|
||||
# (x, l, K) = control.dare(np.transpose(self.A), np.transpose(self.C), Q, R)
|
||||
# self.K = np.transpose(K)
|
||||
|
||||
def update(self, meas):
|
||||
self.x = np.dot(self.A_K, self.x) + np.dot(self.K, meas)
|
||||
return self.x
|
||||
5
common/kalman/simple_kalman_setup.py
Normal file
5
common/kalman/simple_kalman_setup.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from distutils.core import setup, Extension
|
||||
from Cython.Build import cythonize
|
||||
|
||||
setup(name='Simple Kalman Implementation',
|
||||
ext_modules=cythonize(Extension("simple_kalman_impl", ["simple_kalman_impl.pyx"])))
|
||||
116
common/kalman/tests/test_ekf.py
Normal file
116
common/kalman/tests/test_ekf.py
Normal file
@@ -0,0 +1,116 @@
|
||||
import numpy as np
|
||||
import numpy.matlib
|
||||
import unittest
|
||||
import timeit
|
||||
|
||||
from common.kalman.ekf import EKF, SimpleSensor, FastEKF1D
|
||||
|
||||
class TestEKF(EKF):
|
||||
def __init__(self, var_init, Q):
|
||||
super(TestEKF, self).__init__(False)
|
||||
self.identity = numpy.matlib.identity(2)
|
||||
self.state = numpy.matlib.zeros((2, 1))
|
||||
self.covar = self.identity * var_init
|
||||
|
||||
self.process_noise = numpy.matlib.diag(Q)
|
||||
|
||||
def calc_transfer_fun(self, dt):
|
||||
tf = numpy.matlib.identity(2)
|
||||
tf[0, 1] = dt
|
||||
return tf, tf
|
||||
|
||||
|
||||
class EKFTest(unittest.TestCase):
|
||||
def test_update_scalar(self):
|
||||
ekf = TestEKF(1e3, [0.1, 1])
|
||||
dt = 1. / 100
|
||||
|
||||
sensor = SimpleSensor(0, 1, 2)
|
||||
readings = map(sensor.read, np.arange(100, 300))
|
||||
|
||||
for reading in readings:
|
||||
ekf.update_scalar(reading)
|
||||
ekf.predict(dt)
|
||||
|
||||
np.testing.assert_allclose(ekf.state, [[300], [100]], 1e-4)
|
||||
np.testing.assert_allclose(
|
||||
ekf.covar,
|
||||
np.asarray([[0.0563, 0.10278], [0.10278, 0.55779]]),
|
||||
atol=1e-4)
|
||||
|
||||
def test_unbiased(self):
|
||||
ekf = TestEKF(1e3, [0., 0.])
|
||||
dt = np.float64(1. / 100)
|
||||
|
||||
sensor = SimpleSensor(0, 1, 2)
|
||||
readings = map(sensor.read, np.arange(1000))
|
||||
|
||||
for reading in readings:
|
||||
ekf.update_scalar(reading)
|
||||
ekf.predict(dt)
|
||||
|
||||
np.testing.assert_allclose(ekf.state, [[1000.], [100.]], 1e-4)
|
||||
|
||||
|
||||
class FastEKF1DTest(unittest.TestCase):
|
||||
def test_correctness(self):
|
||||
dt = 1. / 100
|
||||
reading = SimpleSensor(0, 1, 2).read(100)
|
||||
|
||||
ekf = TestEKF(1e3, [0.1, 1])
|
||||
fast_ekf = FastEKF1D(dt, 1e3, [0.1, 1])
|
||||
|
||||
ekf.update_scalar(reading)
|
||||
fast_ekf.update_scalar(reading)
|
||||
self.assertAlmostEqual(ekf.state[0] , fast_ekf.state[0])
|
||||
self.assertAlmostEqual(ekf.state[1] , fast_ekf.state[1])
|
||||
self.assertAlmostEqual(ekf.covar[0, 0], fast_ekf.covar[0])
|
||||
self.assertAlmostEqual(ekf.covar[0, 1], fast_ekf.covar[2])
|
||||
self.assertAlmostEqual(ekf.covar[1, 1], fast_ekf.covar[1])
|
||||
|
||||
ekf.predict(dt)
|
||||
fast_ekf.predict(dt)
|
||||
self.assertAlmostEqual(ekf.state[0] , fast_ekf.state[0])
|
||||
self.assertAlmostEqual(ekf.state[1] , fast_ekf.state[1])
|
||||
self.assertAlmostEqual(ekf.covar[0, 0], fast_ekf.covar[0])
|
||||
self.assertAlmostEqual(ekf.covar[0, 1], fast_ekf.covar[2])
|
||||
self.assertAlmostEqual(ekf.covar[1, 1], fast_ekf.covar[1])
|
||||
|
||||
def test_speed(self):
|
||||
setup = """
|
||||
import numpy as np
|
||||
from common.kalman.tests.test_ekf import TestEKF
|
||||
from common.kalman.ekf import SimpleSensor, FastEKF1D
|
||||
|
||||
dt = 1. / 100
|
||||
reading = SimpleSensor(0, 1, 2).read(100)
|
||||
|
||||
var_init, Q = 1e3, [0.1, 1]
|
||||
ekf = TestEKF(var_init, Q)
|
||||
fast_ekf = FastEKF1D(dt, var_init, Q)
|
||||
"""
|
||||
|
||||
timeit.timeit("""
|
||||
ekf.update_scalar(reading)
|
||||
ekf.predict(dt)
|
||||
""", setup=setup, number=1000)
|
||||
|
||||
ekf_speed = timeit.timeit("""
|
||||
ekf.update_scalar(reading)
|
||||
ekf.predict(dt)
|
||||
""", setup=setup, number=20000)
|
||||
|
||||
timeit.timeit("""
|
||||
fast_ekf.update_scalar(reading)
|
||||
fast_ekf.predict(dt)
|
||||
""", setup=setup, number=1000)
|
||||
|
||||
fast_ekf_speed = timeit.timeit("""
|
||||
fast_ekf.update_scalar(reading)
|
||||
fast_ekf.predict(dt)
|
||||
""", setup=setup, number=20000)
|
||||
|
||||
assert fast_ekf_speed < ekf_speed / 4
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
85
common/kalman/tests/test_simple_kalman.py
Normal file
85
common/kalman/tests/test_simple_kalman.py
Normal file
@@ -0,0 +1,85 @@
|
||||
import unittest
|
||||
import random
|
||||
import timeit
|
||||
import numpy as np
|
||||
|
||||
from common.kalman.simple_kalman import KF1D
|
||||
from common.kalman.simple_kalman_old import KF1D as KF1D_old
|
||||
|
||||
|
||||
class TestSimpleKalman(unittest.TestCase):
|
||||
def setUp(self):
|
||||
dt = 0.01
|
||||
x0_0 = 0.0
|
||||
x1_0 = 0.0
|
||||
A0_0 = 1.0
|
||||
A0_1 = dt
|
||||
A1_0 = 0.0
|
||||
A1_1 = 1.0
|
||||
C0_0 = 1.0
|
||||
C0_1 = 0.0
|
||||
K0_0 = 0.12287673
|
||||
K1_0 = 0.29666309
|
||||
|
||||
self.kf_old = KF1D_old(x0=np.matrix([[x0_0], [x1_0]]),
|
||||
A=np.matrix([[A0_0, A0_1], [A1_0, A1_1]]),
|
||||
C=np.matrix([C0_0, C0_1]),
|
||||
K=np.matrix([[K0_0], [K1_0]]))
|
||||
|
||||
self.kf = KF1D(x0=[[x0_0], [x1_0]],
|
||||
A=[[A0_0, A0_1], [A1_0, A1_1]],
|
||||
C=[C0_0, C0_1],
|
||||
K=[[K0_0], [K1_0]])
|
||||
|
||||
def test_getter_setter(self):
|
||||
self.kf.x = [[1.0], [1.0]]
|
||||
self.assertEqual(self.kf.x, [[1.0], [1.0]])
|
||||
|
||||
def update_returns_state(self):
|
||||
x = self.kf.update(100)
|
||||
self.assertEqual(x, self.kf.x)
|
||||
|
||||
def test_old_equal_new(self):
|
||||
for _ in range(1000):
|
||||
v_wheel = random.uniform(0, 200)
|
||||
|
||||
x_old = self.kf_old.update(v_wheel)
|
||||
x = self.kf.update(v_wheel)
|
||||
|
||||
# Compare the output x, verify that the error is less than 1e-4
|
||||
self.assertAlmostEqual(x_old[0], x[0])
|
||||
self.assertAlmostEqual(x_old[1], x[1])
|
||||
|
||||
|
||||
def test_new_is_faster(self):
|
||||
setup = """
|
||||
import numpy as np
|
||||
|
||||
from common.kalman.simple_kalman import KF1D
|
||||
from common.kalman.simple_kalman_old import KF1D as KF1D_old
|
||||
|
||||
dt = 0.01
|
||||
x0_0 = 0.0
|
||||
x1_0 = 0.0
|
||||
A0_0 = 1.0
|
||||
A0_1 = dt
|
||||
A1_0 = 0.0
|
||||
A1_1 = 1.0
|
||||
C0_0 = 1.0
|
||||
C0_1 = 0.0
|
||||
K0_0 = 0.12287673
|
||||
K1_0 = 0.29666309
|
||||
|
||||
kf_old = KF1D_old(x0=np.matrix([[x0_0], [x1_0]]),
|
||||
A=np.matrix([[A0_0, A0_1], [A1_0, A1_1]]),
|
||||
C=np.matrix([C0_0, C0_1]),
|
||||
K=np.matrix([[K0_0], [K1_0]]))
|
||||
|
||||
kf = KF1D(x0=[[x0_0], [x1_0]],
|
||||
A=[[A0_0, A0_1], [A1_0, A1_1]],
|
||||
C=[C0_0, C0_1],
|
||||
K=[[K0_0], [K1_0]])
|
||||
"""
|
||||
kf_speed = timeit.timeit("kf.update(1234)", setup=setup, number=10000)
|
||||
kf_old_speed = timeit.timeit("kf_old.update(1234)", setup=setup, number=10000)
|
||||
self.assertTrue(kf_speed < kf_old_speed / 4)
|
||||
@@ -18,7 +18,7 @@ def json_robust_dumps(obj):
|
||||
|
||||
class NiceOrderedDict(OrderedDict):
|
||||
def __str__(self):
|
||||
return '{'+', '.join("%r: %r" % p for p in self.iteritems())+'}'
|
||||
return json_robust_dumps(self)
|
||||
|
||||
class SwagFormatter(logging.Formatter):
|
||||
def __init__(self, swaglogger):
|
||||
@@ -62,6 +62,10 @@ class SwagFormatter(logging.Formatter):
|
||||
def format(self, record):
|
||||
return json_robust_dumps(self.format_dict(record))
|
||||
|
||||
class SwagErrorFilter(logging.Filter):
|
||||
def filter(self, record):
|
||||
return record.levelno < logging.ERROR
|
||||
|
||||
_tmpfunc = lambda: 0
|
||||
_srcfile = os.path.normcase(_tmpfunc.__code__.co_filename)
|
||||
|
||||
@@ -74,7 +78,7 @@ class SwagLogger(logging.Logger):
|
||||
self.log_local = local()
|
||||
self.log_local.ctx = {}
|
||||
|
||||
def findCaller(self):
|
||||
def findCaller(self, stack_info=None):
|
||||
"""
|
||||
Find the stack frame of the caller so that we can note the source
|
||||
file name, line number and function name.
|
||||
@@ -128,15 +132,43 @@ class SwagLogger(logging.Logger):
|
||||
if args:
|
||||
evt['args'] = args
|
||||
evt.update(kwargs)
|
||||
self.info(evt)
|
||||
ctx = self.get_ctx()
|
||||
if ctx:
|
||||
evt['ctx'] = self.get_ctx()
|
||||
if 'error' in kwargs:
|
||||
self.error(evt)
|
||||
else:
|
||||
self.info(evt)
|
||||
|
||||
if __name__ == "__main__":
|
||||
log = SwagLogger()
|
||||
|
||||
stdout_handler = logging.StreamHandler(sys.stdout)
|
||||
stdout_handler.setLevel(logging.INFO)
|
||||
stdout_handler.addFilter(SwagErrorFilter())
|
||||
log.addHandler(stdout_handler)
|
||||
|
||||
stderr_handler = logging.StreamHandler(sys.stderr)
|
||||
stderr_handler.setLevel(logging.ERROR)
|
||||
log.addHandler(stderr_handler)
|
||||
|
||||
log.info("asdasd %s", "a")
|
||||
log.info({'wut': 1})
|
||||
log.warning("warning")
|
||||
log.error("error")
|
||||
log.critical("critical")
|
||||
log.event("test", x="y")
|
||||
|
||||
with log.ctx():
|
||||
stdout_handler.setFormatter(SwagFormatter(log))
|
||||
stderr_handler.setFormatter(SwagFormatter(log))
|
||||
log.bind(user="some user")
|
||||
log.info("in req")
|
||||
log.event("do_req")
|
||||
print("")
|
||||
log.warning("warning")
|
||||
print("")
|
||||
log.error("error")
|
||||
print("")
|
||||
log.critical("critical")
|
||||
print("")
|
||||
log.event("do_req", a=1, b="c")
|
||||
|
||||
@@ -1,25 +1,18 @@
|
||||
def int_rnd(x):
|
||||
return int(round(x))
|
||||
|
||||
def clip(x, lo, hi):
|
||||
return max(lo, min(hi, x))
|
||||
|
||||
|
||||
def interp(x, xp, fp):
|
||||
N = len(xp)
|
||||
if not hasattr(x, '__iter__'):
|
||||
def get_interp(xv):
|
||||
hi = 0
|
||||
while hi < N and x > xp[hi]:
|
||||
while hi < N and xv > xp[hi]:
|
||||
hi += 1
|
||||
low = hi - 1
|
||||
return fp[-1] if hi == N and x > xp[low] else (
|
||||
fp[0] if hi == 0 else
|
||||
(x - xp[low]) * (fp[hi] - fp[low]) / (xp[hi] - xp[low]) + fp[low])
|
||||
|
||||
result = []
|
||||
for v in x:
|
||||
hi = 0
|
||||
while hi < N and v > xp[hi]:
|
||||
hi += 1
|
||||
low = hi - 1
|
||||
result.append(fp[-1] if hi == N and v > xp[low] else (fp[
|
||||
0] if hi == 0 else (v - xp[low]) * (fp[hi] - fp[low]) / (xp[hi] - xp[low]
|
||||
) + fp[low]))
|
||||
return result
|
||||
return fp[-1] if hi == N and xv > xp[low] else (
|
||||
fp[0] if hi == 0 else
|
||||
(xv - xp[low]) * (fp[hi] - fp[low]) / (xp[hi] - xp[low]) + fp[low])
|
||||
return [get_interp(v) for v in x] if hasattr(
|
||||
x, '__iter__') else get_interp(x)
|
||||
|
||||
198
common/params.py
198
common/params.py
@@ -29,6 +29,7 @@ import fcntl
|
||||
import tempfile
|
||||
from enum import Enum
|
||||
|
||||
|
||||
def mkdirs_exists_ok(path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
@@ -36,35 +37,76 @@ def mkdirs_exists_ok(path):
|
||||
if not os.path.isdir(path):
|
||||
raise
|
||||
|
||||
|
||||
class TxType(Enum):
|
||||
PERSISTANT = 1
|
||||
PERSISTENT = 1
|
||||
CLEAR_ON_MANAGER_START = 2
|
||||
CLEAR_ON_CAR_START = 3
|
||||
CLEAR_ON_PANDA_DISCONNECT = 3
|
||||
|
||||
|
||||
class UnknownKeyName(Exception):
|
||||
pass
|
||||
|
||||
|
||||
keys = {
|
||||
# written: manager
|
||||
# read: loggerd, uploaderd, baseui
|
||||
"DongleId": TxType.PERSISTANT,
|
||||
"AccessToken": TxType.PERSISTANT,
|
||||
"Version": TxType.PERSISTANT,
|
||||
"GitCommit": TxType.PERSISTANT,
|
||||
"GitBranch": TxType.PERSISTANT,
|
||||
# written: baseui
|
||||
# read: ui, controls
|
||||
"IsMetric": TxType.PERSISTANT,
|
||||
"IsRearViewMirror": TxType.PERSISTANT,
|
||||
# written: visiond
|
||||
# read: visiond
|
||||
"CalibrationParams": TxType.PERSISTANT,
|
||||
# written: visiond
|
||||
# read: visiond, ui
|
||||
"CloudCalibration": TxType.PERSISTANT,
|
||||
# written: controlsd
|
||||
# read: radard
|
||||
"CarParams": TxType.CLEAR_ON_CAR_START}
|
||||
"AccessToken": [TxType.PERSISTENT],
|
||||
"AthenadPid": [TxType.PERSISTENT],
|
||||
"CalibrationParams": [TxType.PERSISTENT],
|
||||
"CarParams": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
|
||||
"CompletedTrainingVersion": [TxType.PERSISTENT],
|
||||
"ControlsParams": [TxType.PERSISTENT],
|
||||
"DoUninstall": [TxType.CLEAR_ON_MANAGER_START],
|
||||
"DongleId": [TxType.PERSISTENT],
|
||||
"GithubSshKeys": [TxType.PERSISTENT],
|
||||
"GitBranch": [TxType.PERSISTENT],
|
||||
"GitCommit": [TxType.PERSISTENT],
|
||||
"GitRemote": [TxType.PERSISTENT],
|
||||
"HasAcceptedTerms": [TxType.PERSISTENT],
|
||||
"IsDriverMonitoringEnabled": [TxType.PERSISTENT],
|
||||
"IsFcwEnabled": [TxType.PERSISTENT],
|
||||
"IsGeofenceEnabled": [TxType.PERSISTENT],
|
||||
"IsMetric": [TxType.PERSISTENT],
|
||||
"IsUpdateAvailable": [TxType.PERSISTENT],
|
||||
"IsUploadRawEnabled": [TxType.PERSISTENT],
|
||||
"IsUploadVideoOverCellularEnabled": [TxType.PERSISTENT],
|
||||
"LimitSetSpeed": [TxType.PERSISTENT],
|
||||
"LiveParameters": [TxType.PERSISTENT],
|
||||
"LongitudinalControl": [TxType.PERSISTENT],
|
||||
"Passive": [TxType.PERSISTENT],
|
||||
"RecordFront": [TxType.PERSISTENT],
|
||||
"ShouldDoUpdate": [TxType.CLEAR_ON_MANAGER_START],
|
||||
"SpeedLimitOffset": [TxType.PERSISTENT],
|
||||
"SubscriberInfo": [TxType.PERSISTENT],
|
||||
"TermsVersion": [TxType.PERSISTENT],
|
||||
"TrainingVersion": [TxType.PERSISTENT],
|
||||
"Version": [TxType.PERSISTENT],
|
||||
#dragonpilot config
|
||||
"DragonEnableDashcam": [TxType.PERSISTENT],
|
||||
"DragonDisableDriverSafetyCheck": [TxType.PERSISTENT], # deprecated
|
||||
"DragonEnableDriverSafetyCheck": [TxType.PERSISTENT],
|
||||
"DragonAutoShutdownAt": [TxType.PERSISTENT],
|
||||
"DragonTempDisableSteerOnSignal": [TxType.PERSISTENT], # deprecated
|
||||
"DragonEnableSteeringOnSignal": [TxType.PERSISTENT],
|
||||
"DragonDisableLogger": [TxType.PERSISTENT], # deprecated
|
||||
"DragonEnableLogger": [TxType.PERSISTENT],
|
||||
"DragonDisableUploader": [TxType.PERSISTENT], # deprecated
|
||||
"DragonEnableUploader": [TxType.PERSISTENT],
|
||||
"DragonNoctuaMode": [TxType.PERSISTENT],
|
||||
"DragonCacheCar": [TxType.PERSISTENT],
|
||||
"DragonCachedModel": [TxType.PERSISTENT],
|
||||
"DragonCachedFP": [TxType.PERSISTENT],
|
||||
"DragonCachedVIN": [TxType.PERSISTENT],
|
||||
"DragonAllowGas": [TxType.PERSISTENT],
|
||||
"DragonBBUI": [TxType.PERSISTENT],
|
||||
}
|
||||
|
||||
|
||||
def fsync_dir(path):
|
||||
fd = os.open(path, os.O_RDONLY)
|
||||
try:
|
||||
os.fsync(fd)
|
||||
finally:
|
||||
os.close(fd)
|
||||
|
||||
|
||||
class FileLock(object):
|
||||
@@ -182,20 +224,37 @@ class DBWriter(DBAccessor):
|
||||
self._check_entered()
|
||||
|
||||
try:
|
||||
# data_path refers to the externally used path to the params. It is a symlink.
|
||||
# old_data_path is the path currently pointed to by data_path.
|
||||
# tempdir_path is a path where the new params will go, which the new data path will point to.
|
||||
# new_data_path is a temporary symlink that will atomically overwrite data_path.
|
||||
#
|
||||
# The current situation is:
|
||||
# data_path -> old_data_path
|
||||
# We're going to write params data to tempdir_path
|
||||
# tempdir_path -> params data
|
||||
# Then point new_data_path to tempdir_path
|
||||
# new_data_path -> tempdir_path
|
||||
# Then atomically overwrite data_path with new_data_path
|
||||
# data_path -> tempdir_path
|
||||
old_data_path = None
|
||||
new_data_path = None
|
||||
tempdir_path = tempfile.mkdtemp(prefix=".tmp", dir=self._path)
|
||||
|
||||
try:
|
||||
# Write back all keys.
|
||||
os.chmod(tempdir_path, 0o777)
|
||||
for k, v in self._vals.items():
|
||||
with open(os.path.join(tempdir_path, k), "wb") as f:
|
||||
f.write(v)
|
||||
f.flush()
|
||||
os.fsync(f.fileno())
|
||||
fsync_dir(tempdir_path)
|
||||
|
||||
data_path = self._data_path()
|
||||
try:
|
||||
old_data_path = os.path.join(self._path, os.readlink(data_path))
|
||||
except (OSError, IOError) as e:
|
||||
except (OSError, IOError):
|
||||
# NOTE(mgraczyk): If other DB implementations have bugs, this could cause
|
||||
# copies to be left behind, but we still want to overwrite.
|
||||
pass
|
||||
@@ -203,16 +262,21 @@ class DBWriter(DBAccessor):
|
||||
new_data_path = "{}.link".format(tempdir_path)
|
||||
os.symlink(os.path.basename(tempdir_path), new_data_path)
|
||||
os.rename(new_data_path, data_path)
|
||||
# TODO(mgraczyk): raise useful error when values are bad.
|
||||
except:
|
||||
shutil.rmtree(tempdir_path)
|
||||
if new_data_path is not None:
|
||||
os.remove(new_data_path)
|
||||
raise
|
||||
fsync_dir(self._path)
|
||||
finally:
|
||||
# If the rename worked, we can delete the old data. Otherwise delete the new one.
|
||||
success = new_data_path is not None and os.path.exists(data_path) and (
|
||||
os.readlink(data_path) == os.path.basename(tempdir_path))
|
||||
|
||||
# Keep holding the lock while we clean up the old data.
|
||||
if old_data_path is not None:
|
||||
shutil.rmtree(old_data_path)
|
||||
if success:
|
||||
if old_data_path is not None:
|
||||
shutil.rmtree(old_data_path)
|
||||
else:
|
||||
shutil.rmtree(tempdir_path)
|
||||
|
||||
# Regardless of what happened above, there should be no link at new_data_path.
|
||||
if new_data_path is not None and os.path.islink(new_data_path):
|
||||
os.remove(new_data_path)
|
||||
finally:
|
||||
os.umask(self._prev_umask)
|
||||
self._prev_umask = None
|
||||
@@ -222,40 +286,70 @@ class DBWriter(DBAccessor):
|
||||
self._lock = None
|
||||
|
||||
|
||||
def read_db(params_path, key):
|
||||
path = "%s/d/%s" % (params_path, key)
|
||||
try:
|
||||
with open(path, "rb") as f:
|
||||
return f.read()
|
||||
except IOError:
|
||||
return None
|
||||
|
||||
class JSDB(object):
|
||||
def __init__(self, fn):
|
||||
self._fn = fn
|
||||
def write_db(params_path, key, value):
|
||||
prev_umask = os.umask(0)
|
||||
lock = FileLock(params_path+"/.lock", True)
|
||||
lock.acquire()
|
||||
|
||||
def begin(self, write=False):
|
||||
if write:
|
||||
return DBWriter(self._fn)
|
||||
else:
|
||||
return DBReader(self._fn)
|
||||
try:
|
||||
tmp_path = tempfile.mktemp(prefix=".tmp", dir=params_path)
|
||||
with open(tmp_path, "wb") as f:
|
||||
f.write(value)
|
||||
f.flush()
|
||||
os.fsync(f.fileno())
|
||||
|
||||
path = "%s/d/%s" % (params_path, key)
|
||||
os.rename(tmp_path, path)
|
||||
fsync_dir(os.path.dirname(path))
|
||||
finally:
|
||||
os.umask(prev_umask)
|
||||
lock.release()
|
||||
|
||||
class Params(object):
|
||||
def __init__(self, db='/data/params'):
|
||||
self.env = JSDB(db)
|
||||
self.db = db
|
||||
|
||||
# create the database if it doesn't exist...
|
||||
if not os.path.exists(self.db+"/d"):
|
||||
with self.transaction(write=True):
|
||||
pass
|
||||
|
||||
def transaction(self, write=False):
|
||||
if write:
|
||||
return DBWriter(self.db)
|
||||
else:
|
||||
return DBReader(self.db)
|
||||
|
||||
def _clear_keys_with_type(self, tx_type):
|
||||
with self.env.begin(write=True) as txn:
|
||||
with self.transaction(write=True) as txn:
|
||||
for key in keys:
|
||||
if keys[key] == tx_type:
|
||||
if tx_type in keys[key]:
|
||||
txn.delete(key)
|
||||
|
||||
def manager_start(self):
|
||||
self._clear_keys_with_type(TxType.CLEAR_ON_MANAGER_START)
|
||||
|
||||
def car_start(self):
|
||||
self._clear_keys_with_type(TxType.CLEAR_ON_CAR_START)
|
||||
def panda_disconnect(self):
|
||||
self._clear_keys_with_type(TxType.CLEAR_ON_PANDA_DISCONNECT)
|
||||
|
||||
def delete(self, key):
|
||||
with self.transaction(write=True) as txn:
|
||||
txn.delete(key)
|
||||
|
||||
def get(self, key, block=False):
|
||||
if key not in keys:
|
||||
raise UnknownKeyName(key)
|
||||
|
||||
while 1:
|
||||
with self.env.begin() as txn:
|
||||
ret = txn.get(key)
|
||||
ret = read_db(self.db, key)
|
||||
if not block or ret is not None:
|
||||
break
|
||||
# is polling really the best we can do?
|
||||
@@ -266,9 +360,7 @@ class Params(object):
|
||||
if key not in keys:
|
||||
raise UnknownKeyName(key)
|
||||
|
||||
with self.env.begin(write=True) as txn:
|
||||
txn.put(key, dat)
|
||||
print "set", key
|
||||
write_db(self.db, key, dat)
|
||||
|
||||
if __name__ == "__main__":
|
||||
params = Params()
|
||||
@@ -278,11 +370,11 @@ if __name__ == "__main__":
|
||||
for k in keys:
|
||||
pp = params.get(k)
|
||||
if pp is None:
|
||||
print k, "is None"
|
||||
print("%s is None" % k)
|
||||
elif all(ord(c) < 128 and ord(c) >= 32 for c in pp):
|
||||
print k, pp
|
||||
print("%s = %s" % (k, pp))
|
||||
else:
|
||||
print k, pp.encode("hex")
|
||||
print("%s = %s" % (k, pp.encode("hex")))
|
||||
|
||||
# Test multiprocess:
|
||||
# seq 0 100000 | xargs -P20 -I{} python common/params.py DongleId {} && sleep 0.05
|
||||
|
||||
@@ -1,26 +1,46 @@
|
||||
from common.realtime import sec_since_boot
|
||||
import time
|
||||
|
||||
class Profiler(object):
|
||||
def __init__(self, enabled=False):
|
||||
self.enabled = enabled
|
||||
self.cp = []
|
||||
self.start_time = sec_since_boot()
|
||||
self.cp = {}
|
||||
self.cp_ignored = []
|
||||
self.iter = 0
|
||||
self.start_time = time.time()
|
||||
self.last_time = self.start_time
|
||||
self.tot = 0.
|
||||
|
||||
def reset(self, enabled=False):
|
||||
self.enabled = enabled
|
||||
self.cp = {}
|
||||
self.cp_ignored = []
|
||||
self.iter = 0
|
||||
self.start_time = time.time()
|
||||
self.last_time = self.start_time
|
||||
|
||||
def checkpoint(self, name):
|
||||
def checkpoint(self, name, ignore=False):
|
||||
# ignore flag needed when benchmarking threads with ratekeeper
|
||||
if not self.enabled:
|
||||
return
|
||||
tt = sec_since_boot()
|
||||
self.cp.append((name, tt - self.last_time))
|
||||
tt = time.time()
|
||||
if name not in self.cp:
|
||||
self.cp[name] = 0.
|
||||
if ignore:
|
||||
self.cp_ignored.append(name)
|
||||
self.cp[name] += tt - self.last_time
|
||||
if not ignore:
|
||||
self.tot += tt - self.last_time
|
||||
self.last_time = tt
|
||||
|
||||
def display(self):
|
||||
if not self.enabled:
|
||||
return
|
||||
print "******* Profiling *******"
|
||||
tot = 0.0
|
||||
for n, ms in self.cp:
|
||||
print "%30s: %7.2f" % (n, ms*1000.0)
|
||||
tot += ms
|
||||
print " TOTAL: %7.2f" % (tot*1000.0)
|
||||
self.iter += 1
|
||||
print("******* Profiling *******")
|
||||
for n, ms in sorted(self.cp.items(), key=lambda x: -x[1]):
|
||||
if n in self.cp_ignored:
|
||||
print("%30s: %7.2f percent: %3.0f IGNORED" % (n, ms*1000.0, ms/self.tot*100))
|
||||
else:
|
||||
print("%30s: %7.2f percent: %3.0f" % (n, ms*1000.0, ms/self.tot*100))
|
||||
print("Iter clock: %2.6f TOTAL: %2.2f" % (self.tot/self.iter, self.tot))
|
||||
|
||||
|
||||
@@ -1,60 +1,32 @@
|
||||
"""Utilities for reading real time clocks and keeping soft real time constraints."""
|
||||
import os
|
||||
import time
|
||||
import ctypes
|
||||
import platform
|
||||
import threading
|
||||
import subprocess
|
||||
import multiprocessing
|
||||
|
||||
from cffi import FFI
|
||||
|
||||
# Build and load cython module
|
||||
import pyximport
|
||||
installer = pyximport.install(inplace=True, build_dir='/tmp')
|
||||
from common.clock import monotonic_time, sec_since_boot # pylint: disable=no-name-in-module, import-error
|
||||
pyximport.uninstall(*installer)
|
||||
assert monotonic_time
|
||||
assert sec_since_boot
|
||||
|
||||
|
||||
# time step for each process
|
||||
DT_CTRL = 0.01 # controlsd
|
||||
DT_PLAN = 0.05 # mpc
|
||||
DT_MDL = 0.05 # model
|
||||
DT_DMON = 0.1 # driver monitoring
|
||||
|
||||
|
||||
ffi = FFI()
|
||||
ffi.cdef("""
|
||||
|
||||
typedef int clockid_t;
|
||||
struct timespec {
|
||||
long tv_sec; /* Seconds. */
|
||||
long tv_nsec; /* Nanoseconds. */
|
||||
};
|
||||
int clock_gettime (clockid_t clk_id, struct timespec *tp);
|
||||
|
||||
long syscall(long number, ...);
|
||||
|
||||
"""
|
||||
)
|
||||
ffi.cdef("long syscall(long number, ...);")
|
||||
libc = ffi.dlopen(None)
|
||||
|
||||
|
||||
# see <linux/time.h>
|
||||
CLOCK_MONOTONIC_RAW = 4
|
||||
CLOCK_BOOTTIME = 7
|
||||
|
||||
if platform.system() != 'Darwin' and hasattr(libc, 'clock_gettime'):
|
||||
c_clock_gettime = libc.clock_gettime
|
||||
|
||||
tlocal = threading.local()
|
||||
def clock_gettime(clk_id):
|
||||
if not hasattr(tlocal, 'ts'):
|
||||
tlocal.ts = ffi.new('struct timespec *')
|
||||
|
||||
ts = tlocal.ts
|
||||
|
||||
r = c_clock_gettime(clk_id, ts)
|
||||
if r != 0:
|
||||
raise OSError("clock_gettime")
|
||||
return ts.tv_sec + ts.tv_nsec * 1e-9
|
||||
else:
|
||||
# hack. only for OS X < 10.12
|
||||
def clock_gettime(clk_id):
|
||||
return time.time()
|
||||
|
||||
def monotonic_time():
|
||||
return clock_gettime(CLOCK_MONOTONIC_RAW)
|
||||
|
||||
def sec_since_boot():
|
||||
return clock_gettime(CLOCK_BOOTTIME)
|
||||
|
||||
|
||||
def set_realtime_priority(level):
|
||||
if os.getuid() != 0:
|
||||
print("not setting priority, not root")
|
||||
@@ -100,12 +72,9 @@ class Ratekeeper(object):
|
||||
lagged = False
|
||||
remaining = self._next_frame_time - sec_since_boot()
|
||||
self._next_frame_time += self._interval
|
||||
if remaining < -self._print_delay_threshold:
|
||||
if self._print_delay_threshold is not None and remaining < -self._print_delay_threshold:
|
||||
print("%s lagging by %.2f ms" % (self._process_name, -remaining * 1000))
|
||||
lagged = True
|
||||
self._frame += 1
|
||||
self._remaining = remaining
|
||||
return lagged
|
||||
|
||||
if __name__ == "__main__":
|
||||
print sec_since_boot()
|
||||
|
||||
81
common/sympy_helpers.py
Normal file
81
common/sympy_helpers.py
Normal file
@@ -0,0 +1,81 @@
|
||||
#!/usr/bin/env python
|
||||
import sympy as sp
|
||||
import numpy as np
|
||||
|
||||
def cross(x):
|
||||
ret = sp.Matrix(np.zeros((3,3)))
|
||||
ret[0,1], ret[0,2] = -x[2], x[1]
|
||||
ret[1,0], ret[1,2] = x[2], -x[0]
|
||||
ret[2,0], ret[2,1] = -x[1], x[0]
|
||||
return ret
|
||||
|
||||
def euler_rotate(roll, pitch, yaw):
|
||||
# make symbolic rotation matrix from eulers
|
||||
matrix_roll = sp.Matrix([[1, 0, 0],
|
||||
[0, sp.cos(roll), -sp.sin(roll)],
|
||||
[0, sp.sin(roll), sp.cos(roll)]])
|
||||
matrix_pitch = sp.Matrix([[sp.cos(pitch), 0, sp.sin(pitch)],
|
||||
[0, 1, 0],
|
||||
[-sp.sin(pitch), 0, sp.cos(pitch)]])
|
||||
matrix_yaw = sp.Matrix([[sp.cos(yaw), -sp.sin(yaw), 0],
|
||||
[sp.sin(yaw), sp.cos(yaw), 0],
|
||||
[0, 0, 1]])
|
||||
return matrix_yaw*matrix_pitch*matrix_roll
|
||||
|
||||
def quat_rotate(q0, q1, q2, q3):
|
||||
# make symbolic rotation matrix from quat
|
||||
return sp.Matrix([[q0**2 + q1**2 - q2**2 - q3**2, 2*(q1*q2 + q0*q3), 2*(q1*q3 - q0*q2)],
|
||||
[2*(q1*q2 - q0*q3), q0**2 - q1**2 + q2**2 - q3**2, 2*(q2*q3 + q0*q1)],
|
||||
[2*(q1*q3 + q0*q2), 2*(q2*q3 - q0*q1), q0**2 - q1**2 - q2**2 + q3**2]]).T
|
||||
|
||||
def quat_matrix_l(p):
|
||||
return sp.Matrix([[p[0], -p[1], -p[2], -p[3]],
|
||||
[p[1], p[0], -p[3], p[2]],
|
||||
[p[2], p[3], p[0], -p[1]],
|
||||
[p[3], -p[2], p[1], p[0]]])
|
||||
|
||||
def quat_matrix_r(p):
|
||||
return sp.Matrix([[p[0], -p[1], -p[2], -p[3]],
|
||||
[p[1], p[0], p[3], -p[2]],
|
||||
[p[2], -p[3], p[0], p[1]],
|
||||
[p[3], p[2], -p[1], p[0]]])
|
||||
|
||||
|
||||
def sympy_into_c(sympy_functions):
|
||||
from sympy.utilities import codegen
|
||||
routines = []
|
||||
for name, expr, args in sympy_functions:
|
||||
r = codegen.make_routine(name, expr, language="C99")
|
||||
|
||||
# argument ordering input to sympy is broken with function with output arguments
|
||||
nargs = []
|
||||
# reorder the input arguments
|
||||
for aa in args:
|
||||
if aa is None:
|
||||
nargs.append(codegen.InputArgument(sp.Symbol('unused'), dimensions=[1,1]))
|
||||
continue
|
||||
found = False
|
||||
for a in r.arguments:
|
||||
if str(aa.name) == str(a.name):
|
||||
nargs.append(a)
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
# [1,1] is a hack for Matrices
|
||||
nargs.append(codegen.InputArgument(aa, dimensions=[1,1]))
|
||||
# add the output arguments
|
||||
for a in r.arguments:
|
||||
if type(a) == codegen.OutputArgument:
|
||||
nargs.append(a)
|
||||
|
||||
#assert len(r.arguments) == len(args)+1
|
||||
r.arguments = nargs
|
||||
|
||||
# add routine to list
|
||||
routines.append(r)
|
||||
|
||||
[(c_name, c_code), (h_name, c_header)] = codegen.get_code_generator('C', 'ekf', 'C99').write(routines, "ekf")
|
||||
c_code = '\n'.join(x for x in c_code.split("\n") if len(x) > 0 and x[0] != '#')
|
||||
c_header = '\n'.join(x for x in c_header.split("\n") if len(x) > 0 and x[0] != '#')
|
||||
|
||||
return c_header, c_code
|
||||
28
common/timeout.py
Normal file
28
common/timeout.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import signal
|
||||
|
||||
class TimeoutException(Exception):
|
||||
pass
|
||||
|
||||
class Timeout:
|
||||
"""
|
||||
Timeout context manager.
|
||||
For example this code will raise a TimeoutException:
|
||||
with Timeout(seconds=5, error_msg="Sleep was too long"):
|
||||
time.sleep(10)
|
||||
"""
|
||||
def __init__(self, seconds, error_msg=None):
|
||||
if error_msg is None:
|
||||
error_msg = 'Timed out after {} seconds'.format(seconds)
|
||||
self.seconds = seconds
|
||||
self.error_msg = error_msg
|
||||
|
||||
def handle_timeout(self, signume, frame):
|
||||
raise TimeoutException(self.error_msg)
|
||||
|
||||
def __enter__(self):
|
||||
signal.signal(signal.SIGALRM, self.handle_timeout)
|
||||
signal.alarm(self.seconds)
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
||||
signal.alarm(0)
|
||||
|
||||
216
common/transformations/camera.py
Normal file
216
common/transformations/camera.py
Normal file
@@ -0,0 +1,216 @@
|
||||
import numpy as np
|
||||
import common.transformations.orientation as orient
|
||||
import math
|
||||
|
||||
FULL_FRAME_SIZE = (1164, 874)
|
||||
W, H = FULL_FRAME_SIZE[0], FULL_FRAME_SIZE[1]
|
||||
eon_focal_length = FOCAL = 910.0
|
||||
|
||||
# aka 'K' aka camera_frame_from_view_frame
|
||||
eon_intrinsics = np.array([
|
||||
[FOCAL, 0., W/2.],
|
||||
[ 0., FOCAL, H/2.],
|
||||
[ 0., 0., 1.]])
|
||||
|
||||
|
||||
leon_dcam_intrinsics = np.array([
|
||||
[650, 0, 816//2],
|
||||
[ 0, 650, 612//2],
|
||||
[ 0, 0, 1]])
|
||||
|
||||
eon_dcam_intrinsics = np.array([
|
||||
[860, 0, 1152//2],
|
||||
[ 0, 860, 864//2],
|
||||
[ 0, 0, 1]])
|
||||
|
||||
# aka 'K_inv' aka view_frame_from_camera_frame
|
||||
eon_intrinsics_inv = np.linalg.inv(eon_intrinsics)
|
||||
|
||||
|
||||
# device/mesh : x->forward, y-> right, z->down
|
||||
# view : x->right, y->down, z->forward
|
||||
device_frame_from_view_frame = np.array([
|
||||
[ 0., 0., 1.],
|
||||
[ 1., 0., 0.],
|
||||
[ 0., 1., 0.]
|
||||
])
|
||||
view_frame_from_device_frame = device_frame_from_view_frame.T
|
||||
|
||||
|
||||
def get_calib_from_vp(vp):
|
||||
vp_norm = normalize(vp)
|
||||
yaw_calib = np.arctan(vp_norm[0])
|
||||
pitch_calib = -np.arctan(vp_norm[1]*np.cos(yaw_calib))
|
||||
roll_calib = 0
|
||||
return roll_calib, pitch_calib, yaw_calib
|
||||
|
||||
# aka 'extrinsic_matrix'
|
||||
# road : x->forward, y -> left, z->up
|
||||
def get_view_frame_from_road_frame(roll, pitch, yaw, height):
|
||||
device_from_road = orient.rot_from_euler([roll, pitch, yaw]).dot(np.diag([1, -1, -1]))
|
||||
view_from_road = view_frame_from_device_frame.dot(device_from_road)
|
||||
return np.hstack((view_from_road, [[0], [height], [0]]))
|
||||
|
||||
|
||||
def vp_from_ke(m):
|
||||
"""
|
||||
Computes the vanishing point from the product of the intrinsic and extrinsic
|
||||
matrices C = KE.
|
||||
|
||||
The vanishing point is defined as lim x->infinity C (x, 0, 0, 1).T
|
||||
"""
|
||||
return (m[0, 0]/m[2,0], m[1,0]/m[2,0])
|
||||
|
||||
def roll_from_ke(m):
|
||||
# note: different from calibration.h/RollAnglefromKE: i think that one's just wrong
|
||||
return np.arctan2(-(m[1, 0] - m[1, 1] * m[2, 0] / m[2, 1]),
|
||||
-(m[0, 0] - m[0, 1] * m[2, 0] / m[2, 1]))
|
||||
|
||||
|
||||
def normalize(img_pts, intrinsics=eon_intrinsics):
|
||||
# normalizes image coordinates
|
||||
# accepts single pt or array of pts
|
||||
intrinsics_inv = np.linalg.inv(intrinsics)
|
||||
img_pts = np.array(img_pts)
|
||||
input_shape = img_pts.shape
|
||||
img_pts = np.atleast_2d(img_pts)
|
||||
img_pts = np.hstack((img_pts, np.ones((img_pts.shape[0],1))))
|
||||
img_pts_normalized = img_pts.dot(intrinsics_inv.T)
|
||||
img_pts_normalized[(img_pts < 0).any(axis=1)] = np.nan
|
||||
return img_pts_normalized[:,:2].reshape(input_shape)
|
||||
|
||||
|
||||
def denormalize(img_pts, intrinsics=eon_intrinsics):
|
||||
# denormalizes image coordinates
|
||||
# accepts single pt or array of pts
|
||||
img_pts = np.array(img_pts)
|
||||
input_shape = img_pts.shape
|
||||
img_pts = np.atleast_2d(img_pts)
|
||||
img_pts = np.hstack((img_pts, np.ones((img_pts.shape[0],1))))
|
||||
img_pts_denormalized = img_pts.dot(intrinsics.T)
|
||||
img_pts_denormalized[img_pts_denormalized[:,0] > W] = np.nan
|
||||
img_pts_denormalized[img_pts_denormalized[:,0] < 0] = np.nan
|
||||
img_pts_denormalized[img_pts_denormalized[:,1] > H] = np.nan
|
||||
img_pts_denormalized[img_pts_denormalized[:,1] < 0] = np.nan
|
||||
return img_pts_denormalized[:,:2].reshape(input_shape)
|
||||
|
||||
|
||||
def device_from_ecef(pos_ecef, orientation_ecef, pt_ecef):
|
||||
# device from ecef frame
|
||||
# device frame is x -> forward, y-> right, z -> down
|
||||
# accepts single pt or array of pts
|
||||
input_shape = pt_ecef.shape
|
||||
pt_ecef = np.atleast_2d(pt_ecef)
|
||||
ecef_from_device_rot = orient.rotations_from_quats(orientation_ecef)
|
||||
device_from_ecef_rot = ecef_from_device_rot.T
|
||||
pt_ecef_rel = pt_ecef - pos_ecef
|
||||
pt_device = np.einsum('jk,ik->ij', device_from_ecef_rot, pt_ecef_rel)
|
||||
return pt_device.reshape(input_shape)
|
||||
|
||||
|
||||
def img_from_device(pt_device):
|
||||
# img coordinates from pts in device frame
|
||||
# first transforms to view frame, then to img coords
|
||||
# accepts single pt or array of pts
|
||||
input_shape = pt_device.shape
|
||||
pt_device = np.atleast_2d(pt_device)
|
||||
pt_view = np.einsum('jk,ik->ij', view_frame_from_device_frame, pt_device)
|
||||
|
||||
# This function should never return negative depths
|
||||
pt_view[pt_view[:,2] < 0] = np.nan
|
||||
|
||||
pt_img = pt_view/pt_view[:,2:3]
|
||||
return pt_img.reshape(input_shape)[:,:2]
|
||||
|
||||
|
||||
#TODO please use generic img transform below
|
||||
def rotate_img(img, eulers, crop=None, intrinsics=eon_intrinsics):
|
||||
import cv2
|
||||
|
||||
size = img.shape[:2]
|
||||
rot = orient.rot_from_euler(eulers)
|
||||
quadrangle = np.array([[0, 0],
|
||||
[size[1]-1, 0],
|
||||
[0, size[0]-1],
|
||||
[size[1]-1, size[0]-1]], dtype=np.float32)
|
||||
quadrangle_norm = np.hstack((normalize(quadrangle, intrinsics=intrinsics), np.ones((4,1))))
|
||||
warped_quadrangle_full = np.einsum('ij, kj->ki', intrinsics.dot(rot), quadrangle_norm)
|
||||
warped_quadrangle = np.column_stack((warped_quadrangle_full[:,0]/warped_quadrangle_full[:,2],
|
||||
warped_quadrangle_full[:,1]/warped_quadrangle_full[:,2])).astype(np.float32)
|
||||
if crop:
|
||||
W_border = (size[1] - crop[0])/2
|
||||
H_border = (size[0] - crop[1])/2
|
||||
outside_crop = (((warped_quadrangle[:,0] < W_border) |
|
||||
(warped_quadrangle[:,0] >= size[1] - W_border)) &
|
||||
((warped_quadrangle[:,1] < H_border) |
|
||||
(warped_quadrangle[:,1] >= size[0] - H_border)))
|
||||
if not outside_crop.all():
|
||||
raise ValueError("warped image not contained inside crop")
|
||||
else:
|
||||
H_border, W_border = 0, 0
|
||||
M = cv2.getPerspectiveTransform(quadrangle, warped_quadrangle)
|
||||
img_warped = cv2.warpPerspective(img, M, size[::-1])
|
||||
return img_warped[H_border: size[0] - H_border,
|
||||
W_border: size[1] - W_border]
|
||||
|
||||
|
||||
def transform_img(base_img,
|
||||
augment_trans=np.array([0,0,0]),
|
||||
augment_eulers=np.array([0,0,0]),
|
||||
from_intr=eon_intrinsics,
|
||||
to_intr=eon_intrinsics,
|
||||
calib_rot_view=None,
|
||||
output_size=None,
|
||||
pretransform=None,
|
||||
top_hacks=True):
|
||||
import cv2
|
||||
|
||||
size = base_img.shape[:2]
|
||||
if not output_size:
|
||||
output_size = size[::-1]
|
||||
|
||||
cy = from_intr[1,2]
|
||||
def get_M(h=1.22):
|
||||
quadrangle = np.array([[0, cy + 20],
|
||||
[size[1]-1, cy + 20],
|
||||
[0, size[0]-1],
|
||||
[size[1]-1, size[0]-1]], dtype=np.float32)
|
||||
quadrangle_norm = np.hstack((normalize(quadrangle, intrinsics=from_intr), np.ones((4,1))))
|
||||
quadrangle_world = np.column_stack((h*quadrangle_norm[:,0]/quadrangle_norm[:,1],
|
||||
h*np.ones(4),
|
||||
h/quadrangle_norm[:,1]))
|
||||
rot = orient.rot_from_euler(augment_eulers)
|
||||
if calib_rot_view is not None:
|
||||
rot = calib_rot_view.dot(rot)
|
||||
to_extrinsics = np.hstack((rot.T, -augment_trans[:,None]))
|
||||
to_KE = to_intr.dot(to_extrinsics)
|
||||
warped_quadrangle_full = np.einsum('jk,ik->ij', to_KE, np.hstack((quadrangle_world, np.ones((4,1)))))
|
||||
warped_quadrangle = np.column_stack((warped_quadrangle_full[:,0]/warped_quadrangle_full[:,2],
|
||||
warped_quadrangle_full[:,1]/warped_quadrangle_full[:,2])).astype(np.float32)
|
||||
M = cv2.getPerspectiveTransform(quadrangle, warped_quadrangle.astype(np.float32))
|
||||
return M
|
||||
|
||||
M = get_M()
|
||||
if pretransform is not None:
|
||||
M = M.dot(pretransform)
|
||||
augmented_rgb = cv2.warpPerspective(base_img, M, output_size, borderMode=cv2.BORDER_REPLICATE)
|
||||
|
||||
if top_hacks:
|
||||
cyy = int(math.ceil(to_intr[1,2]))
|
||||
M = get_M(1000)
|
||||
if pretransform is not None:
|
||||
M = M.dot(pretransform)
|
||||
augmented_rgb[:cyy] = cv2.warpPerspective(base_img, M, (output_size[0], cyy), borderMode=cv2.BORDER_REPLICATE)
|
||||
|
||||
return augmented_rgb
|
||||
|
||||
def yuv_crop(frame, output_size, center=None):
|
||||
# output_size in camera coordinates so u,v
|
||||
# center in array coordinates so row, column
|
||||
import cv2
|
||||
rgb = cv2.cvtColor(frame, cv2.COLOR_YUV2RGB_I420)
|
||||
if not center:
|
||||
center = (rgb.shape[0]/2, rgb.shape[1]/2)
|
||||
rgb_crop = rgb[center[0] - output_size[1]/2: center[0] + output_size[1]/2,
|
||||
center[1] - output_size[0]/2: center[1] + output_size[0]/2]
|
||||
return cv2.cvtColor(rgb_crop, cv2.COLOR_RGB2YUV_I420)
|
||||
108
common/transformations/coordinates.py
Normal file
108
common/transformations/coordinates.py
Normal file
@@ -0,0 +1,108 @@
|
||||
import numpy as np
|
||||
"""
|
||||
Coordinate transformation module. All methods accept arrays as input
|
||||
with each row as a position.
|
||||
"""
|
||||
|
||||
|
||||
|
||||
a = 6378137
|
||||
b = 6356752.3142
|
||||
esq = 6.69437999014 * 0.001
|
||||
e1sq = 6.73949674228 * 0.001
|
||||
|
||||
|
||||
def geodetic2ecef(geodetic, radians=False):
|
||||
geodetic = np.array(geodetic)
|
||||
input_shape = geodetic.shape
|
||||
geodetic = np.atleast_2d(geodetic)
|
||||
|
||||
ratio = 1.0 if radians else (np.pi / 180.0)
|
||||
lat = ratio*geodetic[:,0]
|
||||
lon = ratio*geodetic[:,1]
|
||||
alt = geodetic[:,2]
|
||||
|
||||
xi = np.sqrt(1 - esq * np.sin(lat)**2)
|
||||
x = (a / xi + alt) * np.cos(lat) * np.cos(lon)
|
||||
y = (a / xi + alt) * np.cos(lat) * np.sin(lon)
|
||||
z = (a / xi * (1 - esq) + alt) * np.sin(lat)
|
||||
ecef = np.array([x, y, z]).T
|
||||
return ecef.reshape(input_shape)
|
||||
|
||||
|
||||
def ecef2geodetic(ecef, radians=False):
|
||||
"""
|
||||
Convert ECEF coordinates to geodetic using ferrari's method
|
||||
"""
|
||||
# Save shape and export column
|
||||
ecef = np.atleast_1d(ecef)
|
||||
input_shape = ecef.shape
|
||||
ecef = np.atleast_2d(ecef)
|
||||
x, y, z = ecef[:, 0], ecef[:, 1], ecef[:, 2]
|
||||
|
||||
ratio = 1.0 if radians else (180.0 / np.pi)
|
||||
|
||||
# Conver from ECEF to geodetic using Ferrari's methods
|
||||
# https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#Ferrari.27s_solution
|
||||
r = np.sqrt(x * x + y * y)
|
||||
Esq = a * a - b * b
|
||||
F = 54 * b * b * z * z
|
||||
G = r * r + (1 - esq) * z * z - esq * Esq
|
||||
C = (esq * esq * F * r * r) / (pow(G, 3))
|
||||
S = np.cbrt(1 + C + np.sqrt(C * C + 2 * C))
|
||||
P = F / (3 * pow((S + 1 / S + 1), 2) * G * G)
|
||||
Q = np.sqrt(1 + 2 * esq * esq * P)
|
||||
r_0 = -(P * esq * r) / (1 + Q) + np.sqrt(0.5 * a * a*(1 + 1.0 / Q) - \
|
||||
P * (1 - esq) * z * z / (Q * (1 + Q)) - 0.5 * P * r * r)
|
||||
U = np.sqrt(pow((r - esq * r_0), 2) + z * z)
|
||||
V = np.sqrt(pow((r - esq * r_0), 2) + (1 - esq) * z * z)
|
||||
Z_0 = b * b * z / (a * V)
|
||||
h = U * (1 - b * b / (a * V))
|
||||
lat = ratio*np.arctan((z + e1sq * Z_0) / r)
|
||||
lon = ratio*np.arctan2(y, x)
|
||||
|
||||
# stack the new columns and return to the original shape
|
||||
geodetic = np.column_stack((lat, lon, h))
|
||||
return geodetic.reshape(input_shape)
|
||||
|
||||
class LocalCoord(object):
|
||||
"""
|
||||
Allows conversions to local frames. In this case NED.
|
||||
That is: North East Down from the start position in
|
||||
meters.
|
||||
"""
|
||||
def __init__(self, init_geodetic, init_ecef):
|
||||
self.init_ecef = init_ecef
|
||||
lat, lon, _ = (np.pi/180)*np.array(init_geodetic)
|
||||
self.ned2ecef_matrix = np.array([[-np.sin(lat)*np.cos(lon), -np.sin(lon), -np.cos(lat)*np.cos(lon)],
|
||||
[-np.sin(lat)*np.sin(lon), np.cos(lon), -np.cos(lat)*np.sin(lon)],
|
||||
[np.cos(lat), 0, -np.sin(lat)]])
|
||||
self.ecef2ned_matrix = self.ned2ecef_matrix.T
|
||||
|
||||
@classmethod
|
||||
def from_geodetic(cls, init_geodetic):
|
||||
init_ecef = geodetic2ecef(init_geodetic)
|
||||
return LocalCoord(init_geodetic, init_ecef)
|
||||
|
||||
@classmethod
|
||||
def from_ecef(cls, init_ecef):
|
||||
init_geodetic = ecef2geodetic(init_ecef)
|
||||
return LocalCoord(init_geodetic, init_ecef)
|
||||
|
||||
|
||||
def ecef2ned(self, ecef):
|
||||
ecef = np.array(ecef)
|
||||
return np.dot(self.ecef2ned_matrix, (ecef - self.init_ecef).T).T
|
||||
|
||||
def ned2ecef(self, ned):
|
||||
ned = np.array(ned)
|
||||
# Transpose so that init_ecef will broadcast correctly for 1d or 2d ned.
|
||||
return (np.dot(self.ned2ecef_matrix, ned.T).T + self.init_ecef)
|
||||
|
||||
def geodetic2ned(self, geodetic):
|
||||
ecef = geodetic2ecef(geodetic)
|
||||
return self.ecef2ned(ecef)
|
||||
|
||||
def ned2geodetic(self, ned):
|
||||
ecef = self.ned2ecef(ned)
|
||||
return ecef2geodetic(ecef)
|
||||
150
common/transformations/model.py
Normal file
150
common/transformations/model.py
Normal file
@@ -0,0 +1,150 @@
|
||||
import numpy as np
|
||||
|
||||
from common.transformations.camera import eon_focal_length, \
|
||||
vp_from_ke, get_view_frame_from_road_frame, \
|
||||
FULL_FRAME_SIZE
|
||||
|
||||
# segnet
|
||||
|
||||
SEGNET_SIZE = (512, 384)
|
||||
|
||||
segnet_frame_from_camera_frame = np.array([
|
||||
[float(SEGNET_SIZE[0])/FULL_FRAME_SIZE[0], 0., ],
|
||||
[ 0., float(SEGNET_SIZE[1])/FULL_FRAME_SIZE[1]]])
|
||||
|
||||
|
||||
# model
|
||||
|
||||
MODEL_INPUT_SIZE = (320, 160)
|
||||
MODEL_YUV_SIZE = (MODEL_INPUT_SIZE[0], MODEL_INPUT_SIZE[1] * 3 // 2)
|
||||
MODEL_CX = MODEL_INPUT_SIZE[0]/2.
|
||||
MODEL_CY = 21.
|
||||
|
||||
model_zoom = 1.25
|
||||
model_height = 1.22
|
||||
|
||||
# canonical model transform
|
||||
model_intrinsics = np.array(
|
||||
[[ eon_focal_length / model_zoom, 0. , MODEL_CX],
|
||||
[ 0. , eon_focal_length / model_zoom, MODEL_CY],
|
||||
[ 0. , 0. , 1.]])
|
||||
|
||||
|
||||
# MED model
|
||||
MEDMODEL_INPUT_SIZE = (512, 256)
|
||||
MEDMODEL_YUV_SIZE = (MEDMODEL_INPUT_SIZE[0], MEDMODEL_INPUT_SIZE[1] * 3 // 2)
|
||||
MEDMODEL_CY = 47.6
|
||||
|
||||
medmodel_zoom = 1.
|
||||
medmodel_intrinsics = np.array(
|
||||
[[ eon_focal_length / medmodel_zoom, 0. , 0.5 * MEDMODEL_INPUT_SIZE[0]],
|
||||
[ 0. , eon_focal_length / medmodel_zoom, MEDMODEL_CY],
|
||||
[ 0. , 0. , 1.]])
|
||||
|
||||
|
||||
# BIG model
|
||||
|
||||
BIGMODEL_INPUT_SIZE = (864, 288)
|
||||
BIGMODEL_YUV_SIZE = (BIGMODEL_INPUT_SIZE[0], BIGMODEL_INPUT_SIZE[1] * 3 // 2)
|
||||
|
||||
bigmodel_zoom = 1.
|
||||
bigmodel_intrinsics = np.array(
|
||||
[[ eon_focal_length / bigmodel_zoom, 0. , 0.5 * BIGMODEL_INPUT_SIZE[0]],
|
||||
[ 0. , eon_focal_length / bigmodel_zoom, 0.2 * BIGMODEL_INPUT_SIZE[1]],
|
||||
[ 0. , 0. , 1.]])
|
||||
|
||||
|
||||
bigmodel_border = np.array([
|
||||
[0,0,1],
|
||||
[BIGMODEL_INPUT_SIZE[0], 0, 1],
|
||||
[BIGMODEL_INPUT_SIZE[0], BIGMODEL_INPUT_SIZE[1], 1],
|
||||
[0, BIGMODEL_INPUT_SIZE[1], 1],
|
||||
])
|
||||
|
||||
|
||||
model_frame_from_road_frame = np.dot(model_intrinsics,
|
||||
get_view_frame_from_road_frame(0, 0, 0, model_height))
|
||||
|
||||
bigmodel_frame_from_road_frame = np.dot(bigmodel_intrinsics,
|
||||
get_view_frame_from_road_frame(0, 0, 0, model_height))
|
||||
|
||||
medmodel_frame_from_road_frame = np.dot(medmodel_intrinsics,
|
||||
get_view_frame_from_road_frame(0, 0, 0, model_height))
|
||||
|
||||
model_frame_from_bigmodel_frame = np.dot(model_intrinsics, np.linalg.inv(bigmodel_intrinsics))
|
||||
|
||||
# 'camera from model camera'
|
||||
def get_model_height_transform(camera_frame_from_road_frame, height):
|
||||
camera_frame_from_road_ground = np.dot(camera_frame_from_road_frame, np.array([
|
||||
[1, 0, 0],
|
||||
[0, 1, 0],
|
||||
[0, 0, 0],
|
||||
[0, 0, 1],
|
||||
]))
|
||||
|
||||
camera_frame_from_road_high = np.dot(camera_frame_from_road_frame, np.array([
|
||||
[1, 0, 0],
|
||||
[0, 1, 0],
|
||||
[0, 0, height - model_height],
|
||||
[0, 0, 1],
|
||||
]))
|
||||
|
||||
road_high_from_camera_frame = np.linalg.inv(camera_frame_from_road_high)
|
||||
high_camera_from_low_camera = np.dot(camera_frame_from_road_ground, road_high_from_camera_frame)
|
||||
|
||||
return high_camera_from_low_camera
|
||||
|
||||
|
||||
# camera_frame_from_model_frame aka 'warp matrix'
|
||||
# was: calibration.h/CalibrationTransform
|
||||
def get_camera_frame_from_model_frame(camera_frame_from_road_frame, height=model_height):
|
||||
vp = vp_from_ke(camera_frame_from_road_frame)
|
||||
|
||||
model_camera_from_model_frame = np.array([
|
||||
[model_zoom, 0., vp[0] - MODEL_CX * model_zoom],
|
||||
[ 0., model_zoom, vp[1] - MODEL_CY * model_zoom],
|
||||
[ 0., 0., 1.],
|
||||
])
|
||||
|
||||
# This function is super slow, so skip it if height is very close to canonical
|
||||
# TODO: speed it up!
|
||||
if abs(height - model_height) > 0.001: #
|
||||
camera_from_model_camera = get_model_height_transform(camera_frame_from_road_frame, height)
|
||||
else:
|
||||
camera_from_model_camera = np.eye(3)
|
||||
|
||||
return np.dot(camera_from_model_camera, model_camera_from_model_frame)
|
||||
|
||||
|
||||
def get_camera_frame_from_medmodel_frame(camera_frame_from_road_frame):
|
||||
camera_frame_from_ground = camera_frame_from_road_frame[:, (0, 1, 3)]
|
||||
medmodel_frame_from_ground = medmodel_frame_from_road_frame[:, (0, 1, 3)]
|
||||
|
||||
ground_from_medmodel_frame = np.linalg.inv(medmodel_frame_from_ground)
|
||||
camera_frame_from_medmodel_frame = np.dot(camera_frame_from_ground, ground_from_medmodel_frame)
|
||||
|
||||
return camera_frame_from_medmodel_frame
|
||||
|
||||
|
||||
def get_camera_frame_from_bigmodel_frame(camera_frame_from_road_frame):
|
||||
camera_frame_from_ground = camera_frame_from_road_frame[:, (0, 1, 3)]
|
||||
bigmodel_frame_from_ground = bigmodel_frame_from_road_frame[:, (0, 1, 3)]
|
||||
|
||||
ground_from_bigmodel_frame = np.linalg.inv(bigmodel_frame_from_ground)
|
||||
camera_frame_from_bigmodel_frame = np.dot(camera_frame_from_ground, ground_from_bigmodel_frame)
|
||||
|
||||
return camera_frame_from_bigmodel_frame
|
||||
|
||||
|
||||
def get_model_frame(snu_full, camera_frame_from_model_frame, size):
|
||||
idxs = camera_frame_from_model_frame.dot(np.column_stack([np.tile(np.arange(size[0]), size[1]),
|
||||
np.tile(np.arange(size[1]), (size[0],1)).T.flatten(),
|
||||
np.ones(size[0] * size[1])]).T).T.astype(int)
|
||||
calib_flat = snu_full[idxs[:,1], idxs[:,0]]
|
||||
if len(snu_full.shape) == 3:
|
||||
calib = calib_flat.reshape((size[1], size[0], 3))
|
||||
elif len(snu_full.shape) == 2:
|
||||
calib = calib_flat.reshape((size[1], size[0]))
|
||||
else:
|
||||
raise ValueError("shape of input img is weird")
|
||||
return calib
|
||||
295
common/transformations/orientation.py
Normal file
295
common/transformations/orientation.py
Normal file
@@ -0,0 +1,295 @@
|
||||
import numpy as np
|
||||
from numpy import dot, inner, array, linalg
|
||||
from common.transformations.coordinates import LocalCoord
|
||||
|
||||
|
||||
'''
|
||||
Vectorized functions that transform between
|
||||
rotation matrices, euler angles and quaternions.
|
||||
All support lists, array or array of arrays as inputs.
|
||||
Supports both x2y and y_from_x format (y_from_x preferred!).
|
||||
'''
|
||||
|
||||
def euler2quat(eulers):
|
||||
eulers = array(eulers)
|
||||
if len(eulers.shape) > 1:
|
||||
output_shape = (-1,4)
|
||||
else:
|
||||
output_shape = (4,)
|
||||
eulers = np.atleast_2d(eulers)
|
||||
gamma, theta, psi = eulers[:,0], eulers[:,1], eulers[:,2]
|
||||
|
||||
q0 = np.cos(gamma / 2) * np.cos(theta / 2) * np.cos(psi / 2) + \
|
||||
np.sin(gamma / 2) * np.sin(theta / 2) * np.sin(psi / 2)
|
||||
q1 = np.sin(gamma / 2) * np.cos(theta / 2) * np.cos(psi / 2) - \
|
||||
np.cos(gamma / 2) * np.sin(theta / 2) * np.sin(psi / 2)
|
||||
q2 = np.cos(gamma / 2) * np.sin(theta / 2) * np.cos(psi / 2) + \
|
||||
np.sin(gamma / 2) * np.cos(theta / 2) * np.sin(psi / 2)
|
||||
q3 = np.cos(gamma / 2) * np.cos(theta / 2) * np.sin(psi / 2) - \
|
||||
np.sin(gamma / 2) * np.sin(theta / 2) * np.cos(psi / 2)
|
||||
|
||||
quats = array([q0, q1, q2, q3]).T
|
||||
for i in xrange(len(quats)):
|
||||
if quats[i,0] < 0:
|
||||
quats[i] = -quats[i]
|
||||
return quats.reshape(output_shape)
|
||||
|
||||
|
||||
def quat2euler(quats):
|
||||
quats = array(quats)
|
||||
if len(quats.shape) > 1:
|
||||
output_shape = (-1,3)
|
||||
else:
|
||||
output_shape = (3,)
|
||||
quats = np.atleast_2d(quats)
|
||||
q0, q1, q2, q3 = quats[:,0], quats[:,1], quats[:,2], quats[:,3]
|
||||
|
||||
gamma = np.arctan2(2 * (q0 * q1 + q2 * q3), 1 - 2 * (q1**2 + q2**2))
|
||||
theta = np.arcsin(2 * (q0 * q2 - q3 * q1))
|
||||
psi = np.arctan2(2 * (q0 * q3 + q1 * q2), 1 - 2 * (q2**2 + q3**2))
|
||||
|
||||
eulers = array([gamma, theta, psi]).T
|
||||
return eulers.reshape(output_shape)
|
||||
|
||||
|
||||
def quat2rot(quats):
|
||||
quats = array(quats)
|
||||
input_shape = quats.shape
|
||||
quats = np.atleast_2d(quats)
|
||||
Rs = np.zeros((quats.shape[0], 3, 3))
|
||||
q0 = quats[:, 0]
|
||||
q1 = quats[:, 1]
|
||||
q2 = quats[:, 2]
|
||||
q3 = quats[:, 3]
|
||||
Rs[:, 0, 0] = q0 * q0 + q1 * q1 - q2 * q2 - q3 * q3
|
||||
Rs[:, 0, 1] = 2 * (q1 * q2 - q0 * q3)
|
||||
Rs[:, 0, 2] = 2 * (q0 * q2 + q1 * q3)
|
||||
Rs[:, 1, 0] = 2 * (q1 * q2 + q0 * q3)
|
||||
Rs[:, 1, 1] = q0 * q0 - q1 * q1 + q2 * q2 - q3 * q3
|
||||
Rs[:, 1, 2] = 2 * (q2 * q3 - q0 * q1)
|
||||
Rs[:, 2, 0] = 2 * (q1 * q3 - q0 * q2)
|
||||
Rs[:, 2, 1] = 2 * (q0 * q1 + q2 * q3)
|
||||
Rs[:, 2, 2] = q0 * q0 - q1 * q1 - q2 * q2 + q3 * q3
|
||||
|
||||
if len(input_shape) < 2:
|
||||
return Rs[0]
|
||||
else:
|
||||
return Rs
|
||||
|
||||
|
||||
def rot2quat(rots):
|
||||
input_shape = rots.shape
|
||||
if len(input_shape) < 3:
|
||||
rots = array([rots])
|
||||
K3 = np.empty((len(rots), 4, 4))
|
||||
K3[:, 0, 0] = (rots[:, 0, 0] - rots[:, 1, 1] - rots[:, 2, 2]) / 3.0
|
||||
K3[:, 0, 1] = (rots[:, 1, 0] + rots[:, 0, 1]) / 3.0
|
||||
K3[:, 0, 2] = (rots[:, 2, 0] + rots[:, 0, 2]) / 3.0
|
||||
K3[:, 0, 3] = (rots[:, 1, 2] - rots[:, 2, 1]) / 3.0
|
||||
K3[:, 1, 0] = K3[:, 0, 1]
|
||||
K3[:, 1, 1] = (rots[:, 1, 1] - rots[:, 0, 0] - rots[:, 2, 2]) / 3.0
|
||||
K3[:, 1, 2] = (rots[:, 2, 1] + rots[:, 1, 2]) / 3.0
|
||||
K3[:, 1, 3] = (rots[:, 2, 0] - rots[:, 0, 2]) / 3.0
|
||||
K3[:, 2, 0] = K3[:, 0, 2]
|
||||
K3[:, 2, 1] = K3[:, 1, 2]
|
||||
K3[:, 2, 2] = (rots[:, 2, 2] - rots[:, 0, 0] - rots[:, 1, 1]) / 3.0
|
||||
K3[:, 2, 3] = (rots[:, 0, 1] - rots[:, 1, 0]) / 3.0
|
||||
K3[:, 3, 0] = K3[:, 0, 3]
|
||||
K3[:, 3, 1] = K3[:, 1, 3]
|
||||
K3[:, 3, 2] = K3[:, 2, 3]
|
||||
K3[:, 3, 3] = (rots[:, 0, 0] + rots[:, 1, 1] + rots[:, 2, 2]) / 3.0
|
||||
q = np.empty((len(rots), 4))
|
||||
for i in xrange(len(rots)):
|
||||
_, eigvecs = linalg.eigh(K3[i].T)
|
||||
eigvecs = eigvecs[:,3:]
|
||||
q[i, 0] = eigvecs[-1]
|
||||
q[i, 1:] = -eigvecs[:-1].flatten()
|
||||
if q[i, 0] < 0:
|
||||
q[i] = -q[i]
|
||||
|
||||
if len(input_shape) < 3:
|
||||
return q[0]
|
||||
else:
|
||||
return q
|
||||
|
||||
|
||||
def euler2rot(eulers):
|
||||
return rotations_from_quats(euler2quat(eulers))
|
||||
|
||||
|
||||
def rot2euler(rots):
|
||||
return quat2euler(quats_from_rotations(rots))
|
||||
|
||||
|
||||
quats_from_rotations = rot2quat
|
||||
quat_from_rot = rot2quat
|
||||
rotations_from_quats = quat2rot
|
||||
rot_from_quat= quat2rot
|
||||
rot_from_quat= quat2rot
|
||||
euler_from_rot = rot2euler
|
||||
euler_from_quat = quat2euler
|
||||
rot_from_euler = euler2rot
|
||||
quat_from_euler = euler2quat
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
'''
|
||||
Random helpers below
|
||||
'''
|
||||
|
||||
|
||||
def quat_product(q, r):
|
||||
t = np.zeros(4)
|
||||
t[0] = r[0] * q[0] - r[1] * q[1] - r[2] * q[2] - r[3] * q[3]
|
||||
t[1] = r[0] * q[1] + r[1] * q[0] - r[2] * q[3] + r[3] * q[2]
|
||||
t[2] = r[0] * q[2] + r[1] * q[3] + r[2] * q[0] - r[3] * q[1]
|
||||
t[3] = r[0] * q[3] - r[1] * q[2] + r[2] * q[1] + r[3] * q[0]
|
||||
return t
|
||||
|
||||
|
||||
def rot_matrix(roll, pitch, yaw):
|
||||
cr, sr = np.cos(roll), np.sin(roll)
|
||||
cp, sp = np.cos(pitch), np.sin(pitch)
|
||||
cy, sy = np.cos(yaw), np.sin(yaw)
|
||||
rr = array([[1,0,0],[0, cr,-sr],[0, sr, cr]])
|
||||
rp = array([[cp,0,sp],[0, 1,0],[-sp, 0, cp]])
|
||||
ry = array([[cy,-sy,0],[sy, cy,0],[0, 0, 1]])
|
||||
return ry.dot(rp.dot(rr))
|
||||
|
||||
|
||||
def rot(axis, angle):
|
||||
# Rotates around an arbitrary axis
|
||||
ret_1 = (1 - np.cos(angle)) * array([[axis[0]**2, axis[0] * axis[1], axis[0] * axis[2]], [
|
||||
axis[1] * axis[0], axis[1]**2, axis[1] * axis[2]
|
||||
], [axis[2] * axis[0], axis[2] * axis[1], axis[2]**2]])
|
||||
ret_2 = np.cos(angle) * np.eye(3)
|
||||
ret_3 = np.sin(angle) * array([[0, -axis[2], axis[1]], [axis[2], 0, -axis[0]],
|
||||
[-axis[1], axis[0], 0]])
|
||||
return ret_1 + ret_2 + ret_3
|
||||
|
||||
|
||||
def ecef_euler_from_ned(ned_ecef_init, ned_pose):
|
||||
'''
|
||||
Got it from here:
|
||||
Using Rotations to Build Aerospace Coordinate Systems
|
||||
-Don Koks
|
||||
'''
|
||||
converter = LocalCoord.from_ecef(ned_ecef_init)
|
||||
x0 = converter.ned2ecef([1, 0, 0]) - converter.ned2ecef([0, 0, 0])
|
||||
y0 = converter.ned2ecef([0, 1, 0]) - converter.ned2ecef([0, 0, 0])
|
||||
z0 = converter.ned2ecef([0, 0, 1]) - converter.ned2ecef([0, 0, 0])
|
||||
|
||||
x1 = rot(z0, ned_pose[2]).dot(x0)
|
||||
y1 = rot(z0, ned_pose[2]).dot(y0)
|
||||
z1 = rot(z0, ned_pose[2]).dot(z0)
|
||||
|
||||
x2 = rot(y1, ned_pose[1]).dot(x1)
|
||||
y2 = rot(y1, ned_pose[1]).dot(y1)
|
||||
z2 = rot(y1, ned_pose[1]).dot(z1)
|
||||
|
||||
x3 = rot(x2, ned_pose[0]).dot(x2)
|
||||
y3 = rot(x2, ned_pose[0]).dot(y2)
|
||||
#z3 = rot(x2, ned_pose[0]).dot(z2)
|
||||
|
||||
x0 = array([1, 0, 0])
|
||||
y0 = array([0, 1, 0])
|
||||
z0 = array([0, 0, 1])
|
||||
|
||||
psi = np.arctan2(inner(x3, y0), inner(x3, x0))
|
||||
theta = np.arctan2(-inner(x3, z0), np.sqrt(inner(x3, x0)**2 + inner(x3, y0)**2))
|
||||
y2 = rot(z0, psi).dot(y0)
|
||||
z2 = rot(y2, theta).dot(z0)
|
||||
phi = np.arctan2(inner(y3, z2), inner(y3, y2))
|
||||
|
||||
ret = array([phi, theta, psi])
|
||||
return ret
|
||||
|
||||
|
||||
def ned_euler_from_ecef(ned_ecef_init, ecef_poses):
|
||||
'''
|
||||
Got the math from here:
|
||||
Using Rotations to Build Aerospace Coordinate Systems
|
||||
-Don Koks
|
||||
|
||||
Also accepts array of ecef_poses and array of ned_ecef_inits.
|
||||
Where each row is a pose and an ecef_init.
|
||||
'''
|
||||
ned_ecef_init = array(ned_ecef_init)
|
||||
ecef_poses = array(ecef_poses)
|
||||
output_shape = ecef_poses.shape
|
||||
ned_ecef_init = np.atleast_2d(ned_ecef_init)
|
||||
if ned_ecef_init.shape[0] == 1:
|
||||
ned_ecef_init = np.tile(ned_ecef_init[0], (output_shape[0], 1))
|
||||
ecef_poses = np.atleast_2d(ecef_poses)
|
||||
|
||||
ned_poses = np.zeros(ecef_poses.shape)
|
||||
for i, ecef_pose in enumerate(ecef_poses):
|
||||
converter = LocalCoord.from_ecef(ned_ecef_init[i])
|
||||
x0 = array([1, 0, 0])
|
||||
y0 = array([0, 1, 0])
|
||||
z0 = array([0, 0, 1])
|
||||
|
||||
x1 = rot(z0, ecef_pose[2]).dot(x0)
|
||||
y1 = rot(z0, ecef_pose[2]).dot(y0)
|
||||
z1 = rot(z0, ecef_pose[2]).dot(z0)
|
||||
|
||||
x2 = rot(y1, ecef_pose[1]).dot(x1)
|
||||
y2 = rot(y1, ecef_pose[1]).dot(y1)
|
||||
z2 = rot(y1, ecef_pose[1]).dot(z1)
|
||||
|
||||
x3 = rot(x2, ecef_pose[0]).dot(x2)
|
||||
y3 = rot(x2, ecef_pose[0]).dot(y2)
|
||||
#z3 = rot(x2, ecef_pose[0]).dot(z2)
|
||||
|
||||
x0 = converter.ned2ecef([1, 0, 0]) - converter.ned2ecef([0, 0, 0])
|
||||
y0 = converter.ned2ecef([0, 1, 0]) - converter.ned2ecef([0, 0, 0])
|
||||
z0 = converter.ned2ecef([0, 0, 1]) - converter.ned2ecef([0, 0, 0])
|
||||
|
||||
psi = np.arctan2(inner(x3, y0), inner(x3, x0))
|
||||
theta = np.arctan2(-inner(x3, z0), np.sqrt(inner(x3, x0)**2 + inner(x3, y0)**2))
|
||||
y2 = rot(z0, psi).dot(y0)
|
||||
z2 = rot(y2, theta).dot(z0)
|
||||
phi = np.arctan2(inner(y3, z2), inner(y3, y2))
|
||||
ned_poses[i] = array([phi, theta, psi])
|
||||
|
||||
return ned_poses.reshape(output_shape)
|
||||
|
||||
|
||||
def ecef2car(car_ecef, psi, theta, points_ecef, ned_converter):
|
||||
"""
|
||||
TODO: add roll rotation
|
||||
Converts an array of points in ecef coordinates into
|
||||
x-forward, y-left, z-up coordinates
|
||||
Parameters
|
||||
----------
|
||||
psi: yaw, radian
|
||||
theta: pitch, radian
|
||||
Returns
|
||||
-------
|
||||
[x, y, z] coordinates in car frame
|
||||
"""
|
||||
|
||||
# input is an array of points in ecef cocrdinates
|
||||
# output is an array of points in car's coordinate (x-front, y-left, z-up)
|
||||
|
||||
# convert points to NED
|
||||
points_ned = []
|
||||
for p in points_ecef:
|
||||
points_ned.append(ned_converter.ecef2ned_matrix.dot(array(p) - car_ecef))
|
||||
|
||||
points_ned = np.vstack(points_ned).T
|
||||
|
||||
# n, e, d -> x, y, z
|
||||
# Calculate relative postions and rotate wrt to heading and pitch of car
|
||||
invert_R = array([[1., 0., 0.], [0., -1., 0.], [0., 0., -1.]])
|
||||
|
||||
c, s = np.cos(psi), np.sin(psi)
|
||||
yaw_R = array([[c, s, 0.], [-s, c, 0.], [0., 0., 1.]])
|
||||
|
||||
c, s = np.cos(theta), np.sin(theta)
|
||||
pitch_R = array([[c, 0., -s], [0., 1., 0.], [s, 0., c]])
|
||||
|
||||
return dot(pitch_R, dot(yaw_R, dot(invert_R, points_ned)))
|
||||
95
common/vin.py
Executable file
95
common/vin.py
Executable file
@@ -0,0 +1,95 @@
|
||||
#!/usr/bin/env python
|
||||
import time
|
||||
from common.realtime import sec_since_boot
|
||||
import selfdrive.messaging as messaging
|
||||
from selfdrive.boardd.boardd import can_list_to_can_capnp
|
||||
|
||||
def get_vin(logcan, sendcan):
|
||||
|
||||
# works on standard 11-bit addresses for diagnostic. Tested on Toyota and Subaru;
|
||||
# Honda uses the extended 29-bit addresses, and unfortunately only works from OBDII
|
||||
query_msg = [[0x7df, 0, '\x02\x09\x02'.ljust(8, "\x00"), 0],
|
||||
[0x7e0, 0, '\x30'.ljust(8, "\x00"), 0]]
|
||||
|
||||
cnts = [1, 2] # Number of messages to wait for at each iteration
|
||||
vin_valid = True
|
||||
|
||||
dat = []
|
||||
for i in range(len(query_msg)):
|
||||
cnt = 0
|
||||
sendcan.send(can_list_to_can_capnp([query_msg[i]], msgtype='sendcan'))
|
||||
got_response = False
|
||||
t_start = sec_since_boot()
|
||||
while sec_since_boot() - t_start < 0.05 and not got_response:
|
||||
for a in messaging.drain_sock(logcan):
|
||||
for can in a.can:
|
||||
if can.src == 0 and can.address == 0x7e8:
|
||||
vin_valid = vin_valid and is_vin_response_valid(can.dat, i, cnt)
|
||||
dat += can.dat[2:] if i == 0 else can.dat[1:]
|
||||
cnt += 1
|
||||
if cnt == cnts[i]:
|
||||
got_response = True
|
||||
time.sleep(0.01)
|
||||
|
||||
return "".join(dat[3:]) if vin_valid else ""
|
||||
|
||||
"""
|
||||
if 'vin' not in gctx:
|
||||
print "getting vin"
|
||||
gctx['vin'] = query_vin()[3:]
|
||||
print "got VIN %s" % (gctx['vin'],)
|
||||
cloudlog.info("got VIN %s" % (gctx['vin'],))
|
||||
|
||||
# *** determine platform based on VIN ****
|
||||
if vin.startswith("19UDE2F36G"):
|
||||
print "ACURA ILX 2016"
|
||||
self.civic = False
|
||||
else:
|
||||
# TODO: add Honda check explicitly
|
||||
print "HONDA CIVIC 2016"
|
||||
self.civic = True
|
||||
|
||||
# *** special case VIN of Acura test platform
|
||||
if vin == "19UDE2F36GA001322":
|
||||
print "comma.ai test platform detected"
|
||||
# it has a gas interceptor and a torque mod
|
||||
self.torque_mod = True
|
||||
"""
|
||||
|
||||
|
||||
# sanity checks on response messages from vin query
|
||||
def is_vin_response_valid(can_dat, step, cnt):
|
||||
|
||||
can_dat = [ord(i) for i in can_dat]
|
||||
|
||||
if len(can_dat) != 8:
|
||||
# ISO-TP meesages are all 8 bytes
|
||||
return False
|
||||
|
||||
if step == 0:
|
||||
# VIN does not fit in a single message and it's 20 bytes of data
|
||||
if can_dat[0] != 0x10 or can_dat[1] != 0x14:
|
||||
return False
|
||||
|
||||
if step == 1 and cnt == 0:
|
||||
# first response after a CONTINUE query is sent
|
||||
if can_dat[0] != 0x21:
|
||||
return False
|
||||
|
||||
if step == 1 and cnt == 1:
|
||||
# second response after a CONTINUE query is sent
|
||||
if can_dat[0] != 0x22:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import zmq
|
||||
from selfdrive.services import service_list
|
||||
context = zmq.Context()
|
||||
logcan = messaging.sub_sock(context, service_list['can'].port)
|
||||
sendcan = messaging.pub_sock(context, service_list['sendcan'].port)
|
||||
time.sleep(1.) # give time to sendcan socket to start
|
||||
|
||||
print get_vin(logcan, sendcan)
|
||||
BIN
dragonpilot/chinese-fonts/Miui-Bold.ttf
Normal file
BIN
dragonpilot/chinese-fonts/Miui-Bold.ttf
Normal file
Binary file not shown.
BIN
dragonpilot/chinese-fonts/Miui-Regular.ttf
Normal file
BIN
dragonpilot/chinese-fonts/Miui-Regular.ttf
Normal file
Binary file not shown.
371
dragonpilot/chinese-fonts/fonts.xml
Normal file
371
dragonpilot/chinese-fonts/fonts.xml
Normal file
@@ -0,0 +1,371 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
NOTE: this is the newer (L) version of the system font configuration,
|
||||
supporting richer weight selection. Some apps will expect the older
|
||||
version, so please keep system_fonts.xml and fallback_fonts.xml in sync
|
||||
with any changes, even though framework will only read this file.
|
||||
|
||||
All fonts withohut names are added to the default list. Fonts are chosen
|
||||
based on a match: full BCP-47 language tag including script, then just
|
||||
language, and finally order (the first font containing the glyph).
|
||||
|
||||
Order of appearance is also the tiebreaker for weight matching. This is
|
||||
the reason why the 900 weights of Roboto precede the 700 weights - we
|
||||
prefer the former when an 800 weight is requested. Since bold spans
|
||||
effectively add 300 to the weight, this ensures that 900 is the bold
|
||||
paired with the 500 weight, ensuring adequate contrast.
|
||||
-->
|
||||
<familyset version="22">
|
||||
<!-- first font is default -->
|
||||
<family name="sans-serif">
|
||||
<font weight="100" style="normal">Roboto-Thin.ttf</font>
|
||||
<font weight="100" style="italic">Roboto-ThinItalic.ttf</font>
|
||||
<font weight="300" style="normal">Roboto-Light.ttf</font>
|
||||
<font weight="300" style="italic">Roboto-LightItalic.ttf</font>
|
||||
<font weight="400" style="normal">Roboto-Regular.ttf</font>
|
||||
<font weight="400" style="italic">Roboto-Italic.ttf</font>
|
||||
<font weight="500" style="normal">Roboto-Medium.ttf</font>
|
||||
<font weight="500" style="italic">Roboto-MediumItalic.ttf</font>
|
||||
<font weight="900" style="normal">Roboto-Black.ttf</font>
|
||||
<font weight="900" style="italic">Roboto-BlackItalic.ttf</font>
|
||||
<font weight="700" style="normal">Roboto-Bold.ttf</font>
|
||||
<font weight="700" style="italic">Roboto-BoldItalic.ttf</font>
|
||||
</family>
|
||||
|
||||
<!-- Note that aliases must come after the fonts they reference. -->
|
||||
<alias name="sans-serif-thin" to="sans-serif" weight="100" />
|
||||
<alias name="sans-serif-light" to="sans-serif" weight="300" />
|
||||
<alias name="sans-serif-medium" to="sans-serif" weight="500" />
|
||||
<alias name="sans-serif-black" to="sans-serif" weight="900" />
|
||||
<alias name="arial" to="sans-serif" />
|
||||
<alias name="helvetica" to="sans-serif" />
|
||||
<alias name="tahoma" to="sans-serif" />
|
||||
<alias name="verdana" to="sans-serif" />
|
||||
|
||||
<family name="sans-serif-condensed">
|
||||
<font weight="300" style="normal">RobotoCondensed-Light.ttf</font>
|
||||
<font weight="300" style="italic">RobotoCondensed-LightItalic.ttf</font>
|
||||
<font weight="400" style="normal">RobotoCondensed-Regular.ttf</font>
|
||||
<font weight="400" style="italic">RobotoCondensed-Italic.ttf</font>
|
||||
<font weight="700" style="normal">RobotoCondensed-Bold.ttf</font>
|
||||
<font weight="700" style="italic">RobotoCondensed-BoldItalic.ttf</font>
|
||||
</family>
|
||||
<alias name="sans-serif-condensed-light" to="sans-serif-condensed" weight="300" />
|
||||
|
||||
<family name="serif">
|
||||
<font weight="400" style="normal">NotoSerif-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSerif-Bold.ttf</font>
|
||||
<font weight="400" style="italic">NotoSerif-Italic.ttf</font>
|
||||
<font weight="700" style="italic">NotoSerif-BoldItalic.ttf</font>
|
||||
</family>
|
||||
<alias name="times" to="serif" />
|
||||
<alias name="times new roman" to="serif" />
|
||||
<alias name="palatino" to="serif" />
|
||||
<alias name="georgia" to="serif" />
|
||||
<alias name="baskerville" to="serif" />
|
||||
<alias name="goudy" to="serif" />
|
||||
<alias name="fantasy" to="serif" />
|
||||
<alias name="ITC Stone Serif" to="serif" />
|
||||
|
||||
<family name="monospace">
|
||||
<font weight="400" style="normal">DroidSansMono.ttf</font>
|
||||
</family>
|
||||
<alias name="sans-serif-monospace" to="monospace" />
|
||||
<alias name="monaco" to="monospace" />
|
||||
|
||||
<family name="serif-monospace">
|
||||
<font weight="400" style="normal">CutiveMono.ttf</font>
|
||||
</family>
|
||||
<alias name="courier" to="serif-monospace" />
|
||||
<alias name="courier new" to="serif-monospace" />
|
||||
|
||||
<family name="casual">
|
||||
<font weight="400" style="normal">ComingSoon.ttf</font>
|
||||
</family>
|
||||
|
||||
<family name="cursive">
|
||||
<font weight="400" style="normal">DancingScript-Regular.ttf</font>
|
||||
<font weight="700" style="normal">DancingScript-Bold.ttf</font>
|
||||
</family>
|
||||
|
||||
<family name="sans-serif-smallcaps">
|
||||
<font weight="400" style="normal">CarroisGothicSC-Regular.ttf</font>
|
||||
</family>
|
||||
|
||||
<!-- fallback fonts -->
|
||||
<family variant="elegant">
|
||||
<font weight="400" style="normal">NotoNaskhArabic-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoNaskhArabic-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="compact">
|
||||
<font weight="400" style="normal">NotoNaskhArabicUI-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoNaskhArabicUI-Bold.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansEthiopic-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansEthiopic-Bold.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansHebrew-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansHebrew-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="elegant">
|
||||
<font weight="400" style="normal">NotoSansThai-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansThai-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="compact">
|
||||
<font weight="400" style="normal">NotoSansThaiUI-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansThaiUI-Bold.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansArmenian-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansArmenian-Bold.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansGeorgian-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansGeorgian-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="elegant">
|
||||
<font weight="400" style="normal">NotoSansDevanagari-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansDevanagari-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="compact">
|
||||
<font weight="400" style="normal">NotoSansDevanagariUI-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansDevanagariUI-Bold.ttf</font>
|
||||
</family>
|
||||
<!-- Gujarati should come after Devanagari -->
|
||||
<family variant="elegant">
|
||||
<font weight="400" style="normal">NotoSansGujarati-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansGujarati-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="compact">
|
||||
<font weight="400" style="normal">NotoSansGujaratiUI-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansGujaratiUI-Bold.ttf</font>
|
||||
</family>
|
||||
<!-- Gurmukhi should come after Devanagari -->
|
||||
<family variant="elegant">
|
||||
<font weight="400" style="normal">NotoSansGurmukhi-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansGurmukhi-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="compact">
|
||||
<font weight="400" style="normal">NotoSansGurmukhiUI-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansGurmukhiUI-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="elegant">
|
||||
<font weight="400" style="normal">NotoSansTamil-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansTamil-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="compact">
|
||||
<font weight="400" style="normal">NotoSansTamilUI-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansTamilUI-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="elegant">
|
||||
<font weight="400" style="normal">NotoSansMalayalam-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansMalayalam-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="compact">
|
||||
<font weight="400" style="normal">NotoSansMalayalamUI-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansMalayalamUI-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="elegant">
|
||||
<font weight="400" style="normal">NotoSansBengali-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansBengali-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="compact">
|
||||
<font weight="400" style="normal">NotoSansBengaliUI-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansBengaliUI-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="elegant">
|
||||
<font weight="400" style="normal">NotoSansTelugu-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansTelugu-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="compact">
|
||||
<font weight="400" style="normal">NotoSansTeluguUI-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansTeluguUI-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="elegant">
|
||||
<font weight="400" style="normal">NotoSansKannada-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansKannada-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="compact">
|
||||
<font weight="400" style="normal">NotoSansKannadaUI-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansKannadaUI-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="elegant">
|
||||
<font weight="400" style="normal">NotoSansOriya-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansOriya-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="compact">
|
||||
<font weight="400" style="normal">NotoSansOriyaUI-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansOriyaUI-Bold.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansSinhala-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansSinhala-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="elegant">
|
||||
<font weight="400" style="normal">NotoSansKhmer-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansKhmer-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="compact">
|
||||
<font weight="400" style="normal">NotoSansKhmerUI-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansKhmerUI-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="elegant">
|
||||
<font weight="400" style="normal">NotoSansLao-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansLao-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="compact">
|
||||
<font weight="400" style="normal">NotoSansLaoUI-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansLaoUI-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="elegant">
|
||||
<font weight="400" style="normal">NotoSansMyanmar-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansMyanmar-Bold.ttf</font>
|
||||
</family>
|
||||
<family variant="compact">
|
||||
<font weight="400" style="normal">NotoSansMyanmarUI-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansMyanmarUI-Bold.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansThaana-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansThaana-Bold.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansCham-Regular.ttf</font>
|
||||
<font weight="700" style="normal">NotoSansCham-Bold.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansBalinese-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansBamum-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansBatak-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansBuginese-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansBuhid-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansCanadianAboriginal-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansCherokee-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansCoptic-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansGlagolitic-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansHanunoo-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansJavanese-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansKayahLi-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansLepcha-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansLimbu-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansLisu-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansMandaic-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansMeeteiMayek-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansNewTaiLue-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansNKo-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansOlChiki-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansRejang-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansSaurashtra-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansSundanese-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansSylotiNagri-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansSyriacEstrangela-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansTagbanwa-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansTaiTham-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansTaiViet-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansTibetan-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansTifinagh-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansVai-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansYi-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansSymbols-Regular-Subsetted.ttf</font>
|
||||
</family>
|
||||
<family lang="zh-Hans">
|
||||
<font weight="400" style="normal">NotoSansSC-Regular.otf</font>
|
||||
</family>
|
||||
<family lang="zh-Hant">
|
||||
<font weight="400" style="normal">NotoSansTC-Regular.otf</font>
|
||||
</family>
|
||||
<family lang="ja">
|
||||
<font weight="400" style="normal">NotoSansJP-Regular.otf</font>
|
||||
</family>
|
||||
<family lang="ko">
|
||||
<font weight="400" style="normal">NotoSansKR-Regular.otf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NanumGothic.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoColorEmoji.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">Miui-Regular.ttf</font>
|
||||
</family>
|
||||
<family lang="ja">
|
||||
<font weight="400" style="normal">MTLmr3m.ttf</font>
|
||||
</family>
|
||||
<!--
|
||||
Tai Le and Mongolian are intentionally kept last, to make sure they don't override
|
||||
the East Asian punctuation for Chinese.
|
||||
-->
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansTaiLe-Regular.ttf</font>
|
||||
</family>
|
||||
<family>
|
||||
<font weight="400" style="normal">NotoSansMongolian-Regular.ttf</font>
|
||||
</family>
|
||||
</familyset>
|
||||
50
dragonpilot/chinese-fonts/installer.sh
Executable file
50
dragonpilot/chinese-fonts/installer.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Anndroid system locale, zh-TW = Traditional Chinese, zh-CN = Simplified Chinese
|
||||
lang=en
|
||||
|
||||
update_font_reg=0
|
||||
update_font_bold=0
|
||||
remove_old_font=0
|
||||
|
||||
# check regular font
|
||||
if [ ! -f "/system/fonts/Miui-Regular.ttf" ]; then
|
||||
update_font_reg=1
|
||||
fi
|
||||
|
||||
# check bold font
|
||||
if [ ! -f "/system/fonts/Miui-Bold.ttf" ]; then
|
||||
update_font_bold=1
|
||||
fi
|
||||
|
||||
# check droidsans font
|
||||
if ls /system/fonts/DroidSansFallback*.ttf 1> /dev/null 2>&1; then
|
||||
remove_old_font=1
|
||||
fi
|
||||
|
||||
if [ $update_font_reg -eq "1" ] || [ $update_font_bold -eq "1" ] || [ $remove_old_font -eq "1" ]; then
|
||||
# sleep 5 secs in case, make sure the /system is remountable
|
||||
sleep 5
|
||||
mount -o remount,rw /system
|
||||
if [ $update_font_reg -eq "1" ] || [ $update_font_bold -eq "1" ]; then
|
||||
# download regular font
|
||||
if [ $update_font_reg -eq "1" ]; then
|
||||
yes | cp -rf /data/openpilot/dragonpilot/chinese-fonts/Miui-Regular.ttf /system/fonts/Miui-Regular.ttf
|
||||
fi
|
||||
# download bold font
|
||||
if [ $update_font_bold -eq "1" ]; then
|
||||
yes | cp -rf /data/openpilot/dragonpilot/chinese-fonts/Miui-Bold.ttf /system/fonts/Miui-Bold.ttf
|
||||
fi
|
||||
# dont new font mapping
|
||||
yes | cp -rf /data/openpilot/dragonpilot/chinese-fonts/fonts.xml /system/etc/fonts.xml
|
||||
chmod 644 /system/etc/fonts.xml
|
||||
chmod 644 /system/fonts/Miui-*
|
||||
fi
|
||||
# remove driodsans font
|
||||
if [ $remove_old_font -eq "1" ]; then
|
||||
rm -fr /system/fonts/DroidSansFallback*.ttf
|
||||
fi
|
||||
mount -o remount,r /system
|
||||
# change system locale
|
||||
setprop persist.sys.locale $lang
|
||||
fi
|
||||
88
installer/updater/Makefile
Normal file
88
installer/updater/Makefile
Normal file
@@ -0,0 +1,88 @@
|
||||
CC = clang
|
||||
CXX = clang++
|
||||
|
||||
PHONELIBS = ../../phonelibs
|
||||
|
||||
WARN_FLAGS = -Werror=implicit-function-declaration \
|
||||
-Werror=incompatible-pointer-types \
|
||||
-Werror=int-conversion \
|
||||
-Werror=return-type \
|
||||
-Werror=format-extra-args
|
||||
|
||||
CFLAGS = -std=gnu11 -g -fPIC -O2 $(WARN_FLAGS)
|
||||
CXXFLAGS = -std=c++11 -g -fPIC -O2 $(WARN_FLAGS)
|
||||
|
||||
CURL_FLAGS = -I$(PHONELIBS)/curl/include
|
||||
CURL_LIBS = $(PHONELIBS)/curl/lib/libcurl.a \
|
||||
$(PHONELIBS)/zlib/lib/libz.a
|
||||
|
||||
BORINGSSL_FLAGS = -I$(PHONELIBS)/boringssl/include
|
||||
BORINGSSL_LIBS = $(PHONELIBS)/boringssl/lib/libssl_static.a \
|
||||
$(PHONELIBS)/boringssl/lib/libcrypto_static.a \
|
||||
|
||||
NANOVG_FLAGS = -I$(PHONELIBS)/nanovg
|
||||
|
||||
JSON11_FLAGS = -I$(PHONELIBS)/json11
|
||||
|
||||
OPENGL_LIBS = -lGLESv3
|
||||
|
||||
FRAMEBUFFER_LIBS = -lutils -lgui -lEGL
|
||||
|
||||
.PHONY: all
|
||||
all: updater
|
||||
|
||||
OBJS = courbd.ttf.o \
|
||||
../../selfdrive/common/touch.o \
|
||||
../../selfdrive/common/framebuffer.o \
|
||||
$(PHONELIBS)/json11/json11.o \
|
||||
$(PHONELIBS)/nanovg/nanovg.o
|
||||
|
||||
DEPS := $(OBJS:.o=.d)
|
||||
|
||||
updater: updater.o $(OBJS)
|
||||
@echo "[ LINK ] $@"
|
||||
$(CXX) $(CPPFLAGS) -fPIC -o 'updater' $^ \
|
||||
$(FRAMEBUFFER_LIBS) \
|
||||
$(CURL_LIBS) \
|
||||
$(BORINGSSL_LIBS) \
|
||||
-L/system/vendor/lib64 \
|
||||
$(OPENGL_LIBS) \
|
||||
-lcutils -lm -llog
|
||||
strip updater
|
||||
|
||||
courbd.ttf.o: ../../selfdrive/assets/courbd.ttf
|
||||
@echo "[ bin2o ] $@"
|
||||
cd '$(dir $<)' && ld -r -b binary '$(notdir $<)' -o '$(abspath $@)'
|
||||
|
||||
%.o: %.c
|
||||
mkdir -p $(@D)
|
||||
@echo "[ CC ] $@"
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) \
|
||||
-I../.. \
|
||||
-I$(PHONELIBS)/android_frameworks_native/include \
|
||||
-I$(PHONELIBS)/android_system_core/include \
|
||||
-I$(PHONELIBS)/android_hardware_libhardware/include \
|
||||
$(NANOVG_FLAGS) \
|
||||
-c -o '$@' '$<'
|
||||
|
||||
%.o: %.cc
|
||||
mkdir -p $(@D)
|
||||
@echo "[ CXX ] $@"
|
||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) \
|
||||
-I../../selfdrive \
|
||||
-I../../ \
|
||||
-I$(PHONELIBS)/android_frameworks_native/include \
|
||||
-I$(PHONELIBS)/android_system_core/include \
|
||||
-I$(PHONELIBS)/android_hardware_libhardware/include \
|
||||
$(NANOVG_FLAGS) \
|
||||
$(JSON11_FLAGS) \
|
||||
$(CURL_FLAGS) \
|
||||
$(BORINGSSL_FLAGS) \
|
||||
-c -o '$@' '$<'
|
||||
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f $(OBJS) $(DEPS)
|
||||
|
||||
-include $(DEPS)
|
||||
7
installer/updater/update.json
Normal file
7
installer/updater/update.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-c992abb59cbaf6588f51055db52db619061107851773fc8480acb8bb5d77a28f.zip",
|
||||
"ota_hash": "c992abb59cbaf6588f51055db52db619061107851773fc8480acb8bb5d77a28f",
|
||||
"recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-af099a84cfd7b91266090779238ac358278948dcde2dcfa0fbca6e8397366f0a.img",
|
||||
"recovery_len": 15136044,
|
||||
"recovery_hash": "af099a84cfd7b91266090779238ac358278948dcde2dcfa0fbca6e8397366f0a"
|
||||
}
|
||||
BIN
installer/updater/updater
Executable file
BIN
installer/updater/updater
Executable file
Binary file not shown.
675
installer/updater/updater.cc
Normal file
675
installer/updater/updater.cc
Normal file
@@ -0,0 +1,675 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <openssl/sha.h>
|
||||
|
||||
#include <GLES3/gl3.h>
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
|
||||
#include "nanovg.h"
|
||||
#define NANOVG_GLES3_IMPLEMENTATION
|
||||
#include "nanovg_gl.h"
|
||||
#include "nanovg_gl_utils.h"
|
||||
|
||||
#include "json11.hpp"
|
||||
|
||||
#include "common/framebuffer.h"
|
||||
#include "common/touch.h"
|
||||
#include "common/utilpp.h"
|
||||
|
||||
#define USER_AGENT "NEOSUpdater-0.2"
|
||||
|
||||
#define MANIFEST_URL_EON_STAGING "https://github.com/commaai/eon-neos/raw/master/update.staging.json"
|
||||
#define MANIFEST_URL_EON_LOCAL "http://192.168.5.1:8000/neosupdate/update.local.json"
|
||||
#define MANIFEST_URL_EON "https://github.com/commaai/eon-neos/raw/master/update.json"
|
||||
const char *manifest_url = MANIFEST_URL_EON;
|
||||
|
||||
#define RECOVERY_DEV "/dev/block/bootdevice/by-name/recovery"
|
||||
#define RECOVERY_COMMAND "/cache/recovery/command"
|
||||
|
||||
#define UPDATE_DIR "/data/neoupdate"
|
||||
|
||||
extern const uint8_t bin_courbd[] asm("_binary_courbd_ttf_start");
|
||||
extern const uint8_t bin_courbd_end[] asm("_binary_courbd_ttf_end");
|
||||
|
||||
namespace {
|
||||
|
||||
std::string sha256_file(std::string fn, size_t limit=0) {
|
||||
SHA256_CTX ctx;
|
||||
SHA256_Init(&ctx);
|
||||
|
||||
FILE *file = fopen(fn.c_str(), "rb");
|
||||
if (!file) return "";
|
||||
|
||||
const size_t buf_size = 8192;
|
||||
std::unique_ptr<char[]> buffer( new char[ buf_size ] );
|
||||
|
||||
bool read_limit = (limit != 0);
|
||||
while (true) {
|
||||
size_t read_size = buf_size;
|
||||
if (read_limit) read_size = std::min(read_size, limit);
|
||||
size_t bytes_read = fread(buffer.get(), 1, read_size, file);
|
||||
if (!bytes_read) break;
|
||||
|
||||
SHA256_Update(&ctx, buffer.get(), bytes_read);
|
||||
|
||||
if (read_limit) {
|
||||
limit -= bytes_read;
|
||||
if (limit == 0) break;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t hash[SHA256_DIGEST_LENGTH];
|
||||
SHA256_Final(hash, &ctx);
|
||||
|
||||
fclose(file);
|
||||
|
||||
return util::tohex(hash, sizeof(hash));
|
||||
}
|
||||
|
||||
size_t download_string_write(void *ptr, size_t size, size_t nmeb, void *up) {
|
||||
size_t sz = size * nmeb;
|
||||
((std::string*)up)->append((char*)ptr, sz);
|
||||
return sz;
|
||||
}
|
||||
|
||||
std::string download_string(CURL *curl, std::string url) {
|
||||
std::string os;
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
|
||||
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_RESUME_FROM, 0);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, download_string_write);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &os);
|
||||
CURLcode res = curl_easy_perform(curl);
|
||||
if (res != CURLE_OK) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
size_t download_file_write(void *ptr, size_t size, size_t nmeb, void *up) {
|
||||
return fwrite(ptr, size, nmeb, (FILE*)up);
|
||||
}
|
||||
|
||||
bool check_battery() {
|
||||
std::string bat_cap_s = util::read_file("/sys/class/power_supply/battery/capacity");
|
||||
int bat_cap = atoi(bat_cap_s.c_str());
|
||||
std::string current_now_s = util::read_file("/sys/class/power_supply/battery/current_now");
|
||||
int current_now = atoi(current_now_s.c_str());
|
||||
return bat_cap > 35 || (current_now < 0 && bat_cap > 10);
|
||||
}
|
||||
|
||||
bool check_space() {
|
||||
struct statvfs stat;
|
||||
if (statvfs("/data/", &stat) != 0) {
|
||||
return false;
|
||||
}
|
||||
size_t space = stat.f_bsize * stat.f_bavail;
|
||||
return space > 2000000000ULL; // 2GB
|
||||
}
|
||||
|
||||
static void start_settings_activity(const char* name) {
|
||||
char launch_cmd[1024];
|
||||
snprintf(launch_cmd, sizeof(launch_cmd),
|
||||
"am start -W --ez :settings:show_fragment_as_subsetting true -n 'com.android.settings/.%s'", name);
|
||||
system(launch_cmd);
|
||||
}
|
||||
|
||||
struct Updater {
|
||||
bool do_exit = false;
|
||||
|
||||
TouchState touch;
|
||||
|
||||
int fb_w, fb_h;
|
||||
EGLDisplay display;
|
||||
EGLSurface surface;
|
||||
|
||||
FramebufferState *fb = NULL;
|
||||
NVGcontext *vg = NULL;
|
||||
int font;
|
||||
|
||||
std::thread update_thread_handle;
|
||||
|
||||
std::mutex lock;
|
||||
|
||||
// i hate state machines give me coroutines already
|
||||
enum UpdateState {
|
||||
CONFIRMATION,
|
||||
RUNNING,
|
||||
ERROR,
|
||||
};
|
||||
UpdateState state;
|
||||
|
||||
std::string progress_text;
|
||||
float progress_frac;
|
||||
|
||||
std::string error_text;
|
||||
|
||||
// button
|
||||
int b_x, b_w, b_y, b_h;
|
||||
int balt_x;
|
||||
|
||||
CURL *curl = NULL;
|
||||
|
||||
Updater() {
|
||||
touch_init(&touch);
|
||||
|
||||
fb = framebuffer_init("updater", 0x00001000, false,
|
||||
&display, &surface, &fb_w, &fb_h);
|
||||
assert(fb);
|
||||
|
||||
vg = nvgCreateGLES3(NVG_ANTIALIAS | NVG_STENCIL_STROKES | NVG_DEBUG);
|
||||
assert(vg);
|
||||
font = nvgCreateFontMem(vg, "courbd", (unsigned char*)bin_courbd, (bin_courbd_end - bin_courbd), 0);
|
||||
assert(font >= 0);
|
||||
|
||||
b_w = 600;
|
||||
balt_x = 200;
|
||||
b_x = fb_w-b_w-200;
|
||||
b_y = 700;
|
||||
b_h = 250;
|
||||
|
||||
state = CONFIRMATION;
|
||||
|
||||
}
|
||||
|
||||
int download_file_xferinfo(curl_off_t dltotal, curl_off_t dlno,
|
||||
curl_off_t ultotal, curl_off_t ulnow) {
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
if (dltotal != 0) {
|
||||
progress_frac = (float) dlno / dltotal;
|
||||
}
|
||||
}
|
||||
// printf("info: %ld %ld %f\n", dltotal, dlno, progress_frac);
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool download_file(std::string url, std::string out_fn) {
|
||||
FILE *of = fopen(out_fn.c_str(), "ab");
|
||||
assert(of);
|
||||
|
||||
CURLcode res;
|
||||
long last_resume_from = 0;
|
||||
|
||||
fseek(of, 0, SEEK_END);
|
||||
|
||||
int tries = 4;
|
||||
|
||||
bool ret = false;
|
||||
|
||||
while (true) {
|
||||
long resume_from = ftell(of);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
|
||||
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_RESUME_FROM, resume_from);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, download_file_write);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, of);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_XFERINFODATA, this);
|
||||
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, &Updater::download_file_xferinfo);
|
||||
|
||||
CURLcode res = curl_easy_perform(curl);
|
||||
|
||||
long response_code = 0;
|
||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
|
||||
|
||||
// double content_length = 0.0;
|
||||
// curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &content_length);
|
||||
|
||||
printf("download %s res %d, code %ld, resume from %ld\n", url.c_str(), res, response_code, resume_from);
|
||||
if (res == CURLE_OK) {
|
||||
ret = true;
|
||||
break;
|
||||
} else if (res == CURLE_HTTP_RETURNED_ERROR && response_code == 416) {
|
||||
// failed because the file is already complete?
|
||||
ret = true;
|
||||
break;
|
||||
} else if (resume_from == last_resume_from) {
|
||||
// failed and dind't make make forward progress. only retry a couple times
|
||||
tries--;
|
||||
if (tries <= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
last_resume_from = resume_from;
|
||||
}
|
||||
// printf("res %d\n", res);
|
||||
|
||||
// printf("- %ld %f\n", response_code, content_length);
|
||||
|
||||
fclose(of);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void set_progress(std::string text) {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
progress_text = text;
|
||||
}
|
||||
|
||||
void set_error(std::string text) {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
error_text = text;
|
||||
state = ERROR;
|
||||
}
|
||||
|
||||
std::string stage_download(std::string url, std::string hash, std::string name) {
|
||||
std::string out_fn = UPDATE_DIR "/" + util::base_name(url);
|
||||
|
||||
set_progress("downloading " + name + "...");
|
||||
bool r = download_file(url, out_fn);
|
||||
if (!r) {
|
||||
set_error("failed to download " + name);
|
||||
return "";
|
||||
}
|
||||
|
||||
set_progress("verifying " + name + "...");
|
||||
std::string fn_hash = sha256_file(out_fn);
|
||||
printf("got %s hash: %s\n", name.c_str(), hash.c_str());
|
||||
if (fn_hash != hash) {
|
||||
set_error(name + " was corrupt");
|
||||
unlink(out_fn.c_str());
|
||||
return "";
|
||||
}
|
||||
|
||||
return out_fn;
|
||||
}
|
||||
|
||||
void run_stages() {
|
||||
curl = curl_easy_init();
|
||||
assert(curl);
|
||||
|
||||
if (!check_battery()) {
|
||||
set_error("Please plug power in to your EON and wait for charge");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!check_space()) {
|
||||
set_error("2GB of free space required to update");
|
||||
return;
|
||||
}
|
||||
|
||||
mkdir(UPDATE_DIR, 0777);
|
||||
|
||||
const int EON = (access("/EON", F_OK) != -1);
|
||||
|
||||
set_progress("finding latest version...");
|
||||
std::string manifest_s;
|
||||
if (EON) {
|
||||
manifest_s = download_string(curl, manifest_url);
|
||||
} else {
|
||||
// don't update NEO
|
||||
exit(0);
|
||||
}
|
||||
|
||||
printf("manifest: %s\n", manifest_s.c_str());
|
||||
|
||||
std::string err;
|
||||
auto manifest = json11::Json::parse(manifest_s, err);
|
||||
if (manifest.is_null() || !err.empty()) {
|
||||
set_error("failed to load update manifest");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string ota_url = manifest["ota_url"].string_value();
|
||||
std::string ota_hash = manifest["ota_hash"].string_value();
|
||||
|
||||
std::string recovery_url = manifest["recovery_url"].string_value();
|
||||
std::string recovery_hash = manifest["recovery_hash"].string_value();
|
||||
int recovery_len = manifest["recovery_len"].int_value();
|
||||
|
||||
// std::string installer_url = manifest["installer_url"].string_value();
|
||||
// std::string installer_hash = manifest["installer_hash"].string_value();
|
||||
|
||||
if (ota_url.empty() || ota_hash.empty()) {
|
||||
set_error("invalid update manifest");
|
||||
return;
|
||||
}
|
||||
|
||||
// std::string installer_fn = stage_download(installer_url, installer_hash, "installer");
|
||||
// if (installer_fn.empty()) {
|
||||
// //error'd
|
||||
// return;
|
||||
// }
|
||||
|
||||
std::string recovery_fn;
|
||||
if (recovery_url.empty() || recovery_hash.empty() || recovery_len == 0) {
|
||||
set_progress("skipping recovery flash...");
|
||||
} else {
|
||||
// only download the recovery if it differs from what's flashed
|
||||
set_progress("checking recovery...");
|
||||
std::string existing_recovery_hash = sha256_file(RECOVERY_DEV, recovery_len);
|
||||
printf("existing recovery hash: %s\n", existing_recovery_hash.c_str());
|
||||
|
||||
if (existing_recovery_hash != recovery_hash) {
|
||||
recovery_fn = stage_download(recovery_url, recovery_hash, "recovery");
|
||||
if (recovery_fn.empty()) {
|
||||
// error'd
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string ota_fn = stage_download(ota_url, ota_hash, "update");
|
||||
if (ota_fn.empty()) {
|
||||
//error'd
|
||||
return;
|
||||
}
|
||||
|
||||
if (!check_battery()) {
|
||||
set_error("must have at least 35% battery to update");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!recovery_fn.empty()) {
|
||||
// flash recovery
|
||||
set_progress("flashing recovery...");
|
||||
|
||||
FILE *flash_file = fopen(recovery_fn.c_str(), "rb");
|
||||
if (!flash_file) {
|
||||
set_error("failed to flash recovery");
|
||||
return;
|
||||
}
|
||||
|
||||
FILE *recovery_dev = fopen(RECOVERY_DEV, "w+b");
|
||||
if (!recovery_dev) {
|
||||
fclose(flash_file);
|
||||
set_error("failed to flash recovery");
|
||||
return;
|
||||
}
|
||||
|
||||
const size_t buf_size = 4096;
|
||||
std::unique_ptr<char[]> buffer( new char[ buf_size ] );
|
||||
|
||||
while (true) {
|
||||
size_t bytes_read = fread(buffer.get(), 1, buf_size, flash_file);
|
||||
if (!bytes_read) break;
|
||||
|
||||
size_t bytes_written = fwrite(buffer.get(), 1, bytes_read, recovery_dev);
|
||||
if (bytes_read != bytes_written) {
|
||||
fclose(recovery_dev);
|
||||
fclose(flash_file);
|
||||
set_error("failed to flash recovery: write failed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
fclose(recovery_dev);
|
||||
fclose(flash_file);
|
||||
|
||||
set_progress("verifying flash...");
|
||||
std::string new_recovery_hash = sha256_file(RECOVERY_DEV, recovery_len);
|
||||
printf("new recovery hash: %s\n", new_recovery_hash.c_str());
|
||||
|
||||
if (new_recovery_hash != recovery_hash) {
|
||||
set_error("recovery flash corrupted");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// write arguments to recovery
|
||||
FILE *cmd_file = fopen(RECOVERY_COMMAND, "wb");
|
||||
if (!cmd_file) {
|
||||
set_error("failed to reboot into recovery");
|
||||
return;
|
||||
}
|
||||
fprintf(cmd_file, "--update_package=%s\n", ota_fn.c_str());
|
||||
fclose(cmd_file);
|
||||
|
||||
set_progress("rebooting");
|
||||
|
||||
// remove the continue.sh so we come back into the setup.
|
||||
// maybe we should go directly into the installer, but what if we don't come back with internet? :/
|
||||
//unlink("/data/data/com.termux/files/continue.sh");
|
||||
|
||||
// TODO: this should be generic between android versions
|
||||
// IPowerManager.reboot(confirm=false, reason="recovery", wait=true)
|
||||
system("service call power 16 i32 0 s16 recovery i32 1");
|
||||
while(1) pause();
|
||||
|
||||
// execl("/system/bin/reboot", "recovery");
|
||||
// set_error("failed to reboot into recovery");
|
||||
}
|
||||
|
||||
void draw_ack_screen(const char *message, const char *button, const char *altbutton) {
|
||||
nvgFontSize(vg, 96.0f);
|
||||
nvgFillColor(vg, nvgRGBA(255,255,255,255));
|
||||
nvgTextAlign(vg, NVG_ALIGN_LEFT | NVG_ALIGN_BASELINE);
|
||||
nvgTextBox(vg, 50, 100, fb_w-100, message, NULL);
|
||||
|
||||
// draw button
|
||||
if (button) {
|
||||
nvgBeginPath(vg);
|
||||
nvgFillColor(vg, nvgRGBA(0, 0, 0, 255));
|
||||
nvgRoundedRect(vg, b_x, b_y, b_w, b_h, 20);
|
||||
nvgFill(vg);
|
||||
|
||||
nvgFillColor(vg, nvgRGBA(255, 255, 255, 255));
|
||||
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
|
||||
nvgText(vg, b_x+b_w/2, b_y+b_h/2, button, NULL);
|
||||
|
||||
nvgBeginPath(vg);
|
||||
nvgStrokeColor(vg, nvgRGBA(255, 255, 255, 255));
|
||||
nvgStrokeWidth(vg, 5);
|
||||
nvgRoundedRect(vg, b_x, b_y, b_w, b_h, 20);
|
||||
nvgStroke(vg);
|
||||
}
|
||||
|
||||
// draw button
|
||||
if (altbutton) {
|
||||
nvgBeginPath(vg);
|
||||
nvgFillColor(vg, nvgRGBA(0, 0, 0, 255));
|
||||
nvgRoundedRect(vg, balt_x, b_y, b_w, b_h, 20);
|
||||
nvgFill(vg);
|
||||
|
||||
nvgFillColor(vg, nvgRGBA(255, 255, 255, 255));
|
||||
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
|
||||
nvgText(vg, balt_x+b_w/2, b_y+b_h/2, altbutton, NULL);
|
||||
|
||||
nvgBeginPath(vg);
|
||||
nvgStrokeColor(vg, nvgRGBA(255, 255, 255, 255));
|
||||
nvgStrokeWidth(vg, 5);
|
||||
nvgRoundedRect(vg, balt_x, b_y, b_w, b_h, 20);
|
||||
nvgStroke(vg);
|
||||
}
|
||||
}
|
||||
|
||||
void draw_progress_screen() {
|
||||
// draw progress message
|
||||
nvgFontSize(vg, 64.0f);
|
||||
nvgFillColor(vg, nvgRGBA(255,255,255,255));
|
||||
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
|
||||
nvgTextBox(vg, 0, 700, fb_w, progress_text.c_str(), NULL);
|
||||
|
||||
// draw progress bar
|
||||
{
|
||||
int progress_width = 800;
|
||||
int progress_x = fb_w/2-progress_width/2;
|
||||
int progress_y = 768;
|
||||
int progress_height = 15;
|
||||
|
||||
int powerprompt_y = 512;
|
||||
nvgText(vg, fb_w/2, powerprompt_y, "Ensure EON is connected to power", NULL);
|
||||
|
||||
NVGpaint paint = nvgBoxGradient(
|
||||
vg, progress_x + 1, progress_y + 1,
|
||||
progress_width - 2, progress_height, 3, 4, nvgRGB(0, 32, 0), nvgRGB(0, 92, 0));
|
||||
nvgBeginPath(vg);
|
||||
nvgRoundedRect(vg, progress_x, progress_y, progress_width, progress_height, 3);
|
||||
nvgFillPaint(vg, paint);
|
||||
nvgFill(vg);
|
||||
|
||||
float value = std::min(std::max(0.0f, progress_frac), 1.0f);
|
||||
int bar_pos = ((progress_width - 2) * value);
|
||||
|
||||
paint = nvgBoxGradient(
|
||||
vg, progress_x, progress_y,
|
||||
bar_pos+1.5f, progress_height-1, 3, 4,
|
||||
nvgRGB(220, 100, 0), nvgRGB(128, 100, 0));
|
||||
|
||||
nvgBeginPath(vg);
|
||||
nvgRoundedRect(
|
||||
vg, progress_x+1, progress_y+1,
|
||||
bar_pos, progress_height-2, 3);
|
||||
nvgFillPaint(vg, paint);
|
||||
nvgFill(vg);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_draw() {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
|
||||
nvgBeginFrame(vg, fb_w, fb_h, 1.0f);
|
||||
|
||||
switch (state) {
|
||||
case CONFIRMATION:
|
||||
draw_ack_screen("An upgrade to NEOS is required.\n\n"
|
||||
"Your device will now be reset and upgraded. You may want to connect to wifi as download is around 1 GB\nData on device shouldn't be lost.",
|
||||
"continue",
|
||||
"wifi");
|
||||
break;
|
||||
case RUNNING:
|
||||
draw_progress_screen();
|
||||
break;
|
||||
case ERROR:
|
||||
draw_ack_screen(("ERROR: " + error_text + "\n\nYou will need to retry").c_str(), NULL, "exit");
|
||||
break;
|
||||
}
|
||||
|
||||
nvgEndFrame(vg);
|
||||
}
|
||||
|
||||
void ui_update() {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
|
||||
switch (state) {
|
||||
case ERROR:
|
||||
case CONFIRMATION: {
|
||||
int touch_x = -1, touch_y = -1;
|
||||
int res = touch_poll(&touch, &touch_x, &touch_y, 0);
|
||||
if (res == 1 && !is_settings_active()) {
|
||||
if (touch_x >= b_x && touch_x < b_x+b_w && touch_y >= b_y && touch_y < b_y+b_h) {
|
||||
if (state == CONFIRMATION) {
|
||||
state = RUNNING;
|
||||
update_thread_handle = std::thread(&Updater::run_stages, this);
|
||||
}
|
||||
}
|
||||
if (touch_x >= balt_x && touch_x < balt_x+b_w && touch_y >= b_y && touch_y < b_y+b_h) {
|
||||
if (state == CONFIRMATION) {
|
||||
start_settings_activity("Settings$WifiSettingsActivity");
|
||||
} else if (state == ERROR) {
|
||||
do_exit = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void go() {
|
||||
while (!do_exit) {
|
||||
ui_update();
|
||||
|
||||
glClearColor(0.19, 0.09, 0.2, 1.0);
|
||||
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
ui_draw();
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
eglSwapBuffers(display, surface);
|
||||
assert(glGetError() == GL_NO_ERROR);
|
||||
|
||||
// no simple way to do 30fps vsync with surfaceflinger...
|
||||
usleep(30000);
|
||||
}
|
||||
|
||||
if (update_thread_handle.joinable()) {
|
||||
update_thread_handle.join();
|
||||
}
|
||||
|
||||
system("service call power 16 i32 0 i32 0 i32 1");
|
||||
}
|
||||
|
||||
bool is_settings_active() {
|
||||
FILE *fp;
|
||||
char sys_output[4096];
|
||||
|
||||
fp = popen("/bin/dumpsys window windows", "r");
|
||||
if (fp == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool active = false;
|
||||
while (fgets(sys_output, sizeof(sys_output), fp) != NULL) {
|
||||
if (strstr(sys_output, "mCurrentFocus=null") != NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (strstr(sys_output, "mCurrentFocus=Window") != NULL) {
|
||||
active = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pclose(fp);
|
||||
|
||||
return active;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
int main(int argc, char *argv[]) {
|
||||
if (argc > 1) {
|
||||
if (strcmp(argv[1], "local") == 0) {
|
||||
manifest_url = MANIFEST_URL_EON_LOCAL;
|
||||
} else if (strcmp(argv[1], "staging") == 0) {
|
||||
manifest_url = MANIFEST_URL_EON_STAGING;
|
||||
} else {
|
||||
manifest_url = argv[1];
|
||||
}
|
||||
}
|
||||
printf("updating from %s\n", manifest_url);
|
||||
Updater updater;
|
||||
updater.go();
|
||||
|
||||
return 0;
|
||||
}
|
||||
47
launch_chffrplus.sh
Executable file
47
launch_chffrplus.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
export OMP_NUM_THREADS=1
|
||||
export MKL_NUM_THREADS=1
|
||||
export NUMEXPR_NUM_THREADS=1
|
||||
export OPENBLAS_NUM_THREADS=1
|
||||
export VECLIB_MAXIMUM_THREADS=1
|
||||
|
||||
if [ -z "$PASSIVE" ]; then
|
||||
export PASSIVE="1"
|
||||
fi
|
||||
|
||||
function launch {
|
||||
# apply update
|
||||
# if [ "$(git rev-parse HEAD)" != "$(git rev-parse @{u})" ]; then
|
||||
# git reset --hard @{u} &&
|
||||
# git clean -xdf &&
|
||||
#
|
||||
# # Touch all files on release2 after checkout to prevent rebuild
|
||||
# BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
||||
# if [[ "$BRANCH" == "release2" ]]; then
|
||||
# touch **
|
||||
# fi
|
||||
#
|
||||
# exec "${BASH_SOURCE[0]}"
|
||||
# fi
|
||||
|
||||
# no cpu rationing for now
|
||||
echo 0-3 > /dev/cpuset/background/cpus
|
||||
echo 0-3 > /dev/cpuset/system-background/cpus
|
||||
echo 0-3 > /dev/cpuset/foreground/boost/cpus
|
||||
echo 0-3 > /dev/cpuset/foreground/cpus
|
||||
echo 0-3 > /dev/cpuset/android/cpus
|
||||
|
||||
# handle pythonpath
|
||||
ln -s /data/openpilot /data/pythonpath
|
||||
export PYTHONPATH="$PWD"
|
||||
|
||||
# start manager
|
||||
cd selfdrive
|
||||
./manager.py
|
||||
|
||||
# if broken, keep on screen error
|
||||
while true; do sleep 1; done
|
||||
}
|
||||
|
||||
launch
|
||||
6
launch_openpilot.sh
Executable file
6
launch_openpilot.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
/usr/bin/sh /data/openpilot/dragonpilot/chinese-fonts/installer.sh &
|
||||
export PASSIVE="0"
|
||||
exec ./launch_chffrplus.sh
|
||||
|
||||
BIN
models/driving_model.dlc
Normal file
BIN
models/driving_model.dlc
Normal file
Binary file not shown.
BIN
models/monitoring_model.dlc
Normal file
BIN
models/monitoring_model.dlc
Normal file
Binary file not shown.
BIN
models/posenet.dlc
Normal file
BIN
models/posenet.dlc
Normal file
Binary file not shown.
1
opendbc
1
opendbc
Submodule opendbc deleted from b77861eb00
2
opendbc/.gitignore
vendored
Normal file
2
opendbc/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
*.pyc
|
||||
.*.swp
|
||||
1080
opendbc/ESR.dbc
Normal file
1080
opendbc/ESR.dbc
Normal file
File diff suppressed because it is too large
Load Diff
53
opendbc/README.md
Normal file
53
opendbc/README.md
Normal file
@@ -0,0 +1,53 @@
|
||||
opendbc
|
||||
======
|
||||
|
||||
The project to democratize access to the decoder ring of your car.
|
||||
|
||||
|
||||
|
||||
### DBC file basics
|
||||
|
||||
A DBC file encodes, in a humanly readable way, the information needed to understand a vehicle's CAN bus traffic. A vehicle might have multiple CAN buses and every CAN bus is represented by its own dbc file.
|
||||
Wondering what's the DBC file format? [Here](http://www.socialledge.com/sjsu/index.php?title=DBC_Format) and [Here](https://github.com/stefanhoelzl/CANpy/blob/master/docs/DBC_Specification.md) a couple of good overviews.
|
||||
|
||||
### How to start reverse engineering cars
|
||||
|
||||
[opendbc](https://github.com/commaai/opendbc) is integrated with [cabana](https://community.comma.ai/cabana/).
|
||||
|
||||
Use [panda](https://github.com/commaai/panda) to connect your car to a computer.
|
||||
|
||||
### DBC file preprocessor
|
||||
|
||||
DBC files for different models of the same brand have a lot of overlap. Therefore, we wrote a preprocessor to create DBC files from a brand DBC file and a model specific DBC file. The source DBC files can be found in the generator folder. After changing one of the files run the generator.py script to regenerate the output files. These output files will be placed in the root of the opendbc repository and are suffixed by _generated.
|
||||
|
||||
### Good practices for contributing to opendbc
|
||||
|
||||
- Comments: the best way to store comments is to add them directly to the DBC files. For example:
|
||||
```
|
||||
CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
|
||||
```
|
||||
is a comment that refers to signal `LONG_ACCEL` in message `490`. Using comments is highly recommended, especially for doubts and uncertainties. [cabana](https://community.comma.ai/cabana/) can easily display/add/edit comments to signals and messages.
|
||||
|
||||
- Units: when applicable, it's recommended to convert signals into physical units, by using a proper signal factor. Using a SI unit is preferred, unless a non-SI unit rounds the signal factor much better.
|
||||
For example:
|
||||
```
|
||||
SG_ VEHICLE_SPEED : 7|15@0+ (0.00278,0) [0|70] "m/s" PCM
|
||||
```
|
||||
is better than:
|
||||
```
|
||||
SG_ VEHICLE_SPEED : 7|15@0+ (0.00620,0) [0|115] "mph" PCM
|
||||
```
|
||||
However, the cleanest option is really:
|
||||
```
|
||||
SG_ VEHICLE_SPEED : 7|15@0+ (0.01,0) [0|250] "kph" PCM
|
||||
```
|
||||
|
||||
- Signal's size: always use the smallest amount of bits possible. For example, let's say I'm reverse engineering the gas pedal position and I've determined that it's in a 3 bytes message. For 0% pedal position I read a message value of `0x00 0x00 0x00`, while for 100% of pedal position I read `0x64 0x00 0x00`: clearly, the gas pedal position is within the first byte of the message and I might be tempted to define the signal `GAS_POS` as:
|
||||
```
|
||||
SG_ GAS_POS : 7|8@0+ (1,0) [0|100] "%" PCM
|
||||
```
|
||||
However, I can't be sure that the very first bit of the message is referred to the pedal position: I haven't seen it changing! Therefore, a safer way of defining the signal is:
|
||||
```
|
||||
SG_ GAS_POS : 6|7@0+ (1,0) [0|100] "%" PCM
|
||||
```
|
||||
which leaves the first bit unallocated. This prevents from very erroneous reading of the gas pedal position, in case the first bit is indeed used for something else.
|
||||
2
opendbc/__init__.py
Normal file
2
opendbc/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
import os
|
||||
DBC_PATH = os.path.dirname(os.path.abspath(__file__))
|
||||
310
opendbc/acura_ilx_2016_can_generated.dbc
Normal file
310
opendbc/acura_ilx_2016_can_generated.dbc
Normal file
@@ -0,0 +1,310 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
|
||||
|
||||
CM_ "Imported file _comma.dbc starts here"
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR
|
||||
SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR
|
||||
SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR
|
||||
|
||||
BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
|
||||
SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-83.3) [0|1] "" EON
|
||||
SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" EON
|
||||
SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON
|
||||
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
|
||||
|
||||
CM_ "Imported file _honda_2017.dbc starts here"
|
||||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BU_: EBCM ADAS PCM EPS VSA SCM BDY XXX EPB EON
|
||||
|
||||
BO_ 344 ENGINE_DATA: 8 PCM
|
||||
SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON
|
||||
SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 380 POWERTRAIN_DATA: 8 PCM
|
||||
SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON
|
||||
SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 420 VSA_STATUS: 8 VSA
|
||||
SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON
|
||||
SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 432 STANDSTILL: 7 VSA
|
||||
SG_ CONTROLLED_STANDSTILL : 0|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 464 WHEEL_SPEEDS: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 490 VEHICLE_DYNAMICS: 8 VSA
|
||||
SG_ LONG_ACCEL : 23|16@0- (0.0015384,0) [-20|20] "m/s2" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 506 BRAKE_COMMAND: 8 ADAS
|
||||
SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ SET_ME_0X80 : 31|8@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM
|
||||
SG_ ZEROS_BOH6 : 44|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ FCW : 43|2@0+ (1,0) [0|3] "" EBCM
|
||||
SG_ ZEROS_BOH4 : 55|8@0+ (1,0) [0|0] "" EBCM
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EBCM
|
||||
|
||||
BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 773 SEATBELT_STATUS: 7 BDY
|
||||
SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 777 LOCK_STATUS: 8 XXX
|
||||
SG_ DOORS_UNLOCKED : 54|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOORS_LOCKED : 55|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ PCM_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" BDY
|
||||
SG_ PCM_GAS : 23|8@0+ (1,0) [0|127] "" BDY
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH_2 : 35|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X01 : 48|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY
|
||||
|
||||
BO_ 804 CRUISE: 8 PCM
|
||||
SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON
|
||||
SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON
|
||||
SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON
|
||||
SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 829 LKAS_HUD: 5 ADAS
|
||||
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
|
||||
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
|
||||
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY
|
||||
|
||||
BO_ 892 CRUISE_PARAMS: 8 PCM
|
||||
SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 1029 DOORS_STATUS: 8 BDY
|
||||
SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
|
||||
CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light";
|
||||
CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light";
|
||||
CM_ SG_ 780 CRUISE_SPEED "255 = no speed";
|
||||
CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed";
|
||||
CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc...";
|
||||
|
||||
|
||||
VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw" ;
|
||||
VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime" ;
|
||||
VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "acura_ilx_2016_can.dbc starts here"
|
||||
|
||||
|
||||
|
||||
BO_ 145 KINEMATICS: 8 XXX
|
||||
SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON
|
||||
|
||||
BO_ 228 STEERING_CONTROL: 5 ADAS
|
||||
SG_ STEER_TORQUE : 7|16@0- (1,0) [-3840|3840] "" EPS
|
||||
SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS
|
||||
SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|0] "" EPS
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" EPS
|
||||
|
||||
BO_ 304 GAS_PEDAL_2: 8 PCM
|
||||
SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON
|
||||
SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON
|
||||
SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON
|
||||
|
||||
BO_ 316 GAS_PEDAL: 8 PCM
|
||||
SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON
|
||||
|
||||
BO_ 342 STEERING_SENSORS: 6 EPS
|
||||
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
|
||||
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
|
||||
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 399 STEER_STATUS: 7 EPS
|
||||
SG_ STEER_TORQUE_SENSOR : 7|16@0- (1,0) [-31000|31000] "tbd" EON
|
||||
SG_ STEER_TORQUE_MOTOR : 23|16@0- (1,0) [-31000|31000] "tbd" EON
|
||||
SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 419 GEARBOX: 8 PCM
|
||||
SG_ GEAR : 7|8@0+ (1,0) [0|256] "" EON
|
||||
SG_ GEAR_SHIFTER : 35|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 422 SCM_BUTTONS: 8 SCM
|
||||
SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON
|
||||
SG_ LIGHTS_SETTING : 1|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ MAIN_ON : 47|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ CRUISE_SETTING : 43|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 660 SCM_FEEDBACK: 8 SCM
|
||||
SG_ RIGHT_BLINKER : 6|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ LEFT_BLINKER : 5|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ WIPERS_SPEED : 4|2@0+ (1,0) [0|3] "" EON
|
||||
|
||||
CM_ SG_ 419 GEAR "10 = reverse, 11 = transition";
|
||||
CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
|
||||
CM_ SG_ 780 CRUISE_SPEED "255 = no speed";
|
||||
CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed";
|
||||
CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc...";
|
||||
|
||||
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
VAL_ 419 GEAR_SHIFTER 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
|
||||
VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
|
||||
VAL_ 422 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights" ;
|
||||
VAL_ 422 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ;
|
||||
VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime" ;
|
||||
VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw" ;
|
||||
VAL_ 780 HUD_LEAD 3 "no_car" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "CHFFR_METRIC 342 STEER_ANGLE STEER_ANGLE 0.36 180; CHFFR_METRIC 380 ENGINE_RPM ENGINE_RPM 1 0; CHFFR_METRIC 804 ENGINE_TEMPERATURE ENGINE_TEMPERATURE 1 0";
|
||||
185
opendbc/acura_ilx_2016_nidec.dbc
Normal file
185
opendbc/acura_ilx_2016_nidec.dbc
Normal file
@@ -0,0 +1,185 @@
|
||||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BS_:
|
||||
|
||||
BU_: ADAS RADAR NEO XXX
|
||||
|
||||
|
||||
BO_ 768 VEHICLE_STATE: 8 ADAS
|
||||
SG_ SET_ME_XF9 : 7|8@0+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ VEHICLE_SPEED : 15|8@0+ (1,0) [0|255] "kph" Vector__XXX
|
||||
|
||||
BO_ 769 VEHICLE_STATE2: 8 ADAS
|
||||
SG_ SET_ME_0F18510 : 7|28@0+ (1,0) [0|268435455] "" Vector__XXX
|
||||
SG_ SET_ME_25A0000 : 27|28@0+ (1,0) [0|268435455] "" Vector__XXX
|
||||
|
||||
BO_ 1024 RADAR_DIAGNOSTIC: 8 RADAR
|
||||
SG_ RADAR_STATE : 7|8@0+ (1,0) [0|255] "" NEO
|
||||
|
||||
BO_ 1040 XXX_101: 8 RADAR
|
||||
|
||||
BO_ 1041 XXX_102: 8 RADAR
|
||||
|
||||
BO_ 1042 XXX_103: 8 RADAR
|
||||
|
||||
BO_ 1043 XXX_104: 8 RADAR
|
||||
|
||||
BO_ 1044 XXX_105: 8 RADAR
|
||||
|
||||
BO_ 1045 XXX_106: 8 RADAR
|
||||
|
||||
BO_ 1046 XXX_107: 8 RADAR
|
||||
|
||||
BO_ 1047 XXX_108: 8 RADAR
|
||||
|
||||
BO_ 1056 XXX_109: 8 RADAR
|
||||
|
||||
BO_ 1057 XXX_110: 8 RADAR
|
||||
|
||||
BO_ 1058 XXX_111: 8 RADAR
|
||||
|
||||
BO_ 1059 XXX_112: 8 RADAR
|
||||
|
||||
BO_ 1060 XXX_113: 8 RADAR
|
||||
|
||||
BO_ 1072 TRACK_0: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1073 TRACK_1: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1074 TRACK_2: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1075 TRACK_3: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1076 TRACK_4: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1077 TRACK_5: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1078 TRACK_6: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1079 TRACK_7: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1080 TRACK_8: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1081 TRACK_9: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1088 TRACK_10: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1089 TRACK_11: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1090 TRACK_12: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1091 TRACK_13: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1092 TRACK_14: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1093 TRACK_15: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1279 XXX_114: 8 RADAR
|
||||
|
||||
BO_ 1280 XXX_115: 8 RADAR
|
||||
|
||||
BO_ 1296 XXX_116: 8 RADAR
|
||||
|
||||
BO_ 1297 XXX_117: 8 RADAR
|
||||
|
||||
BO_TX_BU_ 768 : NEO,ADAS;
|
||||
BO_TX_BU_ 769 : NEO,ADAS;
|
||||
|
||||
|
||||
CM_ SG_ 1024 RADAR_STATE "need to find out more diagnostic values";
|
||||
VAL_ 1024 RADAR_STATE 121 "ok" 110 "faulted" 105 "wrong_config";
|
||||
298
opendbc/acura_rdx_2018_can_generated.dbc
Normal file
298
opendbc/acura_rdx_2018_can_generated.dbc
Normal file
@@ -0,0 +1,298 @@
|
||||
CM_ "AUTOGENERATED FILE, DO NOT EDIT"
|
||||
|
||||
|
||||
CM_ "Imported file _comma.dbc starts here"
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR
|
||||
SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR
|
||||
SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR
|
||||
|
||||
BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
|
||||
SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-83.3) [0|1] "" EON
|
||||
SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" EON
|
||||
SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON
|
||||
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
|
||||
|
||||
CM_ "Imported file _honda_2017.dbc starts here"
|
||||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BU_: EBCM ADAS PCM EPS VSA SCM BDY XXX EPB EON
|
||||
|
||||
BO_ 344 ENGINE_DATA: 8 PCM
|
||||
SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON
|
||||
SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 380 POWERTRAIN_DATA: 8 PCM
|
||||
SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON
|
||||
SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 420 VSA_STATUS: 8 VSA
|
||||
SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON
|
||||
SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 432 STANDSTILL: 7 VSA
|
||||
SG_ CONTROLLED_STANDSTILL : 0|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 464 WHEEL_SPEEDS: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 490 VEHICLE_DYNAMICS: 8 VSA
|
||||
SG_ LONG_ACCEL : 23|16@0- (0.0015384,0) [-20|20] "m/s2" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 506 BRAKE_COMMAND: 8 ADAS
|
||||
SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ SET_ME_0X80 : 31|8@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM
|
||||
SG_ ZEROS_BOH6 : 44|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ FCW : 43|2@0+ (1,0) [0|3] "" EBCM
|
||||
SG_ ZEROS_BOH4 : 55|8@0+ (1,0) [0|0] "" EBCM
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EBCM
|
||||
|
||||
BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 773 SEATBELT_STATUS: 7 BDY
|
||||
SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 777 LOCK_STATUS: 8 XXX
|
||||
SG_ DOORS_UNLOCKED : 54|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOORS_LOCKED : 55|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ PCM_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" BDY
|
||||
SG_ PCM_GAS : 23|8@0+ (1,0) [0|127] "" BDY
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH_2 : 35|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X01 : 48|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY
|
||||
|
||||
BO_ 804 CRUISE: 8 PCM
|
||||
SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON
|
||||
SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON
|
||||
SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON
|
||||
SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 829 LKAS_HUD: 5 ADAS
|
||||
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
|
||||
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
|
||||
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY
|
||||
|
||||
BO_ 892 CRUISE_PARAMS: 8 PCM
|
||||
SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 1029 DOORS_STATUS: 8 BDY
|
||||
SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
|
||||
CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light";
|
||||
CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light";
|
||||
CM_ SG_ 780 CRUISE_SPEED "255 = no speed";
|
||||
CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed";
|
||||
CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc...";
|
||||
|
||||
|
||||
VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw" ;
|
||||
VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime" ;
|
||||
VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "acura_rdx_2018_can.dbc starts here"
|
||||
|
||||
|
||||
|
||||
BO_ 342 STEERING_SENSORS: 6 EPS
|
||||
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
|
||||
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
|
||||
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 392 GEARBOX: 6 XXX
|
||||
SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ GEAR_SHIFTER : 27|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ GEAR : 36|5@0+ (1,0) [0|31] "" EON
|
||||
|
||||
BO_ 399 STEER_STATUS: 6 EPS
|
||||
SG_ STEER_TORQUE_SENSOR : 7|12@0- (1,0) [-2047.5|2047.5] "tbd" EON
|
||||
SG_ STEER_TORQUE_MOTOR : 23|16@0- (1,0) [-31000|31000] "tbd" EON
|
||||
SG_ STEER_STATUS : 35|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ STEER_CONTROL_ACTIVE : 36|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 404 STEERING_CONTROL: 4 EON
|
||||
SG_ STEER_TORQUE : 7|12@0- (1,0) [-768|768] "" EPS
|
||||
SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS
|
||||
SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS
|
||||
SG_ COUNTER : 29|2@0+ (1,0) [0|15] "" EPS
|
||||
SG_ CHECKSUM : 27|4@0+ (1,0) [0|3] "" EPS
|
||||
|
||||
BO_ 422 SCM_BUTTONS: 8 SCM
|
||||
SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON
|
||||
SG_ LIGHTS_SETTING : 1|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ PARKING_BRAKE_LIGHT : 2|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ MAIN_ON : 47|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ CRUISE_SETTING : 43|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 487 BRAKE_PRESSURE: 4 VSA
|
||||
SG_ BRAKE_PRESSURE1 : 7|10@0+ (0.015625,-103) [0|1000] "" EON
|
||||
SG_ BRAKE_PRESSURE2 : 9|10@0+ (0.015625,-103) [0|1000] "" EON
|
||||
SG_ COUNTER : 29|2@0+ (1,0) [0|15] "" EON
|
||||
SG_ CHECKSUM : 27|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 660 SCM_FEEDBACK: 8 SCM
|
||||
SG_ RIGHT_BLINKER : 6|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ LEFT_BLINKER : 5|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ WIPERS_SPEED : 4|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
CM_ SG_ 422 PARKING_BRAKE_LIGHT "Believe this is just the dash light for the parking break";
|
||||
VAL_ 392 GEAR_SHIFTER 0 "S" 1 "P" 2 "R" 4 "N" 8 "D" ;
|
||||
VAL_ 392 GEAR 26 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
|
||||
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
|
||||
|
||||
CM_ "CHFFR_METRIC 342 STEER_ANGLE STEER_ANGLE 0.36 180; CHFFR_METRIC 380 ENGINE_RPM ENGINE_RPM 1 0; CHFFR_METRIC 804 ENGINE_TEMPERATURE ENGINE_TEMPERATURE 1 0";
|
||||
95
opendbc/cadillac_ct6_chassis.dbc
Normal file
95
opendbc/cadillac_ct6_chassis.dbc
Normal file
@@ -0,0 +1,95 @@
|
||||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BS_:
|
||||
|
||||
BU_: K182_PACM K43_PSCM K17_EBCM NEO K124_ASCM
|
||||
|
||||
|
||||
|
||||
BO_ 823 PACMParkAssitCmd: 7 NEO
|
||||
SG_ RollingCounter : 35|2@0+ (1,0) [0|0] "" NEO
|
||||
SG_ SteeringWheelChecksum : 47|16@0+ (1,0) [0|0] "" NEO
|
||||
SG_ SteeringWheelCmd : 23|16@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 560 EBCMRegen: 6 K17_EBCM
|
||||
SG_ Regen : 1|10@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 338 ASCMLKASteeringCmd: 6 NEO
|
||||
SG_ LKASteeringCmdActive : 7|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LKASteeringCmd : 5|14@0- (1,0) [0|0] "" NEO
|
||||
SG_ RollingCounter : 23|2@0+ (1,0) [0|0] "" NEO
|
||||
SG_ SetMe1 : 21|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LKASVehicleSpeed : 20|13@0+ (0.22,0) [0|0] "kph" NEO
|
||||
SG_ LKASMode : 36|2@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LKASteeringCmdChecksum : 33|10@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 340 ASCMBLKASteeringCmd: 6 NEO
|
||||
SG_ LKASteeringCmdActive : 7|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LKASteeringCmd : 5|14@0- (1,0) [0|0] "" NEO
|
||||
SG_ RollingCounter : 23|2@0+ (1,0) [0|0] "" NEO
|
||||
SG_ SetMe1 : 21|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LKASVehicleSpeed : 20|13@0+ (0.22,0) [0|0] "kph" NEO
|
||||
SG_ LKASteeringCmdActive2 : 35|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LKASteeringCmdChecksum : 33|10@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 368 EBCMFrictionBrakeStatus: 8 K17_EBCM
|
||||
SG_ FrictionBrakePressure : 23|16@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 789 EBCMFrictionBrakeCmd: 5 K17_EBCM
|
||||
SG_ RollingCounter : 37|6@0+ (1,0) [0|0] "" NEO
|
||||
SG_ FrictionBrakeMode : 7|4@0+ (1,0) [0|0] "" NEO
|
||||
SG_ FrictionBrakeChecksum : 23|16@0+ (1,0) [0|0] "" NEO
|
||||
SG_ FrictionBrakeCmd : 3|12@0- (1,0) [0|0] "" NEO
|
||||
|
||||
BO_TX_BU_ 823 : K43_PSCM,NEO;
|
||||
BO_TX_BU_ 789 : NEO,K17_EBCM;
|
||||
|
||||
|
||||
CM_ BU_ K182_PACM "Parking Assist Control Module";
|
||||
CM_ BU_ K43_PSCM "Power Steering Control Module";
|
||||
CM_ BU_ K17_EBCM "Electronic Brake Control Module";
|
||||
CM_ BU_ NEO "Comma NEO";
|
||||
CM_ BU_ K124_ASCM "Active Safety Control Module";
|
||||
BA_DEF_ "UseGMParameterIDs" INT 0 0;
|
||||
BA_DEF_ "ProtocolType" STRING ;
|
||||
BA_DEF_ "BusType" STRING ;
|
||||
BA_DEF_DEF_ "UseGMParameterIDs" 1;
|
||||
BA_DEF_DEF_ "ProtocolType" "GMLAN";
|
||||
BA_DEF_DEF_ "BusType" "";
|
||||
BA_ "UseGMParameterIDs" 0;
|
||||
BA_ "BusType" "CAN";
|
||||
BA_ "ProtocolType" "GMLAN";
|
||||
|
||||
VAL_ 338 LKASteeringCmdActive 1 "Active" 0 "Inactive" ;
|
||||
VAL_ 338 LKASMode 2 "supercruise" 1 "lkas" 0 "Inactive" ;
|
||||
3470
opendbc/cadillac_ct6_object.dbc
Normal file
3470
opendbc/cadillac_ct6_object.dbc
Normal file
File diff suppressed because it is too large
Load Diff
244
opendbc/cadillac_ct6_powertrain.dbc
Normal file
244
opendbc/cadillac_ct6_powertrain.dbc
Normal file
@@ -0,0 +1,244 @@
|
||||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BS_:
|
||||
|
||||
BU_: K16_BECM K73_TCIC K9_BCM K43_PSCM K17_EBCM K20_ECM K114B_HPCM NEO K124_ASCM
|
||||
VAL_TABLE_ TurnSignals 2 "Right Turn" 1 "Left Turn" 0 "None" ;
|
||||
VAL_TABLE_ ACCLeadCar 1 "Present" 0 "Not Present" ;
|
||||
VAL_TABLE_ ACCCmdActive 1 "Active" 0 "Inactive" ;
|
||||
VAL_TABLE_ BrakePedalPressed 1 "Pressed" 0 "Depressed" ;
|
||||
VAL_TABLE_ DistanceButton 1 "Active" 0 "Inactive" ;
|
||||
VAL_TABLE_ LKAButton 1 "Active" 0 "Inactive" ;
|
||||
VAL_TABLE_ ACCButtons 6 "Cancel" 5 "Main" 3 "Set" 2 "Resume" 1 "None" ;
|
||||
VAL_TABLE_ PRNDL 3 "Reverse" 2 "Drive" 1 "Neutral" 0 "Park" ;
|
||||
VAL_TABLE_ DoorStatus 1 "Opened" 0 "Closed" ;
|
||||
VAL_TABLE_ SeatBeltStatus 1 "Latched" 0 "Unlatched" ;
|
||||
VAL_TABLE_ LKASteeringCmdActive 1 "Active" 0 "Inactive" ;
|
||||
VAL_TABLE_ ACCGapLevel 3 "Far" 2 "Med" 1 "Near" 0 "Inactive" ;
|
||||
VAL_TABLE_ GasRegenCmdActiveInv 1 "Inactive" 0 "Active" ;
|
||||
VAL_TABLE_ GasRegenCmdActive 1 "Active" 0 "Inactive" ;
|
||||
VAL_TABLE_ LKATorqueDeliveredStatus 3 "Failed" 2 "Temp. Limited" 1 "Active" 0 "Inactive" ;
|
||||
VAL_TABLE_ HandsOffSWDetectionStatus 1 "Hands On" 0 "Hands Off" ;
|
||||
VAL_TABLE_ HandsOffSWDetectionMode 2 "Failed" 1 "Enabled" 0 "Disabled" ;
|
||||
|
||||
|
||||
BO_ 717 ASCM_2CD: 5 K124_ASCM
|
||||
|
||||
BO_ 869 ASCM_365: 4 K124_ASCM
|
||||
|
||||
BO_ 1034 ASCM_40A: 7 K124_ASCM
|
||||
|
||||
BO_ 1296 ASCM_510: 4 K124_ASCM
|
||||
|
||||
BO_ 1930 ASCM_78A: 7 K124_ASCM
|
||||
|
||||
BO_ 190 ECMAcceleratorPos: 6 K20_ECM
|
||||
SG_ BrakePedalPos : 15|8@0+ (1,0) [0|0] "sticky" NEO
|
||||
SG_ GasPedalAndAcc : 23|8@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 201 ECMEngineStatus: 8 K20_ECM
|
||||
SG_ EngineTPS : 39|8@0+ (0.392156863,0) [0|100.000000065] "%" NEO
|
||||
SG_ EngineRPM : 15|16@0+ (0.25,0) [0|0] "RPM" NEO
|
||||
|
||||
BO_ 209 EBCMBrakePedalTorque: 7 K17_EBCM
|
||||
SG_ BrakePedalTorque : 3|12@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 241 EBCMBrakePedalPosition: 6 K17_EBCM
|
||||
SG_ BrakePedalPosition : 15|8@0+ (1,0) [0|255] "" NEO
|
||||
|
||||
BO_ 298 BCMDoorBeltStatus: 8 K9_BCM
|
||||
SG_ RearLeftDoor : 8|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ FrontLeftDoor : 9|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ FrontRightDoor : 10|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ RearRightDoor : 23|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LeftSeatBelt : 12|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ RightSeatBelt : 53|1@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 309 ECMPRDNL: 8 K20_ECM
|
||||
SG_ PRNDL : 2|3@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 320 BCMTurnSignals: 3 K9_BCM
|
||||
SG_ TurnSignals : 19|2@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 336 ASCMLKASStatus: 1 NEO
|
||||
SG_ Available : 7|1@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 338 ASCMLKASteeringCmd: 6 NEO
|
||||
SG_ LKASteeringCmdActive : 7|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LKASteeringCmd : 5|14@0- (1,0) [0|0] "" NEO
|
||||
SG_ RollingCounter : 23|2@0+ (1,0) [0|0] "" NEO
|
||||
SG_ SetMe1 : 21|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LKASVehicleSpeed : 20|13@0+ (0.22,0) [0|0] "kph" NEO
|
||||
SG_ LKASMode : 36|2@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LKASteeringCmdChecksum : 33|10@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 340 ASCMBLKASteeringCmd: 6 NEO
|
||||
SG_ LKASteeringCmdActive : 7|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LKASteeringCmd : 5|14@0- (1,0) [0|0] "" NEO
|
||||
SG_ RollingCounter : 23|2@0+ (1,0) [0|0] "" NEO
|
||||
SG_ SetMe1 : 21|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LKASVehicleSpeed : 20|13@0+ (0.22,0) [0|0] "kph" NEO
|
||||
SG_ LKASMode : 36|2@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LKASteeringCmdChecksum : 33|10@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 381 MSG_17D: 8 K20_ECM
|
||||
SG_ MSG17D_AccPower : 35|12@0- (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 356 PSCMStatus: 8 K43_PSCM
|
||||
SG_ LKATorqueDeliveredStatus : 7|3@0+ (1,0) [0|7] "" NEO
|
||||
SG_ LKADriverAppldTrq : 2|11@0- (0.01,0) [-10.24|10.23] "Nm" NEO
|
||||
SG_ LKATBDTorque : 21|14@0- (-0.005,0) [-10.24|10.23] "Nm" NEO
|
||||
SG_ RollingCounter : 39|2@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LKATotalTorqueDelivered : 37|14@0- (0.01,0) [-10.24|10.23] "Nm" NEO
|
||||
|
||||
BO_ 417 AcceleratorPedal: 7 XXX
|
||||
SG_ AcceleratorPedal : 55|8@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 451 GasAndAcc: 8 XXX
|
||||
SG_ GasPedalAndAcc2 : 55|8@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 452 AcceleratorPedal2: 8 XXX
|
||||
SG_ AcceleratorPedal2 : 47|8@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 481 ASCMSteeringButton: 7 K124_ASCM
|
||||
SG_ DistanceButton : 22|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ LKAButton : 23|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ ACCButtons : 46|3@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 485 PSCMSteeringAngle: 8 K43_PSCM
|
||||
SG_ SteeringWheelAngle : 15|16@0- (0.0625,0) [-540|540] "deg" NEO
|
||||
SG_ SteeringWheelRate : 27|12@0- (0.5,0) [-100|100] "deg/s" NEO
|
||||
|
||||
BO_ 489 EBCMVehicleDynamic: 8 K17_EBCM
|
||||
SG_ YawRate : 51|12@0- (0.0625,0) [-2047|2047] "grad/s" NEO
|
||||
SG_ LateralAcceleration : 3|12@0- (0.0161,0) [-2047|2047] "m/s2" NEO
|
||||
SG_ BrakePedalPressed : 6|1@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 711 BECMBatteryVoltageCurrent: 6 K17_EBCM
|
||||
SG_ HVBatteryVoltage : 31|12@0+ (0.125,0) [0|511.875] "V" NEO
|
||||
SG_ HVBatteryCurrent : 12|13@0- (0.15,0) [-614.4|614.25] "A" NEO
|
||||
|
||||
BO_ 715 ASCMGasRegenCmd: 8 K124_ASCM
|
||||
SG_ GasRegenAlwaysOne : 9|1@0+ (1,1) [1|1] "" NEO
|
||||
SG_ GasRegenAlwaysThree : 15|2@0+ (1,1) [1|1] "" NEO
|
||||
SG_ GasRegenChecksum : 47|24@0+ (1,0) [0|0] "" NEO
|
||||
SG_ GasRegenCmdActiveInv : 32|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ GasRegenFullStopActive : 13|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ GasRegenCmdActive : 0|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ RollingCounter : 7|2@0+ (1,0) [0|0] "" NEO
|
||||
SG_ RollingCounter2 : 36|4@0+ (1,0) [0|0] "" NEO
|
||||
SG_ GasRegenAlwaysOne2 : 23|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ GasRegenCmd : 22|15@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 810 TCICOnStarGPSPosition: 8 K73_TCIC
|
||||
SG_ GPSLongitude : 39|32@0+ (1,0) [0|0] "milliarcsecond" NEO
|
||||
SG_ GPSLatitude : 7|32@0+ (1,0) [0|0] "milliarcsecond" NEO
|
||||
|
||||
BO_ 840 EBCMWheelSpdFront: 4 K17_EBCM
|
||||
SG_ FLWheelSpd : 7|16@0+ (0.0311,0) [0|255] "km/h" NEO
|
||||
SG_ FRWheelSpd : 23|16@0+ (0.0311,0) [0|255] "km/h" NEO
|
||||
|
||||
BO_ 842 EBCMWheelSpdRear: 4 K17_EBCM
|
||||
SG_ RLWheelSpd : 7|16@0+ (0.0311,0) [0|255] "km/h" NEO
|
||||
SG_ RRWheelSpd : 23|16@0+ (0.0311,0) [0|255] "km/h" NEO
|
||||
|
||||
BO_ 880 ASCMActiveCruiseControlStatus: 6 K124_ASCM
|
||||
SG_ ACCLeadCar : 44|1@0+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ ACCAlwaysOne2 : 32|1@0+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ ACCAlwaysOne : 0|1@0+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ ACCSpeedSetpoint : 19|12@0+ (1,0) [0|0] "km/h" NEO
|
||||
SG_ ACCGapLevel : 21|2@0+ (1,0) [0|0] "" NEO
|
||||
SG_ ACCResumeButton : 1|1@0+ (1,0) [0|0] "" NEO
|
||||
SG_ ACCCmdActive : 23|1@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 1001 ECMVehicleSpeed: 8 K20_ECM
|
||||
SG_ VehicleSpeed : 7|16@0+ (0.01,0) [0|0] "mph" NEO
|
||||
|
||||
BO_ 1033 ASCMKeepAlive: 7 NEO
|
||||
SG_ ASCMKeepAliveAllZero : 7|56@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 1217 ECMEngineCoolantTemp: 8 K20_ECM
|
||||
SG_ EngineCoolantTemp : 23|8@0+ (1,-40) [0|0] "°C" NEO
|
||||
|
||||
BO_ 1249 VIN_Part2: 8 K20_ECM
|
||||
SG_ VINPart2 : 7|64@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 1300 VIN_Part1: 8 K20_ECM
|
||||
SG_ VINPart1 : 7|64@0+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 1912 PSCM_778: 8 K43_PSCM
|
||||
|
||||
BO_TX_BU_ 338 : K124_ASCM,NEO;
|
||||
BO_TX_BU_ 880 : NEO,K124_ASCM;
|
||||
BO_TX_BU_ 1033 : K124_ASCM,NEO;
|
||||
BO_TX_BU_ 715 : NEO,K124_ASCM;
|
||||
|
||||
|
||||
CM_ BU_ K16_BECM "Battery Energy Control Module";
|
||||
CM_ BU_ K73_TCIC "Telematics Communication Control Module";
|
||||
CM_ BU_ K9_BCM "Body Control Module";
|
||||
CM_ BU_ K43_PSCM "Power Steering Control Module";
|
||||
CM_ BU_ K17_EBCM "Electronic Brake Control Module";
|
||||
CM_ BU_ K20_ECM "Engine Control Module";
|
||||
CM_ BU_ K114B_HPCM "Hybrid Powertrain Control Module";
|
||||
CM_ BU_ NEO "Comma NEO";
|
||||
CM_ BU_ K124_ASCM "Active Safety Control Module";
|
||||
CM_ SG_ 381 MSG17D_AccPower "Need to investigate";
|
||||
CM_ SG_ 190 GasPedalAndAcc "ACC baseline is 62";
|
||||
CM_ SG_ 451 GasPedalAndAcc2 "ACC baseline is 62";
|
||||
CM_ SG_ 715 RollingCounter2 "Values cycle between 0, 7, 10, 13";
|
||||
BA_DEF_ "UseGMParameterIDs" INT 0 0;
|
||||
BA_DEF_ "ProtocolType" STRING ;
|
||||
BA_DEF_ "BusType" STRING ;
|
||||
BA_DEF_DEF_ "UseGMParameterIDs" 1;
|
||||
BA_DEF_DEF_ "ProtocolType" "GMLAN";
|
||||
BA_DEF_DEF_ "BusType" "";
|
||||
BA_ "BusType" "CAN";
|
||||
BA_ "ProtocolType" "GMLAN";
|
||||
BA_ "UseGMParameterIDs" 0;
|
||||
VAL_ 481 DistanceButton 1 "Active" 0 "Inactive" ;
|
||||
VAL_ 481 LKAButton 1 "Active" 0 "Inactive" ;
|
||||
VAL_ 481 ACCButtons 6 "Cancel" 5 "Main" 3 "Set" 2 "Resume" 1 "None" ;
|
||||
VAL_ 309 PRNDL 3 "Reverse" 2 "Drive" 1 "Neutral" 0 "Park" ;
|
||||
VAL_ 338 LKASteeringCmdActive 1 "Active" 0 "Inactive" ;
|
||||
VAL_ 338 LKASMode 2 "supercruise" 1 "lkas" 0 "Inactive" ;
|
||||
VAL_ 880 ACCLeadCar 1 "Present" 0 "Not Present" ;
|
||||
VAL_ 880 ACCGapLevel 3 "Far" 2 "Med" 1 "Near" 0 "Inactive" ;
|
||||
VAL_ 880 ACCResumeButton 1 "Pressed" 0 "Depressed" ;
|
||||
VAL_ 880 ACCCmdActive 1 "Active" 0 "Inactive" ;
|
||||
VAL_ 356 LKATorqueDeliveredStatus 7 "Override Fault" 6 "LKAS Fault but Responsive" 5 "TBD but Responsive" 4 "TBD but Responsive" 3 "Fault" 1 "Active" 0 "Inactive" ;
|
||||
VAL_ 489 BrakePedalPressed 1 "Pressed" 0 "Depressed" ;
|
||||
VAL_ 715 GasRegenCmdActiveInv 1 "Inactive" 0 "Active" ;
|
||||
VAL_ 715 GasRegenCmdActive 1 "Active" 0 "Inactive" ;
|
||||
|
||||
435
opendbc/chrysler_pacifica_2017_hybrid.dbc
Normal file
435
opendbc/chrysler_pacifica_2017_hybrid.dbc
Normal file
@@ -0,0 +1,435 @@
|
||||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BS_:
|
||||
|
||||
BU_: XXX
|
||||
|
||||
|
||||
BO_ 258 STEERING: 8 XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ UNKNOWN_STEERING : 50|3@0+ (1,0) [0|15] "" XXX
|
||||
SG_ STEERING_RATE : 20|13@0+ (0.3187251,-1305.498) [0|8191] "deg/s" XXX
|
||||
SG_ STEER_ANGLE : 4|13@0+ (0.3187251,-1307.888) [-360|360] "deg" XXX
|
||||
|
||||
BO_ 514 SPEED_1: 4 XXX
|
||||
SG_ SPEED_LEFT : 7|12@0+ (0.071028,0) [0|65535] "m/s" XXX
|
||||
SG_ SPEED_RIGHT : 23|12@0+ (0.071028,0) [0|1023] "m/s" XXX
|
||||
|
||||
BO_ 653 BRAKE_MODULE: 2 XXX
|
||||
SG_ BRAKE_PRESSURE : 15|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ BRAKE_PRESSED : 4|1@0+ (1,0) [0|4] "" XXX
|
||||
|
||||
BO_ 820 DOORS: 8 XXX
|
||||
SG_ DOOR_OPEN_FR : 18|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ DOOR_OPEN_RL : 19|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ DOOR_OPEN_RR : 20|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ DOOR_OPEN_TRUNK : 22|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ DOOR_OPEN_FL : 17|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ TURN_LIGHT_LEFT : 31|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ TURN_LIGHT_RIGHT : 30|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ HIGH_BEAM_DISPLAY : 58|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 746 GEAR: 5 XXX
|
||||
SG_ PRNDL : 2|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ GEAR_CHECKSUM : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 31|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 284 BRAKE_1: 8 XXX
|
||||
SG_ SPEED_RELATED_1 : 37|14@0+ (1,0) [0|255] "" XXX
|
||||
SG_ BRAKE_RELATED_1_2 : 18|11@0+ (1,0) [0|255] "" XXX
|
||||
SG_ BRAKE_RELATED_1_1 : 3|12@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 320 BRAKE_2: 8 XXX
|
||||
SG_ SPEED_RELATED_2 : 47|8@0+ (1,0) [0|63] "" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ BRAKE_PRESSED_2 : 2|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ BRAKE_PRESSED_ACC : 6|1@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 736 TRIP: 8 XXX
|
||||
SG_ COUNTER : 7|16@0+ (1,0) [0|65535] "Meters" XXX
|
||||
SG_ COUNTER_2 : 23|16@0+ (1,0) [0|65535] "Meters" XXX
|
||||
|
||||
BO_ 344 WHEEL_SPEEDS: 8 XXX
|
||||
SG_ WHEEL_SPEED_FL : 3|12@0+ (0.0189408,0) [0|65535] "m/s" XXX
|
||||
SG_ WHEEL_SPEED_RR : 51|12@0+ (0.0189408,0) [0|255] "m/s" XXX
|
||||
SG_ WHEEL_SPEED_RL : 35|12@0+ (0.0189408,0) [0|3] "m/s" XXX
|
||||
SG_ WHEEL_SPEED_FR : 19|12@0+ (0.0189408,0) [0|255] "m/s" XXX
|
||||
|
||||
BO_ 792 STEERING_LEVERS: 8 XXX
|
||||
SG_ HIGH_BEAM_PUSHED_IN : 2|1@0+ (1,0) [0|3] "" XXX
|
||||
SG_ TURN_SIGNALS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ HIGH_BEAM_FLASH : 3|1@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 264 ACCEL_PEDAL_MSG: 8 XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ACCEL_PEDAL : 35|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 464 SEATBELT_STATUS: 8 XXX
|
||||
SG_ SEATBELT_DRIVER_UNLATCHED : 13|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 544 EPS_STATUS: 8 XXX
|
||||
SG_ LKAS_STATE : 23|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ TORQUE_DRIVER : 2|11@0+ (1,-1024) [-1024|1023] "" XXX
|
||||
SG_ TORQUE_MOTOR_RAW : 19|12@0+ (1,-2048) [-2048|2047] "" XXX
|
||||
SG_ TORQUE_MOTOR : 34|11@0+ (1,-1024) [-1024|1023] "" XXX
|
||||
SG_ AUTO_PARK_HAS_CONTROL_2 : 51|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 658 LKAS_COMMAND: 6 XXX
|
||||
SG_ COUNTER : 39|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 47|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ LKAS_STEERING_TORQUE : 2|11@0+ (1,-1024) [0|1] "" XXX
|
||||
SG_ LKAS_HIGH_TORQUE : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 678 LKAS_HUD: 8 XXX
|
||||
SG_ LKAS_ICON_COLOR : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ LKAS_LANE_LINES : 19|4@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LKAS_ALERTS : 27|4@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CAR_MODEL : 15|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 705 AUTO_PARK_BUTTON: 8 XXX
|
||||
SG_ AUTO_PARK_TOGGLE_2 : 8|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ AUTO_PARK_TOGGLE_1 : 11|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ INCREASING_UNKNOWN : 38|7@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 719 AUTO_PARK_SIGNALS_1: 8 XXX
|
||||
SG_ AUTO_PARK_UNKNOWN_1 : 7|16@0+ (1,0) [0|31] "" XXX
|
||||
|
||||
BO_ 671 AUTO_PARK_SIGNALS_2: 8 XXX
|
||||
SG_ AUTO_PARK_PARALLEL : 21|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ AUTO_PARK_PERPENDICULAR_1 : 22|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ AUTO_PARK_CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ AUTO_PARK_MAYBE_TURNING : 3|12@0+ (1,0) [0|1023] "" XXX
|
||||
SG_ AUTO_PARK_TURNING_STATUS : 7|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 784 AUTO_PARK_LESS_INTERESTING: 8 XXX
|
||||
SG_ INCREASING_UNKNOWN : 55|8@0+ (1,0) [0|7] "" XXX
|
||||
SG_ AUTO_PARK_PERPENDICULAR_2 : 61|1@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 826 AUTO_PARK_SIGNALS_3: 8 XXX
|
||||
SG_ AUTO_PARK_HAS_CONTROL_3 : 1|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ HUMAN_HAS_CONTROL : 2|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ AUTO_PARK_GEAR_1 : 27|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ AUTO_PARK_GEAR_2 : 35|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ AUTO_PARK_GEAR_3 : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 332 STEERING_2: 8 XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ ENERGY_RELATED : 39|16@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ STEER_ANGLE_2 : 7|13@0+ (0.3187251,-1307.888) [-360|360] "deg" XXX
|
||||
|
||||
BO_ 720 BLIND_SPOT_WARNINGS: 6 XXX
|
||||
SG_ BLIND_SPOT_RIGHT : 5|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ BLIND_SPOT_LEFT : 2|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 331 BRAKE_3: 8 XXX
|
||||
SG_ BRAKE_RELATED_3 : 7|16@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 608 PARKSENSE_SIGNAL: 8 XXX
|
||||
SG_ PARKSENSE_DISABLED : 34|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ IN_REVERSE : 10|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ AUTO_PARK_HAS_CONTROL_1 : 16|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ HUMAN_HAS_CONTROL : 17|1@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 729 LKAS_HEARTBIT: 5 XXX
|
||||
SG_ LKAS_STATUS_OK : 31|16@0+ (1,0) [0|65535] "" XXX
|
||||
|
||||
BO_ 274 NEW_MSG_112: 2 XXX
|
||||
|
||||
BO_ 290 NEW_MSG_122: 6 XXX
|
||||
|
||||
BO_ 376 NEW_MSG_178: 3 XXX
|
||||
|
||||
BO_ 288 ACCEL_RELATED_120: 7 XXX
|
||||
SG_ COUNTER : 47|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 55|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ACCEL : 23|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ GAS_ENGINE_RPM_MAYBE : 31|16@0+ (1,0) [0|65535] "" XXX
|
||||
|
||||
BO_ 257 ACCEL_RELATED_101: 5 XXX
|
||||
SG_ ENERGY_OR_RPM : 31|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 388 NEW_MSG_184: 4 XXX
|
||||
|
||||
BO_ 448 NEW_MSG_1c0: 6 XXX
|
||||
|
||||
BO_ 456 NEW_MSG_1c8: 4 XXX
|
||||
|
||||
BO_ 560 NEW_MSG_230: 4 XXX
|
||||
|
||||
BO_ 564 NEW_MSG_234: 4 XXX
|
||||
|
||||
BO_ 571 WHEEL_BUTTONS: 3 XXX
|
||||
SG_ CHECKSUM : 23|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ACC_FOLLOW_DEC : 1|1@0+ (1,0) [0|3] "" XXX
|
||||
SG_ ACC_SPEED_INC : 2|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ACC_SPEED_DEC : 3|1@0+ (1,0) [0|3] "" XXX
|
||||
SG_ ACC_FOLLOW_INC : 8|1@0+ (1,0) [0|15] "" XXX
|
||||
SG_ ACC_CANCEL : 0|1@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 15|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ ACC_RESUME : 4|1@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 669 NEW_MSG_29d: 3 XXX
|
||||
SG_ COUNTER : 15|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 23|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 825 AUDIBLE_BEEP_339: 2 XXX
|
||||
SG_ BEEP_339 : 7|16@0+ (1,0) [0|65535] "" XXX
|
||||
|
||||
BO_ 856 NEW_MSG_358: 4 XXX
|
||||
|
||||
BO_ 860 NEW_MSG_35c: 6 XXX
|
||||
|
||||
BO_ 924 NEW_MSG_39c: 3 XXX
|
||||
|
||||
BO_ 969 NEW_MSG_3c9: 4 XXX
|
||||
|
||||
BO_ 974 NEW_MSG_3ce: 5 XXX
|
||||
|
||||
BO_ 993 NEW_MSG_3e1: 7 XXX
|
||||
|
||||
BO_ 838 NEW_MSG_346: 2 XXX
|
||||
|
||||
BO_ 926 NEW_MSG_39e: 3 XXX
|
||||
|
||||
BO_ 168 ACCEL_RELATED_a8: 8 XXX
|
||||
SG_ ACCEL_RELATED : 23|16@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 270 ACCEL_RELATED_10e: 8 XXX
|
||||
SG_ ACCEL_OR_RPM : 7|16@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ELECTRIC_MOTOR : 23|16@0+ (1,0) [0|65535] "" XXX
|
||||
|
||||
BO_ 291 ENERGY_RELATED_123: 8 XXX
|
||||
SG_ ENERGY_GAIN_LOSS : 18|11@0- (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ENERGY_SMOOTHER_CURVE : 35|12@0+ (1,0) [0|2047] "" XXX
|
||||
|
||||
BO_ 294 ENERGY_RELATED_126: 8 XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ UNKNOWN_126_1 : 3|12@0+ (1,0) [0|4095] "" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ UNKNOWN_126_2 : 35|12@0+ (1,0) [0|4095] "" XXX
|
||||
SG_ ENERGY_GAIN_LOSS_NOISY : 19|12@0+ (1,0) [0|2047] "" XXX
|
||||
|
||||
BO_ 300 NEW_MSG_12C: 8 XXX
|
||||
|
||||
BO_ 308 ACCEL_GAS_134: 8 XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ ACCEL_134 : 43|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 532 ENERGY_RELATED_214: 8 XXX
|
||||
SG_ NOISY_SLOWLY_DECREASING : 16|9@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ENERGY_RELATED : 0|9@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 559 ACCEL_GAS_22F: 8 XXX
|
||||
SG_ ACCEL_22F : 3|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 655 CHARGING_MAYBE_28F: 8 XXX
|
||||
SG_ CHARGING : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 660 BRAKE_RELATED_294: 8 XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ BRAKE_PERHAPS_294 : 31|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 764 ACCEL_RELATED_2FC: 8 XXX
|
||||
SG_ ACCEL_2FC : 13|6@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 816 TRACTION_BUTTON: 8 XXX
|
||||
SG_ TRACTION_OFF : 19|1@0+ (1,0) [0|3] "" XXX
|
||||
SG_ TOGGLE_PARKSENSE : 52|1@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 878 ACCEL_RELATED_36E: 8 XXX
|
||||
SG_ ACCEL_OR_RPM_2 : 15|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ACCEL_OR_RPM_1 : 7|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 324 SPEED_2: 8 XXX
|
||||
SG_ SPEED_2 : 31|16@0+ (0.01,0) [0|255] "m/s" XXX
|
||||
|
||||
BO_ 501 DASHBOARD: 8 XXX
|
||||
SG_ ACC_SPEED_CONFIG_KPH : 15|8@0+ (1,0) [0|3] "km/h" XXX
|
||||
SG_ ACC_SPEED_CONFIG_MPH : 23|8@0+ (1,0) [0|3] "mph" XXX
|
||||
SG_ ACC_DISTANCE_CONFIG_1 : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ ACC_DISTANCE_CONFIG_2 : 41|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ SPEED_DIGITAL : 63|8@0+ (1,0) [0|255] "mph" XXX
|
||||
|
||||
BO_ 639 NEW_MSG_27f: 8 XXX
|
||||
SG_ INCREASING : 47|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 701 NEW_MSG_2bd: 8 XXX
|
||||
SG_ unknown_1 : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 832 UNKNOWN_340: 8 XXX
|
||||
SG_ SPEED_DIGITAL : 63|8@0+ (1,0) [0|255] "mph" XXX
|
||||
|
||||
BO_ 848 UNKNOWN_350: 8 XXX
|
||||
SG_ INCREASING_LSB : 5|6@0+ (1,0) [0|255] "" XXX
|
||||
SG_ INCREASING_MSB : 12|5@0+ (1,0) [0|31] "" XXX
|
||||
|
||||
BO_ 908 NEW_MSG_38c: 8 XXX
|
||||
SG_ INCREASING_MSB : 44|5@0+ (1,0) [0|31] "" XXX
|
||||
SG_ INCREASING_LSB : 61|6@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 938 NEW_MSG_3aa: 8 XXX
|
||||
SG_ INCREASING_UNKNOWN_1 : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ INCREASING_UNKNOWN_2 : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 940 NEW_MSG_3ac: 8 XXX
|
||||
SG_ INCREASING_1 : 35|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ INCREASING_2 : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 941 NEW_MSG_3ad: 8 XXX
|
||||
SG_ INCREASING_1 : 36|5@0+ (1,0) [0|31] "" XXX
|
||||
SG_ INCREASING_2 : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 500 ACC_2: 8 XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ ACC_STATUS_1 : 7|3@0+ (1,0) [0|255] "" XXX
|
||||
SG_ BRAKE_MAYBE : 18|11@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ACC_STATUS_2 : 21|3@0+ (1,0) [0|255] "" XXX
|
||||
SG_ BRAKE_BOOL_1 : 36|1@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 625 ACC_1: 8 XXX
|
||||
SG_ SPEED : 31|8@0+ (1,0) [0|255] "km/h" XXX
|
||||
SG_ ACCEL_PERHAPS : 39|16@0+ (1,0) [0|255] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 268 ACC_10c: 8 XXX
|
||||
SG_ BRAKE_PERHAPS : 48|1@0+ (1,0) [0|3] "" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 384 NEW_MSG_180: 8 XXX
|
||||
SG_ NEW_SIGNAL_2 : 15|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_1 : 7|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_3 : 39|8@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 853 NEW_MSG_355: 8 XXX
|
||||
|
||||
BO_ 939 NEW_MSG_3ab: 8 XXX
|
||||
|
||||
BO_ 512 NEW_MSG_200: 8 XXX
|
||||
SG_ NEW_SIGNAL_1 : 23|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ INCREASING : 27|12@0+ (1,0) [0|127] "" XXX
|
||||
SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
|
||||
|
||||
|
||||
CM_ SG_ 258 UNKNOWN_STEERING "never goes above 4. see if human-applied torque";
|
||||
CM_ SG_ 258 STEER_ANGLE "positive is left (counter-clockwise)";
|
||||
CM_ SG_ 514 SPEED_LEFT "TODO find upper limit";
|
||||
CM_ SG_ 653 BRAKE_PRESSURE "max seems to be 148";
|
||||
CM_ SG_ 820 TURN_LIGHT_LEFT "oscillates with the light blinking";
|
||||
CM_ SG_ 820 TURN_LIGHT_RIGHT "hazard blinks both right and left lights";
|
||||
CM_ SG_ 746 PRNDL "5=L, 4=D, 3=N, 2=R, 1=P";
|
||||
CM_ SG_ 746 GEAR_CHECKSUM "different than the LKAS checksum. unknown non-simple algorithm. just build a lookup table for it.";
|
||||
CM_ SG_ 284 SPEED_RELATED_1 "Another Speed Signal, Maybe RPMs?";
|
||||
CM_ SG_ 284 BRAKE_RELATED_1_1 "Correlates with braking";
|
||||
CM_ SG_ 320 BRAKE_PRESSED_2 "Value is 5 when brake is pressed by human, 1 when ACC brake";
|
||||
CM_ SG_ 320 BRAKE_PRESSED_ACC "set when ACC brakes";
|
||||
CM_ SG_ 792 TURN_SIGNALS "1=Left, 2=Right";
|
||||
CM_ SG_ 792 HIGH_BEAM_FLASH "use this for genericToggle";
|
||||
CM_ SG_ 264 ACCEL_PEDAL "not in ACC so seems to be actual pedal. Use for gasPressed";
|
||||
CM_ SG_ 544 LKAS_STATE "2 when autopark has control, 8 when is actuatable by lkas, 4 when there is a fault";
|
||||
CM_ SG_ 544 TORQUE_MOTOR_RAW "has larger range than TORQUE_MOTOR but ut seems biased";
|
||||
CM_ SG_ 658 COUNTER "each message increments, 0..f";
|
||||
CM_ SG_ 658 CHECKSUM "checksum calculated with https://gist.github.com/adhintz/94bf8d19b9075539f50172ab0fb24ba1";
|
||||
CM_ SG_ 658 LKAS_STEERING_TORQUE "Most sent by stock system is 1024+-230. + is left. typically changes by 2 or 3 each 0.01s";
|
||||
CM_ SG_ 678 LKAS_ICON_COLOR "3 is yellow, 2 is green, 1 is white, 0 is null";
|
||||
CM_ SG_ 678 LKAS_LANE_LINES "0x01 transparent lines, 0x02 left white, 0x03 right white, 0x04 left yellow with car on top, 0x05 left yellow with car on top, 0x06 both white, 0x07 left yellow, 0x08 left yellow right white, 0x09 right yellow, 0x0a right yellow left white, 0x0b left yellow with car on top right white, 0x0c right yellow with car on top left white, (0x00, 0x0d, 0x0e, 0x0f) null";
|
||||
CM_ SG_ 678 LKAS_ALERTS "(0x01, 0x02) lane sense off, (0x03, 0x04, 0x06) place hands on steering wheel, 0x07 lane departure detected + place hands on steering wheel, (0x08, 0x09) lane sense unavailable + clean front windshield, 0x0b lane sense and auto high beam unavailable + clean front windshield, 0x0c lane sense unavailable + service required, (0x00, 0x05, 0x0a, 0x0d, 0x0e, 0x0f) null";
|
||||
CM_ SG_ 705 AUTO_PARK_TOGGLE_1 "set briefly when turning on or off self-parking";
|
||||
CM_ SG_ 705 INCREASING_UNKNOWN "sometimes decreasing";
|
||||
CM_ SG_ 671 AUTO_PARK_PARALLEL "parallel parking mode";
|
||||
CM_ SG_ 671 AUTO_PARK_PERPENDICULAR_1 "perpendicular parking mode";
|
||||
CM_ SG_ 671 AUTO_PARK_MAYBE_TURNING "something with autopark turning the steering wheel maybe.";
|
||||
CM_ SG_ 671 AUTO_PARK_TURNING_STATUS "0 when not steering. when steering starts, 4 for two packets, and then 5 for the rest";
|
||||
CM_ SG_ 784 INCREASING_UNKNOWN "perhaps distance traveled";
|
||||
CM_ SG_ 826 AUTO_PARK_GEAR_1 "Reverse=0, Forward=f";
|
||||
CM_ SG_ 826 AUTO_PARK_GEAR_2 "Reverse=0, Forward=f";
|
||||
CM_ SG_ 826 AUTO_PARK_GEAR_3 "Reverse=0, Forward=f";
|
||||
CM_ SG_ 332 STEER_ANGLE_2 "slightly lags the other steer_angle signal. also more noisy.";
|
||||
CM_ SG_ 720 BLIND_SPOT_RIGHT "yellow triangle alert on side view mirror when a car is in your blind spot";
|
||||
CM_ SG_ 608 PARKSENSE_DISABLED "set if parksense is disabled";
|
||||
CM_ SG_ 729 LKAS_STATUS_OK "Set to 0x0820 when LKAS system is plugged in.";
|
||||
CM_ SG_ 288 UNKNOWN_CHECKSUM "not the LKAS checksum";
|
||||
CM_ SG_ 288 GAS_ENGINE_RPM_MAYBE "lags acceleration, perhaps gas engine";
|
||||
CM_ SG_ 257 ENERGY_OR_RPM "perhaps energy consumption or RPMs";
|
||||
CM_ SG_ 571 CHECKSUM "standard checksum";
|
||||
CM_ SG_ 825 BEEP_339 "sent every 0.5s. 0050 is no beep. To beep send 4355 or 4155. Used by ParkSense warning.";
|
||||
CM_ SG_ 270 ELECTRIC_MOTOR "0x7fff indicates electric motor not in use";
|
||||
CM_ SG_ 291 ENERGY_GAIN_LOSS "unsure what this actually is";
|
||||
CM_ SG_ 291 ENERGY_SMOOTHER_CURVE "unusre what it is, but smoother";
|
||||
CM_ SG_ 532 NOISY_SLOWLY_DECREASING "perhaps battery but do not know";
|
||||
CM_ SG_ 816 TRACTION_OFF "set when traction off button is enabled";
|
||||
CM_ SG_ 816 TOGGLE_PARKSENSE "sending 3000071ec0ff9000 enables or disables parksense";
|
||||
CM_ SG_ 324 SPEED_2 "signal is approx half other speeds";
|
||||
CM_ SG_ 501 ACC_SPEED_CONFIG_KPH "speed configured for ACC";
|
||||
CM_ SG_ 501 ACC_SPEED_CONFIG_MPH "speed configured for ACC";
|
||||
CM_ SG_ 639 INCREASING "perhaps number of seconds divided by two for this drive";
|
||||
CM_ SG_ 848 INCREASING_LSB "lower part of time counter";
|
||||
CM_ SG_ 848 INCREASING_MSB "upper part of time counter";
|
||||
CM_ SG_ 908 INCREASING_MSB "time based";
|
||||
CM_ SG_ 500 ACC_STATUS_1 "2 briefly (9 packets) when ACC goes to green, 1 help when ACC coming to a stop and at a stop";
|
||||
CM_ SG_ 500 BRAKE_MAYBE "2046 in non-ACC and non-decel. Signal on deceleration. 818 for already stopped break.";
|
||||
CM_ SG_ 500 ACC_STATUS_2 "set to 1 in non-ACC, 3 when ACC enabled (white icon), and 7 when ACC in use (green icon)";
|
||||
CM_ SG_ 500 BRAKE_BOOL_1 "set to 1 when ACC decel. 0 on non-ACC and accel.";
|
||||
CM_ SG_ 625 SPEED "zero on non-acc drives";
|
||||
CM_ SG_ 625 ACCEL_PERHAPS "set to 7767 on non-ACC drives. ACC drive 40k is constant speed, 42k is accelerating";
|
||||
CM_ SG_ 268 BRAKE_PERHAPS "triggers only on ACC braking";
|
||||
CM_ SG_ 384 NEW_SIGNAL_1 "set in ACC gas driving. not set in electric human. not sure about gas human driving.";
|
||||
VAL_ 746 PRNDL 5 "Low" 4 "Drive" 3 "Neutral" 2 "Reverse" 1 "Park" ;
|
||||
VAL_ 792 TURN_SIGNALS 2 "Right" 1 "Left" ;
|
||||
230
opendbc/chrysler_pacifica_2017_hybrid_private_fusion.dbc
Normal file
230
opendbc/chrysler_pacifica_2017_hybrid_private_fusion.dbc
Normal file
@@ -0,0 +1,230 @@
|
||||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BS_:
|
||||
|
||||
BU_: XXX
|
||||
|
||||
|
||||
BO_ 544 a_1: 8 XXX
|
||||
SG_ track_id : 7|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ REL_ACCEL : 3|12@0+ (1,0) [0|31] "" XXX
|
||||
SG_ status1 : 23|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ REL_SPEED : 19|12@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ status2 : 39|6@0+ (1,0) [0|15] "" XXX
|
||||
SG_ sig2 : 33|10@0+ (1,0) [0|255] "" XXX
|
||||
SG_ zeros : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 576 b_1: 8 XXX
|
||||
SG_ sig0 : 7|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ sig1 : 15|16@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ sig2 : 31|16@0+ (1,0) [0|255] "" XXX
|
||||
SG_ zeros : 47|12@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 608 a_2: 8 XXX
|
||||
SG_ track_id : 7|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ REL_ACCEL : 3|12@0+ (1,0) [0|31] "" XXX
|
||||
SG_ status1 : 23|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ REL_SPEED : 19|12@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ status2 : 39|6@0+ (1,0) [0|15] "" XXX
|
||||
SG_ sig2 : 33|10@0+ (1,0) [0|255] "" XXX
|
||||
SG_ zeros : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 640 b_2: 8 XXX
|
||||
SG_ sig0 : 7|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ sig1 : 15|16@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ sig2 : 31|16@0+ (1,0) [0|255] "" XXX
|
||||
SG_ zeros : 47|12@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 644 a_3: 8 XXX
|
||||
SG_ track_id : 7|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ REL_ACCEL : 3|12@0+ (1,0) [0|31] "" XXX
|
||||
SG_ status1 : 23|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ REL_SPEED : 19|12@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ status2 : 39|6@0+ (1,0) [0|15] "" XXX
|
||||
SG_ sig2 : 33|10@0+ (1,0) [0|255] "" XXX
|
||||
SG_ zeros : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 648 b_3: 8 XXX
|
||||
SG_ sig0 : 7|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ sig1 : 15|16@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ sig2 : 31|16@0+ (1,0) [0|255] "" XXX
|
||||
SG_ zeros : 47|12@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 652 a_4: 8 XXX
|
||||
SG_ track_id : 7|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ REL_ACCEL : 3|12@0+ (1,0) [0|31] "" XXX
|
||||
SG_ status1 : 23|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ REL_SPEED : 19|12@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ status2 : 39|6@0+ (1,0) [0|15] "" XXX
|
||||
SG_ sig2 : 33|10@0+ (1,0) [0|255] "" XXX
|
||||
SG_ zeros : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 656 b_4: 8 XXX
|
||||
SG_ sig0 : 7|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ sig1 : 15|16@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ sig2 : 31|16@0+ (1,0) [0|255] "" XXX
|
||||
SG_ zeros : 47|12@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 512 unknown_200: 8 XXX
|
||||
SG_ COUNTER : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ increasing : 31|16@0+ (1,0) [0|255] "" XXX
|
||||
SG_ zeros_0 : 3|12@0+ (1,0) [0|63] "" XXX
|
||||
SG_ zeros_1 : 47|12@0+ (1,0) [0|63] "" XXX
|
||||
SG_ status0 : 7|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ unknown_0 : 23|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 514 unknown_202: 8 XXX
|
||||
SG_ COUNTER : 43|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ sig3 : 31|8@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ increasing : 39|12@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 706 c_1: 8 XXX
|
||||
SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX
|
||||
|
||||
BO_ 708 c_2: 8 XXX
|
||||
SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX
|
||||
SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 710 c_3: 8 XXX
|
||||
SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX
|
||||
SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 712 c_4: 8 XXX
|
||||
SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX
|
||||
SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 714 c_5: 8 XXX
|
||||
SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX
|
||||
SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 716 c_6: 8 XXX
|
||||
SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX
|
||||
SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 718 c_7: 8 XXX
|
||||
SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX
|
||||
SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 720 c_8: 8 XXX
|
||||
SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX
|
||||
SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 722 c_9: 8 XXX
|
||||
SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX
|
||||
SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 724 c_10: 8 XXX
|
||||
SG_ LAT_DIST : 18|11@0+ (0.005,-1000) [0|2047] "m" XXX
|
||||
SG_ LONG_DIST : 34|11@0+ (0.073,0) [0|255] "m" XXX
|
||||
SG_ COUNTER : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 674 d_1: 8 XXX
|
||||
SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX
|
||||
|
||||
BO_ 676 d_2: 8 XXX
|
||||
SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX
|
||||
|
||||
BO_ 678 d_3: 8 XXX
|
||||
SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX
|
||||
|
||||
BO_ 680 d_4: 8 XXX
|
||||
SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX
|
||||
|
||||
BO_ 682 d_5: 8 XXX
|
||||
SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX
|
||||
|
||||
BO_ 684 d_6: 8 XXX
|
||||
SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX
|
||||
|
||||
BO_ 686 d_7: 8 XXX
|
||||
SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX
|
||||
|
||||
BO_ 688 d_8: 8 XXX
|
||||
SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX
|
||||
|
||||
BO_ 690 d_9: 8 XXX
|
||||
SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX
|
||||
|
||||
BO_ 692 d_10: 8 XXX
|
||||
SG_ REL_SPEED : 17|10@0+ (0.2857,-146.278) [0|1023] "m/s" XXX
|
||||
|
||||
BO_ 672 NEW_MSG_5: 8 XXX
|
||||
SG_ NEW_SIGNAL_1 : 9|10@0+ (1,0) [0|1023] "" XXX
|
||||
SG_ NEW_SIGNAL_2 : 45|10@0+ (1,0) [0|1023] "" XXX
|
||||
|
||||
|
||||
|
||||
|
||||
CM_ SG_ 544 track_id "for message a_1 track_id is always 1, similar for other messages and track_id";
|
||||
CM_ SG_ 544 REL_ACCEL "perhaps REL_ACCEL because it responds faster and before REL_SPEED";
|
||||
CM_ SG_ 544 sig2 "perhaps distance to object. LONG_DIST or REL_ACCEL or REL_SPEED";
|
||||
CM_ SG_ 576 zeros "not always zero, sometimes has value when another car changes lanes";
|
||||
CM_ SG_ 706 LAT_DIST "positive is to the right, negative is to the left";
|
||||
1070
opendbc/ford_cgea1_2_bodycan_2011.dbc
Normal file
1070
opendbc/ford_cgea1_2_bodycan_2011.dbc
Normal file
File diff suppressed because it is too large
Load Diff
1487
opendbc/ford_cgea1_2_ptcan_2011.dbc
Normal file
1487
opendbc/ford_cgea1_2_ptcan_2011.dbc
Normal file
File diff suppressed because it is too large
Load Diff
421
opendbc/ford_fusion_2018_adas.dbc
Normal file
421
opendbc/ford_fusion_2018_adas.dbc
Normal file
@@ -0,0 +1,421 @@
|
||||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BS_:
|
||||
|
||||
BU_: XXX
|
||||
|
||||
BO_ 1280 Object_00: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1281 Object_01: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1282 Object_02: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1283 Object_03: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1284 Object_04: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1285 Object_05: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1286 Object_06: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1287 Object_07: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1288 Object_08: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1289 Object_09: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1290 Object_10: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1291 Object_11: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1292 Object_12: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1293 Object_13: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1294 Object_14: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1295 Object_15: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1296 Object_16: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1297 Object_17: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1298 Object_18: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1299 Object_19: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1300 Object_20: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1301 Object_21: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1302 Object_22: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1303 Object_23: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1304 Object_24: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1305 Object_25: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1306 Object_26: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1307 Object_27: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1308 Object_28: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1309 Object_29: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1310 Object_30: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1311 Object_31: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1312 Object_32: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1313 Object_33: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1314 Object_34: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1315 Object_35: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1316 Object_36: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1317 Object_37: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1318 Object_38: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1319 Object_39: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1320 Object_40: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1321 Object_41: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1322 Object_42: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1323 Object_43: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1324 Object_44: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1325 Object_45: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1326 Object_46: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1327 Object_47: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1328 Object_48: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1329 Object_49: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1330 Object_50: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1331 Object_51: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1332 Object_52: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1333 Object_53: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1334 Object_54: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1335 Object_55: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1336 Object_56: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1337 Object_57: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1338 Object_58: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1339 Object_59: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1340 Object_60: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1341 Object_61: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1342 Object_62: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
BO_ 1343 Object_63: 8 XXX
|
||||
SG_ X_Rel : 18|11@0+ (0.1,0) [0|0] "m" XXX
|
||||
SG_ V_Rel : 52|13@0- (0.01,0) [0|0] "m/s" XXX
|
||||
SG_ A_Rel : 33|10@0- (0.05,0) [0|0] "m/s2" XXX
|
||||
SG_ Angle : 12|10@0- (-0.1,0) [0|0] "deg" XXX
|
||||
|
||||
139
opendbc/ford_fusion_2018_pt.dbc
Normal file
139
opendbc/ford_fusion_2018_pt.dbc
Normal file
@@ -0,0 +1,139 @@
|
||||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BS_:
|
||||
|
||||
BU_: XXX
|
||||
|
||||
BO_ 130 EPAS_INFO: 8 XXX
|
||||
SG_ SteMdule_U_Meas : 39|8@0+ (0.05,6.0) [0|0] "Volts" XXX
|
||||
SG_ SteMdule_I_Est : 21|12@0+ (0.05,-64.0) [0|0] "Amps" XXX
|
||||
SG_ EPAS_FAILURE : 9|2@0+ (1,0) [0|0] "" XXX
|
||||
SG_ SteeringColumnTorque : 7|8@0+ (0.0625,-8.0) [0|0] "Nm" XXX
|
||||
SG_ SAPPAngleControlStat6 : 15|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ SAPPAngleControlStat5 : 14|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ SAPPAngleControlStat4 : 13|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ SAPPAngleControlStat3 : 12|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ SAPPAngleControlStat2 : 11|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ SAPPAngleControlStat1 : 23|2@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 118 Steering_Wheel_Data_CG1: 8 XXX
|
||||
SG_ SteWhlRelInit_An_Sns : 6|15@0+ (0.1,-1600.0) [0|0] "deg" XXX
|
||||
SG_ SteWhlRelCalib_An_Sns : 23|15@0+ (0.1,-1600.0) [0|0] "deg" XXX
|
||||
SG_ SteWhlRelInit2_An_Sns : 55|16@0+ (0.1,-3200.0) [0|0] "deg" XXX
|
||||
SG_ SteWhlAn_No_Cs : 39|8@0+ (1,0) [0|0] "" XXX
|
||||
SG_ SteWhlAn_No_Cnt : 47|4@0+ (1,0) [0|0] "Counts" XXX
|
||||
|
||||
BO_ 131 Steering_Buttons: 8 XXX
|
||||
SG_ Right_Turn_Light : 5|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ Left_Turn_Light : 4|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ Dist_Decr : 12|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ Dist_Incr : 11|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ Cancel : 8|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ Resume : 29|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ Set : 28|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ Main : 38|1@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 145 Yaw_Data: 8 XXX
|
||||
SG_ VehYaw_W_Actl : 39|16@0+ (0.0002,-6.5) [0|0] "rad/s" XXX
|
||||
SG_ VehRol_W_Actl : 23|16@0+ (0.0002,-6.5) [0|0] "rad/s" XXX
|
||||
SG_ VehPtch_W_Actl : 7|16@0+ (0.0002,-6.5) [0|0] "rad/s" XXX
|
||||
|
||||
BO_ 146 Accel_Data: 8 XXX
|
||||
SG_ VehVertAActl_D_Qf : 38|2@0+ (1,0) [0|0] "" XXX
|
||||
SG_ VehLongAActl_D_Qf : 22|2@0+ (1,0) [0|0] "" XXX
|
||||
SG_ VehLatAActl_D_Qf : 6|2@0+ (1,0) [0|0] "" XXX
|
||||
SG_ VehVert_A_Actl : 36|13@0+ (0.01,-40.0) [0|0] "m/s^2" XXX
|
||||
SG_ VehLong_A_Actl : 20|13@0+ (0.01,-40.0) [0|0] "m/s^2" XXX
|
||||
SG_ VehLat_A_Actl : 4|13@0+ (0.01,-40.0) [0|0] "m/s^2" XXX
|
||||
|
||||
BO_ 357 Cruise_Status: 8 XXX
|
||||
SG_ Brake_Drv_Appl : 5|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ Cruise_State : 11|4@0+ (1,0) [0|0] "" XXX
|
||||
SG_ Set_Speed : 23|8@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 516 EngineData_14: 8 XXX
|
||||
SG_ ApedPosScal_Pc_Actl : 1|10@0+ (0.1,0) [0|0] "%" XXX
|
||||
|
||||
BO_ 535 WheelSpeed_CG1: 8 XXX
|
||||
SG_ WhlRr_W_Meas : 55|14@0+ (0.04,0) [0|0] "rad/s" XXX
|
||||
SG_ WhlRl_W_Meas : 39|14@0+ (0.04,0) [0|0] "rad/s" XXX
|
||||
SG_ WhlFr_W_Meas : 23|14@0+ (0.04,0) [0|0] "rad/s" XXX
|
||||
SG_ WhlFl_W_Meas : 7|14@0+ (0.04,0) [0|0] "rad/s" XXX
|
||||
|
||||
BO_ 534 WheelData: 8 XXX
|
||||
SG_ WhlRotatRr_No_Cnt : 23|8@0+ (1,0) [0|0] "" XXX
|
||||
SG_ WhlDirRr_D_Actl : 33|2@0+ (1,0) [0|0] "" XXX
|
||||
SG_ WhlDirRl_D_Actl : 39|2@0+ (1,0) [0|0] "" XXX
|
||||
SG_ WhlDirFr_D_Actl : 37|2@0+ (1,0) [0|0] "" XXX
|
||||
SG_ WhlDirFl_D_Actl : 35|2@0+ (1,0) [0|0] "" XXX
|
||||
SG_ WhlRotatRl_No_Cnt : 31|8@0+ (1,0) [0|0] "" XXX
|
||||
SG_ WhlRotatFr_No_Cnt : 7|8@0+ (1,0) [0|0] "" XXX
|
||||
SG_ WhlRotatFl_No_Cnt : 15|8@0+ (1,0) [0|0] "" XXX
|
||||
SG_ WHEEL_ROLLING_TIMESTAMP : 47|8@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 947 Doors: 8 XXX
|
||||
SG_ Door_FL_Open : 61|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ Door_FR_Open : 60|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ Door_RL_Open : 48|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ Door_RR_Open : 49|1@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 963 BCM_to_HS_Body: 8 XXX
|
||||
SG_ Brake_Lights : 8|1@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 970 Lane_Keep_Assist_Control: 8 XXX
|
||||
SG_ Lkas_Action : 7|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ Lkas_Alert : 3|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ Lane_Curvature : 15|12@0+ (5e-06,-0.01) [0|0] "1/m" XXX
|
||||
SG_ Steer_Angle_Req : 19|12@0+ (0.04297,-88.00445) [0|0] "deg" XXX
|
||||
|
||||
BO_ 972 Lane_Keep_Assist_Status: 8 XXX
|
||||
SG_ LaHandsOff_B_Actl : 7|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ LaActDeny_B_Actl : 6|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ LaActAvail_D_Actl : 5|2@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 984 Lane_Keep_Assist_Ui: 8 XXX
|
||||
SG_ Set_Me_X80 : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ Set_Me_X45 : 47|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ Lines_Hud : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ Hands_Warning_W_Chime : 50|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ Hands_Warning : 49|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ Set_Me_X30 : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
CM_ SG_ 970 Lkas_Action "only vals 4, 5, 8, 9 seem to work. 4 and 5 are a bit smoother" ;
|
||||
|
||||
VAL_ 357 Cruise_State 4 "active" 3 "standby" 0 "off" ;
|
||||
VAL_ 970 Lkas_Action 15 "off" 9 "abrupt" 8 "abrupt2" 5 "smooth" 4 "smooth2" ;
|
||||
VAL_ 970 Lkas_Alert 15 "no_alert" 3 "high_intensity" 2 "mid_intensity" 1 "low_intensity" ;
|
||||
VAL_ 972 LaActAvail_D_Actl 3 "available" 2 "tbd" 1 "not_available" 0 "fault" ;
|
||||
VAL_ 984 Lines_Hud 15 "none" 11 "grey_yellow" 8 "green_red" 7 "yellow_grey" 6 "grey_grey" 4 "red_green" 3 "green_green" ;
|
||||
49
opendbc/generator/generator.py
Executable file
49
opendbc/generator/generator.py
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env python2
|
||||
import os
|
||||
import re
|
||||
|
||||
cur_path = os.path.dirname(os.path.realpath(__file__))
|
||||
generator_path = os.path.join(cur_path, '../')
|
||||
include_pattern = re.compile(r'CM_ "IMPORT (.*?)"')
|
||||
|
||||
|
||||
def read_dbc(dir_name, filename):
|
||||
with open(os.path.join(dir_name, filename)) as file_in:
|
||||
return file_in.read()
|
||||
|
||||
|
||||
def create_dbc(dir_name, filename):
|
||||
dbc_file_in = read_dbc(dir_name, filename)
|
||||
|
||||
includes = include_pattern.findall(dbc_file_in)
|
||||
|
||||
output_filename = filename.replace('.dbc', '_generated.dbc')
|
||||
output_file_location = os.path.join(generator_path, output_filename)
|
||||
|
||||
with open(output_file_location, 'w') as dbc_file_out:
|
||||
dbc_file_out.write('CM_ "AUTOGENERATED FILE, DO NOT EDIT"\n')
|
||||
|
||||
for include_filename in reversed(includes):
|
||||
include_file_header = '\n\nCM_ "Imported file %s starts here"\n' % include_filename
|
||||
dbc_file_out.write(include_file_header)
|
||||
|
||||
include_file = read_dbc(dir_name, include_filename)
|
||||
dbc_file_out.write(include_file)
|
||||
|
||||
dbc_file_out.write('\nCM_ "%s starts here"\n' % filename)
|
||||
|
||||
core_dbc = include_pattern.sub('', dbc_file_in)
|
||||
dbc_file_out.write(core_dbc)
|
||||
|
||||
|
||||
for dir_name, _, filenames in os.walk(cur_path):
|
||||
if dir_name == cur_path:
|
||||
continue
|
||||
|
||||
print dir_name
|
||||
for filename in filenames:
|
||||
if filename.startswith('_'):
|
||||
continue
|
||||
|
||||
print filename
|
||||
create_dbc(dir_name, filename)
|
||||
264
opendbc/generator/honda/_bosch_2018.dbc
Normal file
264
opendbc/generator/honda/_bosch_2018.dbc
Normal file
@@ -0,0 +1,264 @@
|
||||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BU_: EBCM EON CAM RADAR PCM EPS VSA SCM BDY XXX EPB
|
||||
|
||||
BO_ 228 STEERING_CONTROL: 5 EON
|
||||
SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS
|
||||
SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS
|
||||
SG_ SET_ME_X00_2 : 31|8@0+ (1,0) [0|0] "" EPS
|
||||
SG_ STEER_TORQUE : 7|16@0- (1,0) [-4096|4096] "" EPS
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" EPS
|
||||
|
||||
BO_ 232 BRAKE_HOLD: 7 XXX
|
||||
SG_ XMISSION_SPEED : 7|14@0- (1,0) [1|0] "" XXX
|
||||
SG_ COMPUTER_BRAKE : 39|16@0+ (1,0) [0|0] "" XXX
|
||||
SG_ COMPUTER_BRAKE_REQUEST : 29|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 304 GAS_PEDAL_2: 8 PCM
|
||||
SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON
|
||||
SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON
|
||||
SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 330 STEERING_SENSORS: 8 EPS
|
||||
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
|
||||
SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" EON
|
||||
SG_ STEER_ANGLE_OFFSET : 39|8@0- (-0.1,0) [-128|127] "deg" EON
|
||||
SG_ STEER_WHEEL_ANGLE : 47|16@0- (-0.1,0) [-500|500] "deg" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 344 ENGINE_DATA: 8 PCM
|
||||
SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON
|
||||
SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 380 POWERTRAIN_DATA: 8 PCM
|
||||
SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON
|
||||
SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 399 STEER_STATUS: 7 EPS
|
||||
SG_ STEER_TORQUE_SENSOR : 7|16@0- (1,0) [-31000|31000] "tbd" EON
|
||||
SG_ STEER_TORQUE_MOTOR : 23|16@0- (1,0) [-31000|31000] "tbd" EON
|
||||
SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 420 VSA_STATUS: 8 VSA
|
||||
SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON
|
||||
SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 450 EPB_STATUS: 8 EPB
|
||||
SG_ EPB_ACTIVE : 3|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ EPB_STATE : 29|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 464 WHEEL_SPEEDS: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 479 ACC_CONTROL: 8 EON
|
||||
SG_ SET_TO_1 : 20|5@0+ (1,0) [0|1] "" PCM
|
||||
SG_ CONTROL_ON : 23|3@0+ (1,0) [0|5] "" XXX
|
||||
SG_ RELATED_TO_GAS : 7|7@0+ (1,0) [0|69] "" XXX
|
||||
SG_ GAS_COMMAND : 0|9@0+ (1,0) [0|1] "" PCM
|
||||
SG_ GAS_BRAKE : 31|14@0- (1,0) [0|1] "" XXX
|
||||
SG_ ZEROS_BOH : 33|18@0+ (1,0) [100|100] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 495 ACC_CONTROL_ON: 8 XXX
|
||||
SG_ SET_TO_75 : 31|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ SET_TO_30 : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ZEROS_BOH : 23|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ZEROS_BOH2 : 47|16@0+ (1,0) [0|255] "" XXX
|
||||
SG_ SET_TO_FF : 15|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ SET_TO_3 : 6|7@0+ (1,0) [0|4095] "" XXX
|
||||
SG_ CONTROL_ON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 545 XXX_16: 6 SCM
|
||||
SG_ ECON_ON : 23|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ DRIVE_MODE : 37|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" BDY
|
||||
|
||||
BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ LONG_COUNTER : 55|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
BO_ 662 SCM_BUTTONS: 4 SCM
|
||||
SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON
|
||||
SG_ CRUISE_SETTING : 3|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 29|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 27|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 773 SEATBELT_STATUS: 7 BDY
|
||||
SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 777 CAR_SPEED: 8 PCM
|
||||
SG_ ROUGH_CAR_SPEED : 23|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ CAR_SPEED : 7|16@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ ROUGH_CAR_SPEED_3 : 39|16@0+ (1,0) [0|65535] "" XXX
|
||||
SG_ ROUGH_CAR_SPEED_2 : 31|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ ZEROS_BOH : 7|24@0+ (0.002759506,0) [0|100] "m/s" BDY
|
||||
SG_ FCM_OFF : 35|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_TO_1 : 36|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ACC_ON : 52|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ BOH_6 : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ IMPERIAL_UNIT : 55|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_TO_X1 : 56|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 804 CRUISE: 8 PCM
|
||||
SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 806 SCM_FEEDBACK: 8 SCM
|
||||
SG_ DRIVERS_DOOR_OPEN : 17|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ MAIN_ON : 28|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ RIGHT_BLINKER : 27|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ LEFT_BLINKER : 26|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ CMBS_STATES : 22|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 829 LKAS_HUD: 5 ADAS
|
||||
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
|
||||
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
|
||||
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY
|
||||
|
||||
BO_ 862 CAMERA_MESSAGES: 8 CAM
|
||||
SG_ ZEROS_BOH : 7|50@0+ (1,0) [0|127] "" BDY
|
||||
SG_ AUTO_HIGHBEAMS_ACTIVE : 53|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ HIGHBEAMS_ON : 52|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ ZEROS_BOH_2 : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 884 STALK_STATUS: 8 XXX
|
||||
SG_ AUTO_HEADLIGHTS : 46|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ HIGH_BEAM_HOLD : 47|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ HIGH_BEAM_FLASH : 45|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ HEADLIGHTS_ON : 54|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ WIPER_SWITCH : 53|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 891 STALK_STATUS_2: 8 XXX
|
||||
SG_ WIPERS : 17|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ LOW_BEAMS : 35|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ HIGH_BEAMS : 34|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PARK_LIGHTS : 36|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
|
||||
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
15
opendbc/generator/honda/_comma.dbc
Normal file
15
opendbc/generator/honda/_comma.dbc
Normal file
@@ -0,0 +1,15 @@
|
||||
BO_ 512 GAS_COMMAND: 6 EON
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ GAS_COMMAND2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" INTERCEPTOR
|
||||
SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR
|
||||
SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" INTERCEPTOR
|
||||
SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" INTERCEPTOR
|
||||
|
||||
BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
|
||||
SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-83.3) [0|1] "" EON
|
||||
SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-83.3) [0|1] "" EON
|
||||
SG_ STATE : 39|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ COUNTER_PEDAL : 35|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ CHECKSUM_PEDAL : 47|8@0+ (1,0) [0|255] "" EON
|
||||
|
||||
VAL_ 513 STATE 5 "FAULT_TIMEOUT" 4 "FAULT_STARTUP" 3 "FAULT_SCE" 2 "FAULT_SEND" 1 "FAULT_BAD_CHECKSUM" 0 "NO_FAULT" ;
|
||||
215
opendbc/generator/honda/_honda_2017.dbc
Normal file
215
opendbc/generator/honda/_honda_2017.dbc
Normal file
@@ -0,0 +1,215 @@
|
||||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BU_: EBCM ADAS PCM EPS VSA SCM BDY XXX EPB EON
|
||||
|
||||
BO_ 344 ENGINE_DATA: 8 PCM
|
||||
SG_ XMISSION_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON
|
||||
SG_ XMISSION_SPEED2 : 39|16@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ ODOMETER : 55|8@0+ (10,0) [0|2550] "m" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 380 POWERTRAIN_DATA: 8 PCM
|
||||
SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" EON
|
||||
SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ BRAKE_SWITCH : 32|1@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "rpm" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 420 VSA_STATUS: 8 VSA
|
||||
SG_ USER_BRAKE : 7|16@0+ (0.015625,-1.609375) [0|1000] "" EON
|
||||
SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_HOLD_RELATED : 52|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ BRAKE_HOLD_ACTIVE : 46|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_HOLD_ENABLED : 45|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 432 STANDSTILL: 7 VSA
|
||||
SG_ CONTROLLED_STANDSTILL : 0|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 464 WHEEL_SPEEDS: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_FR : 8|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_RL : 25|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ WHEEL_SPEED_RR : 42|15@0+ (0.01,0) [0|250] "kph" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 490 VEHICLE_DYNAMICS: 8 VSA
|
||||
SG_ LONG_ACCEL : 23|16@0- (0.0015384,0) [-20|20] "m/s2" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 506 BRAKE_COMMAND: 8 ADAS
|
||||
SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ SET_ME_0X80 : 31|8@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM
|
||||
SG_ ZEROS_BOH6 : 44|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ FCW : 43|2@0+ (1,0) [0|3] "" EBCM
|
||||
SG_ ZEROS_BOH4 : 55|8@0+ (1,0) [0|0] "" EBCM
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EBCM
|
||||
|
||||
BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ SET_TO_X55_2 : 47|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 773 SEATBELT_STATUS: 7 BDY
|
||||
SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_PASS_UNLATCHED : 10|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_PASS_LATCHED : 11|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_DRIVER_UNLATCHED : 12|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ PASS_AIRBAG_OFF : 14|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ PASS_AIRBAG_ON : 15|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 777 LOCK_STATUS: 8 XXX
|
||||
SG_ DOORS_UNLOCKED : 54|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOORS_LOCKED : 55|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ PCM_SPEED : 7|16@0+ (0.01,0) [0|250] "kph" BDY
|
||||
SG_ PCM_GAS : 23|8@0+ (1,0) [0|127] "" BDY
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH_2 : 35|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ IMPERIAL_UNIT : 54|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X01_2 : 55|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X01 : 48|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY
|
||||
|
||||
BO_ 804 CRUISE: 8 PCM
|
||||
SG_ HUD_SPEED_KPH : 7|8@0+ (1,0) [0|255] "kph" EON
|
||||
SG_ HUD_SPEED_MPH : 15|8@0+ (1,0) [0|255] "mph" EON
|
||||
SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" EON
|
||||
SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ BOH2 : 47|8@0- (1,0) [0|255] "" EON
|
||||
SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 829 LKAS_HUD: 5 ADAS
|
||||
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
|
||||
SG_ SET_ME_X41 : 6|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
|
||||
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|15] "" BDY
|
||||
|
||||
BO_ 892 CRUISE_PARAMS: 8 PCM
|
||||
SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 1029 DOORS_STATUS: 8 BDY
|
||||
SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
|
||||
CM_ SG_ 773 PASS_AIRBAG_ON "Might just be indicator light";
|
||||
CM_ SG_ 773 PASS_AIRBAG_OFF "Might just be indicator light";
|
||||
CM_ SG_ 780 CRUISE_SPEED "255 = no speed";
|
||||
CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed";
|
||||
CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc...";
|
||||
|
||||
|
||||
VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw" ;
|
||||
VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime" ;
|
||||
VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
71
opendbc/generator/honda/acura_ilx_2016_can.dbc
Normal file
71
opendbc/generator/honda/acura_ilx_2016_can.dbc
Normal file
@@ -0,0 +1,71 @@
|
||||
CM_ "IMPORT _honda_2017.dbc"
|
||||
CM_ "IMPORT _comma.dbc"
|
||||
|
||||
BO_ 145 KINEMATICS: 8 XXX
|
||||
SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" EON
|
||||
|
||||
BO_ 228 STEERING_CONTROL: 5 ADAS
|
||||
SG_ STEER_TORQUE : 7|16@0- (1,0) [-3840|3840] "" EPS
|
||||
SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS
|
||||
SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|0] "" EPS
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" EPS
|
||||
|
||||
BO_ 304 GAS_PEDAL_2: 8 PCM
|
||||
SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" EON
|
||||
SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" EON
|
||||
SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON
|
||||
|
||||
BO_ 316 GAS_PEDAL: 8 PCM
|
||||
SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" EON
|
||||
|
||||
BO_ 342 STEERING_SENSORS: 6 EPS
|
||||
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
|
||||
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
|
||||
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 399 STEER_STATUS: 7 EPS
|
||||
SG_ STEER_TORQUE_SENSOR : 7|16@0- (1,0) [-31000|31000] "tbd" EON
|
||||
SG_ STEER_TORQUE_MOTOR : 23|16@0- (1,0) [-31000|31000] "tbd" EON
|
||||
SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 419 GEARBOX: 8 PCM
|
||||
SG_ GEAR : 7|8@0+ (1,0) [0|256] "" EON
|
||||
SG_ GEAR_SHIFTER : 35|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 422 SCM_BUTTONS: 8 SCM
|
||||
SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON
|
||||
SG_ LIGHTS_SETTING : 1|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ MAIN_ON : 47|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ CRUISE_SETTING : 43|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 660 SCM_FEEDBACK: 8 SCM
|
||||
SG_ RIGHT_BLINKER : 6|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ LEFT_BLINKER : 5|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ WIPERS_SPEED : 4|2@0+ (1,0) [0|3] "" EON
|
||||
|
||||
CM_ SG_ 419 GEAR "10 = reverse, 11 = transition";
|
||||
CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
|
||||
CM_ SG_ 780 CRUISE_SPEED "255 = no speed";
|
||||
CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed";
|
||||
CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc...";
|
||||
|
||||
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
VAL_ 419 GEAR_SHIFTER 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
|
||||
VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
|
||||
VAL_ 422 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights" ;
|
||||
VAL_ 422 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ;
|
||||
VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime" ;
|
||||
VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw" ;
|
||||
VAL_ 780 HUD_LEAD 3 "no_car" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "CHFFR_METRIC 342 STEER_ANGLE STEER_ANGLE 0.36 180; CHFFR_METRIC 380 ENGINE_RPM ENGINE_RPM 1 0; CHFFR_METRIC 804 ENGINE_TEMPERATURE ENGINE_TEMPERATURE 1 0";
|
||||
59
opendbc/generator/honda/acura_rdx_2018_can.dbc
Normal file
59
opendbc/generator/honda/acura_rdx_2018_can.dbc
Normal file
@@ -0,0 +1,59 @@
|
||||
CM_ "IMPORT _honda_2017.dbc"
|
||||
CM_ "IMPORT _comma.dbc"
|
||||
|
||||
BO_ 342 STEERING_SENSORS: 6 EPS
|
||||
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" EON
|
||||
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" EON
|
||||
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 392 GEARBOX: 6 XXX
|
||||
SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ GEAR_SHIFTER : 27|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ GEAR : 36|5@0+ (1,0) [0|31] "" EON
|
||||
|
||||
BO_ 399 STEER_STATUS: 6 EPS
|
||||
SG_ STEER_TORQUE_SENSOR : 7|12@0- (1,0) [-2047.5|2047.5] "tbd" EON
|
||||
SG_ STEER_TORQUE_MOTOR : 23|16@0- (1,0) [-31000|31000] "tbd" EON
|
||||
SG_ STEER_STATUS : 35|4@0+ (1,0) [0|15] "" EON
|
||||
SG_ STEER_CONTROL_ACTIVE : 36|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 43|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 404 STEERING_CONTROL: 4 EON
|
||||
SG_ STEER_TORQUE : 7|12@0- (1,0) [-768|768] "" EPS
|
||||
SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS
|
||||
SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS
|
||||
SG_ COUNTER : 29|2@0+ (1,0) [0|15] "" EPS
|
||||
SG_ CHECKSUM : 27|4@0+ (1,0) [0|3] "" EPS
|
||||
|
||||
BO_ 422 SCM_BUTTONS: 8 SCM
|
||||
SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" EON
|
||||
SG_ LIGHTS_SETTING : 1|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ PARKING_BRAKE_LIGHT : 2|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ MAIN_ON : 47|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ CRUISE_SETTING : 43|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 487 BRAKE_PRESSURE: 4 VSA
|
||||
SG_ BRAKE_PRESSURE1 : 7|10@0+ (0.015625,-103) [0|1000] "" EON
|
||||
SG_ BRAKE_PRESSURE2 : 9|10@0+ (0.015625,-103) [0|1000] "" EON
|
||||
SG_ COUNTER : 29|2@0+ (1,0) [0|15] "" EON
|
||||
SG_ CHECKSUM : 27|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
BO_ 660 SCM_FEEDBACK: 8 SCM
|
||||
SG_ RIGHT_BLINKER : 6|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ LEFT_BLINKER : 5|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ WIPERS_SPEED : 4|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
CM_ SG_ 422 PARKING_BRAKE_LIGHT "Believe this is just the dash light for the parking break";
|
||||
VAL_ 392 GEAR_SHIFTER 0 "S" 1 "P" 2 "R" 4 "N" 8 "D" ;
|
||||
VAL_ 392 GEAR 26 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
|
||||
VAL_ 399 STEER_STATUS 6 "tmp_fault" 5 "fault_1" 4 "no_torque_alert_2" 3 "low_speed_lockout" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
|
||||
|
||||
CM_ "CHFFR_METRIC 342 STEER_ANGLE STEER_ANGLE 0.36 180; CHFFR_METRIC 380 ENGINE_RPM ENGINE_RPM 1 0; CHFFR_METRIC 804 ENGINE_TEMPERATURE ENGINE_TEMPERATURE 1 0";
|
||||
52
opendbc/generator/honda/honda_accord_lx15t_2018_can.dbc
Normal file
52
opendbc/generator/honda/honda_accord_lx15t_2018_can.dbc
Normal file
@@ -0,0 +1,52 @@
|
||||
CM_ "IMPORT _bosch_2018.dbc"
|
||||
|
||||
BO_ 401 GEARBOX: 8 PCM
|
||||
SG_ GEAR_SHIFTER : 5|6@0+ (1,0) [0|63] "" EON
|
||||
SG_ BOH : 45|6@0+ (1,0) [0|63] "" XXX
|
||||
SG_ GEAR2 : 31|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ GEAR : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ZEROS_BOH : 47|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 432 STANDSTILL: 7 VSA
|
||||
SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 446 BRAKE_MODULE: 3 VSA
|
||||
SG_ BRAKE_PRESSED : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 927 RADAR_HUD: 8 RADAR
|
||||
SG_ ZEROS_BOH : 7|10@0+ (1,0) [0|127] "" BDY
|
||||
SG_ CMBS_OFF : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_TO_1 : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ZEROS_BOH2 : 11|4@0+ (1,0) [0|1] "" XXX
|
||||
SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_TO_0 : 22|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ BOH : 40|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ BOH_2 : 30|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 1302 ODOMETER: 8 XXX
|
||||
SG_ ODOMETER : 7|24@0+ (1,0) [0|16777215] "km" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P" ;
|
||||
VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
|
||||
VAL_ 545 ECON_ON_2 0 "off" 3 "on" ;
|
||||
VAL_ 662 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
|
||||
VAL_ 662 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ;
|
||||
VAL_ 806 CMBS_BUTTON 3 "pressed" 0 "released" ;
|
||||
VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "CHFFR_METRIC 330 STEER_ANGLE STEER_ANGLE 0.36 180; CHFFR_METRIC 380 ENGINE_RPM ENGINE_RPM 1 0; CHFFR_METRIC 804 ENGINE_TEMPERATURE ENGINE_TEMPERATURE 1 0";
|
||||
48
opendbc/generator/honda/honda_accord_s2t_2018_can.dbc
Normal file
48
opendbc/generator/honda/honda_accord_s2t_2018_can.dbc
Normal file
@@ -0,0 +1,48 @@
|
||||
CM_ "IMPORT _bosch_2018.dbc"
|
||||
|
||||
BO_ 419 GEARBOX: 8 PCM
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
SG_ GEAR_SHIFTER : 29|6@0+ (1,0) [0|63] "" EON
|
||||
SG_ GEAR : 7|8@0+ (1,0) [0|255] "" EON
|
||||
|
||||
BO_ 432 STANDSTILL: 7 VSA
|
||||
SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 446 BRAKE_MODULE: 3 VSA
|
||||
SG_ BRAKE_PRESSED : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 19|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 927 RADAR_HUD: 8 RADAR
|
||||
SG_ ZEROS_BOH : 7|10@0+ (1,0) [0|127] "" BDY
|
||||
SG_ CMBS_OFF : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_TO_1 : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ZEROS_BOH2 : 11|4@0+ (1,0) [0|1] "" XXX
|
||||
SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_TO_0 : 22|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ LEAD_DISTANCE : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ BOH : 40|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ BOH_2 : 30|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 1302 ODOMETER: 8 XXX
|
||||
SG_ ODOMETER : 7|24@0+ (1,0) [0|16777215] "km" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
|
||||
VAL_ 419 GEAR_SHIFTER 32 "D" 8 "R" 4 "P" ;
|
||||
VAL_ 545 ECON_ON_2 0 "off" 3 "on" ;
|
||||
VAL_ 662 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
|
||||
VAL_ 662 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ;
|
||||
VAL_ 806 CMBS_BUTTON 3 "pressed" 0 "released" ;
|
||||
VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "CHFFR_METRIC 330 STEER_ANGLE STEER_ANGLE 0.36 180; CHFFR_METRIC 380 ENGINE_RPM ENGINE_RPM 1 0; CHFFR_METRIC 804 ENGINE_TEMPERATURE ENGINE_TEMPERATURE 1 0";
|
||||
@@ -0,0 +1,55 @@
|
||||
CM_ "IMPORT _bosch_2018.dbc"
|
||||
|
||||
BO_ 401 GEARBOX: 8 PCM
|
||||
SG_ GEAR_SHIFTER : 5|6@0+ (1,0) [0|63] "" EON
|
||||
SG_ BOH : 45|6@0+ (1,0) [0|63] "" XXX
|
||||
SG_ GEAR2 : 31|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ GEAR : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ZEROS_BOH : 47|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 432 STANDSTILL: 7 VSA
|
||||
SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 892 CRUISE_PARAMS: 8 PCM
|
||||
SG_ CRUISE_SPEED_OFFSET : 31|8@0- (0.1,0) [-128|127] "kph" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|15] "" EON
|
||||
|
||||
BO_ 927 RADAR_HUD: 8 RADAR
|
||||
SG_ ZEROS_BOH : 7|10@0+ (1,0) [0|127] "" BDY
|
||||
SG_ CMBS_OFF : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ZEROS_BOH3 : 31|32@0+ (1,0) [0|4294967295] "" XXX
|
||||
SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_TO_1 : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ZEROS_BOH2 : 11|4@0+ (1,0) [0|1] "" XXX
|
||||
SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_TO_0 : 22|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 1029 DOORS_STATUS: 8 BDY
|
||||
SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ TRUNK_OPEN : 41|1@0+ (1,0) [0|1] "" EON
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON
|
||||
|
||||
VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P" ;
|
||||
VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
|
||||
VAL_ 545 ECON_ON_2 0 "off" 3 "on" ;
|
||||
VAL_ 662 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
|
||||
VAL_ 662 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ;
|
||||
VAL_ 806 CMBS_BUTTON 3 "pressed" 0 "released" ;
|
||||
VAL_ 891 WIPERS 4 "High" 2 "Low" 0 "Off" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ "CHFFR_METRIC 330 STEER_ANGLE STEER_ANGLE 0.36 180; CHFFR_METRIC 380 ENGINE_RPM ENGINE_RPM 1 0; CHFFR_METRIC 804 ENGINE_TEMPERATURE ENGINE_TEMPERATURE 1 0";
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user