Commit Graph

27 Commits

Author SHA1 Message Date
Shane Smiskol b302f6934e
Dynamically parse DBCs (#602)
* initial commit, bring over from deanlee's PR based on newer commit

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* fix msb, lsb, size

* fix lsb

* clean up

* need this for CI

* add missing body checksum/counter

* get dir from BASEDIR first, then $HOME

* fix CI

* doesn't work

* just hardcode when compiling

* remove process_dbc

* add test for startup time

* test can parsing

* fix

* better

* bye bye dbc.py

* fix startswith

* add function to get dbc names for plotjuggler

* check DBC_FILE_PATH

* revert

* rename

* slightly more consistent at ~0.57 seconds

* make sure the tests make sense

* test ms per line

* use ctre

* Revert "use ctre"

This reverts commit 5e1a4440e465c901403a9717bbdef5b573e9838e.

* compile regex at import time

* add debug print and lower test time

* add comment

* 0.02 ms per line max

* better error messages

* only include what we need, and make it explicit

* check total time

check total time

* no global

* always a list

* not a c loop any more

* default to list

* use hex

* make static (only calculate path once)

* seems to be more consistent now (30-38 ms)

Co-authored-by: Dean Lee <deanlee3@gmail.com>
2022-05-12 17:59:33 -07:00
Adeeb Shihadeh 004db342a8
CANParser: add flag for bus timeout (#586)
* CANParser: add flag for bus timeout

* bump to 500ms

* 10x most frequent msg

* little test

* per bus

* Update can/parser.cc
2022-04-12 22:34:27 -07:00
Chris Souers 5a51aa7dde
Fix Honda checksum for extended CAN IDs. Add test function. (#585)
* Fix checksum for Honda extended CAN. Add test.

* revert packer_parser test

* begin test_checksum

* todo and comments

* convention

* unused

* forgot the s

* again

* cleanup

* remove that too

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-04-06 21:33:57 -07:00
Adeeb Shihadeh 859fea7ded
CAN FD support in packer + parser (#568)
* can fd support in packer + parser

* don't need these anymore

* fix pedal crc

* fix dynamic parsing

* cleanup

* packer test
2022-02-28 09:10:34 -08:00
Adeeb Shihadeh 298c830739
Cleanup dead code in CAN parser + packer (#573)
* remove duplicate implementation

* Cleanup dead code in CAN parser + packer

* little more
2022-02-24 22:58:37 -08:00
Shane Smiskol c3d3c71aa7
CANParser: fix missing updated values (#561)
* test to make sure we don't throw away updated values if we get multiple can frames from boardd

* call cpp's update_string from update_strings

* fix test

* split in half

fix
2022-02-10 14:40:15 -08:00
Shane Smiskol 053a761244
CANParser: add field for all values from a cycle (#558)
* could work

* should be light-speed

* clean up

* clean up

* make sure updated is empty if nothing is updated

updating without a msg is undefined behavior

* should be fast enough

* more test

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-02-10 13:01:30 -08:00
Adeeb Shihadeh f74f93629b
CANParser: minor speedup (#560) 2022-02-09 22:46:28 -08:00
Adeeb Shihadeh 24538ceb04 Revert "CANParser: add field for all updated values (#548)"
This reverts commit da47fe5e45.
2022-02-09 22:01:25 -08:00
Shane Smiskol da47fe5e45
CANParser: add field for all updated values (#548)
* add updated field

* rename to updated

* draft

* clean up

* function for resetting

* *minor* refactor

* clean up names

* keep track of updated vals in the cc parser

* remove extra lines

* remove ts

* match parser_pyx

* cleaner to just call the cpp function as we don't need to aggregate updated values

* draft

* some tests

* fix test

* clean up

clean up

* test clean up

* add clarifying comments

* Revert "remove ts"

This reverts commit fd4558289d6667a42ab41c4511b0d8fe54eb7fc8.

* fix order

* use vals

* fix dup
2022-02-07 15:36:00 -08:00
Shane Smiskol 60a246c0a8
tests: remove CANParser default values (#550)
* remove default vals

* remove default vals
2022-02-03 00:24:45 -08:00
Adeeb Shihadeh 51e327947a update test 2022-01-27 08:58:43 -08:00
Marc Wimmershoff 8a62233a83
Python DBC CAN encoder, fix scale/offset (#428)
* Bugfix in dbc CAN encoder

While encoding, we need to subtract the offset first before we apply the factor.

* Update dbc.py

* Forgot to add import for assert_almost_equal

* test against C++ can packer

* turn into unittest

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-10-20 16:05:43 +02:00
Willem Melching c7caba4a5c
C++ CAN Packer, add test for scale/offset (#455) 2021-10-20 15:48:15 +02:00
Adeeb Shihadeh 79530d3038
CANParser: add option to enforce message checks (#385)
* CANParser: add option to enforce message checks

* fix testss

* nice error msg

* fix tests
2021-04-24 23:09:56 -07:00
Adeeb Shihadeh 652348a3be
fix generator test and linter (#323)
* fix generator test

* generator cleanup
2020-12-03 13:07:09 -08:00
Adeeb Shihadeh c072d9e8df remove redundant linter checks 2020-11-26 11:36:10 -08:00
Adeeb Shihadeh 244e8807df
ubuntu 16.04 -> 20.04 (#309) 2020-10-29 13:53:48 -07:00
vanillagorillaa fb90ff7a46
Fix all typos in opendbc (#299) 2020-09-29 11:59:26 -07:00
grekiki ccd7d3e438
Fix 222 (#296)
* Added exceptions to packer and parser

* added exception tests

* improve style

* linter is annoying

* static analysis fix

* static analysis fix2

* static analysis fix3

* clean up the code

* update exceptions

* style1

* style2
2020-09-10 15:01:34 +02:00
martinl efb1e38aec
Subaru DBC update (#277)
* Add Subaru Global 2020 dbc

* Rename duplicate Cruise_Status to Cruise_Status_2

* Unify Subaru Crosstrek 2018 and Subaru Global 2017 dbc

* Add ES_DashState Cruise_On, initial Crosstrek 2020 Hybrid Transmission Gear

* dbc syntax fix

* Add R to gear values

* Add Throttle_Hybrid signal

* Use DBC generator for Subaru Global

* Remove Gear from _subaru_global_2017 template

* Fix packer parser test

* Add Checksum and Counter signals to Throttle_Hybrid

* Add filler signal to Brake_Pedal

* Correct dbc min-max values for subaru global 2017 template

* Correct Subaru global min|max values vol2

* Run generator

* rename _subaru_global_2017.dbc template to _subaru_global.dbc
2020-07-23 11:44:14 -07:00
rbiasini 53fc4487a5
added generator test (#207)
* added generator test
2019-12-16 21:53:38 +01:00
rbiasini d309cdce78
Added linter to opendbc (#203)
* Added linter to opendbc

* this?

* This should work

* another try

* added pylintrc
2019-12-03 14:50:23 -08:00
Willem Melching 541705bf33 move CANDefine to parser code 2019-12-03 09:13:37 -08:00
Willem Melching da25c52a8e add test for can define 2019-12-03 09:05:02 -08:00
Willem Melching 25d88009b6 consistent naming 2019-12-03 08:22:16 -08:00
rbiasini e155e01748
Can migration (#199)
* moved CAN to opendbc

* also dbc was needed

* dbc test also added
2019-11-22 21:46:33 -08:00