Closed marcelbuesing closed 2 years ago
It was taken from comma.ai opendbc: https://github.com/commaai/opendbc/blob/master/toyota_corolla_2017_pt_generated.dbc
The crate is fairly sensitive to order of the elements and white space. It basically needs to be reordered, some whitespace removed and missing semi-colons need to be added. At least some of the stuff should probably be fixed in can-dbc (e.g. unexpected whitespace).
I just added the cantools dbc test files as an integration test. There a quite a number of files (23/58) not working right now, fixing those should cover more dbc files. Cantools seems to ignore the order of the elements so it probably make sense to ignore it in this crate as well.
Just adding that I am trying to load a complete j1939 dbc file and hit parsing errors. I imagine many of the same issues as the failing tests you mention @marcelbuesing. Do you by chance have a good resource on the DBC format to help locate some of the errors?
Since it's a proprietary format all I can tell you is, you might find what you are looking for when searching Baidu.cn for dbc file format.
I think the issues right now are mostly:
So my goal is to finish the migration to nom 6 (nom6 branch) first so there is better error reporting (VerboseError). Help is welcome!
I took another comma dbc file and arranged some fields around to be more compatible to common understanding about dbc files. However there is something still wrong and I am unable to figure out why decoder does not like this file. toyota_prius_2017_pt_generated.dbc.zip
At least python cantools were able to parse it.
Error log from parser. I guess PRE_COLLISION_2
is the last message what it was able to parse.
Message {
message_id: MessageId(
836,
),
message_name: "PRE_COLLISION_2",
message_size: 8,
transmitter: NodeName(
"DSU",
),
signals: [
Signal {
name: "CHECKSUM",
multiplexer_indicator: Plain,
start_bit: 63,
signal_size: 8,
byte_order: BigEndian,
value_type: Unsigned,
factor: 1.0,
offset: 0.0,
min: 0.0,
max: 0.0,
unit: "",
receivers: [
"XXX",
],
},
],
},
],
message_transmitters: [],
environment_variables: [],
environment_variable_data: [],
signal_types: [],
comments: [],
attribute_definitions: [],
attribute_defaults: [],
attribute_values: [],
value_descriptions: [],
signal_type_refs: [],
signal_groups: [],
signal_extended_value_type_list: [],
},
[
66,
79,
EDIT: found the issue:
next one was BO_ 869 DSU_CRUISE : 7 DSU
which has extra
after name.
This particular issue is upstream problem. Comma.ai DBC files do not follow spec: https://github.com/commaai/opendbc/issues/151 https://github.com/commaai/opendbc/issues/329
I'll close this for now-
Originally posted by @andresv in https://github.com/technocreatives/dbc-codegen/issues/7#issuecomment-792576173