Begin creating script that converts YAML file to DBC file.#21
Begin creating script that converts YAML file to DBC file.#21jackiezeng01 wants to merge 13 commits intoolin-electric-motorsports:mainfrom
Conversation
|
|
||
| def dbcSignalGenerator(signals_dict, dbc_file): | ||
| ''' | ||
| Input: DBC |
There was a problem hiding this comment.
this doc string could be better
|
|
||
| yaml_dict = loadYaml(yaml_filename) | ||
| messagesTX_dict = yaml_dict["Messages-TX"] | ||
| messagesRX_dict = yaml_dict["Messages-RX"] |
There was a problem hiding this comment.
comment out if not using for now
|
nice work! only major comment is that it would be nice if you put some thought into error catching, generally better to have functions return a success/error code rather than have them just run and write something to a file |
…jackiezeng01/main
…jackiezeng01/main
…jackiezeng01/main
|
|
||
| # Parse signal dict and set variables to be used to generate DBC | ||
| SIGNAL_NAME = signal | ||
| global BIT_START |
There was a problem hiding this comment.
any particular reason why we need this to be global instead of just initializing it as BIT_START=0 at the top of function?
| # lets start by just extracting the info thats therews | ||
| output = {} | ||
| for index, row in data.iterrows(): | ||
| if index > 16 or index < 11: |
There was a problem hiding this comment.
magic numbers? please leave a comment for this
| row_out['purpose'] = row['Purpose'].strip() | ||
|
|
||
| signal_names = [] | ||
| for i in range(8): |
There was a problem hiding this comment.
are there always 8 signals? can we make this a flexible range instead of hard-coded?
|
Is this still being worked on? |
No description provided.