Commit Graph

31 Commits

Author SHA1 Message Date
Dean Lee b4842fd3c5
build message lookup table in DBC (#942)
* build message lookup table in dbc

* constify it

* no need to make this more dense

* Return empty values and log an error for invalid addresses.

log error for undefined signal

add comment

use LOGE

* save one map lookup

* only try what is to be traught

* rename back

* from merge

* show addr

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2024-06-07 17:59:22 -07:00
Shane Smiskol 1b38ec5cfb
CANParser: capture C++ DBC parser exceptions (#965)
Update common.pxd
2023-10-25 13:51:15 -07:00
Justin Newberry 034ca989bd
Parser: disallow duplicate message checks (#930) 2023-08-29 10:09:43 -07:00
Adeeb Shihadeh a1582f5e28
CANParser: parse all signals for given messages (#828)
* CANParser: parse all signals for a message

* update tests

* just use a pair

* rm enforce checks

* rm that

* spacing

* fix nonexistent message test

* message addr check should not have been deleted

* can be cleaned up more

* remove that too

* add comment back

* revert default bus behavior

revert default bus behavior

* can combine this loop

* unused map

* add all

* ensure we track all signals

* remove sanity check

* this wasn't tested before

* Revert "this wasn't tested before"

This reverts commit eb5e9209eb.

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-10 18:49:14 -07:00
Kacper Rączy df9c11ddc1
parser: update_strings propagate cpp exceptions in py bindings (#912)
* Propagate cpp exceptions to py

* Add a test case

* Update can/tests/test_dbc_exceptions.py

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

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-10 13:03:55 -07:00
Shane Smiskol 3ef35ed229
Revert "CANPacker: refactor to avoid undefined signals (#891)" (#899)
This reverts commit 3a0083b41e.
2023-07-17 22:17:11 -07:00
Dean Lee 3a0083b41e
CANPacker: refactor to avoid undefined signals (#891)
* refactor to avoid undefined signals

* add non-zero offset check

* Revert "add non-zero offset check"

This reverts commit bc0bb60f4f.

* clean up

* use underscores, we haven't standardized one or the other yet

* use message name

* test it works

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-07-14 04:41:27 -07:00
Cameron Clough 7e1f7d5b7e
setup cython linting (#851) 2023-06-14 15:55:49 +01:00
Dean Lee 8faada0494
refactor CANParser to improve performance (#795)
* reduce the const of copying signal values in CANParser::query_latest

* pass by reference

* use for range loop

* update_strings

* use assign

* track all signals

* use iterator & pointer to avoid copy SignalValue from vector

* use normal dict for vl_all

* update tests

* fix error in merge master

* change thresholds

reduce thresholds

* Trigger CI

* Trigger CI

* Trigger CI

* cleanup ctor

* reduce threshold

* revert changes to test_parser.py

* change thresholds

* remove update_string() from cython

* comment out test_performance_one_signal

* reduce thresholds

* test

* update

* update

* revert that for now

* update

* update

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-04-22 17:54:36 -07:00
Dean Lee cc966f5c47
CANPacker: pass values by reference in cython (#803) 2023-03-28 12:33:37 -07:00
Dean Lee b79b8f523a
CANParser: pass string by referer (#796) 2023-03-26 17:02:27 -07:00
Shane Smiskol d103b156b3
CANParser: add timestamp field (#779)
* add timestamp back, logMonoTime

* rename ts_nanos
2023-02-07 23:00:22 -08:00
Adeeb Shihadeh 387dcf9628
teach the packer how to count (#669)
* teach the packer how to count

* fix tests

* same as checksum

* little test
2022-07-21 17:51:49 -07:00
Jason Young 2afccacd52
VW PQ: Message updates, checksum and counter support (#633)
* refactor MQB checksum/counter to prep for PQ

* first pass at PQ checksums and counters

* remove checksum and counter alignment checks

* forgot HCA_1

* Revert "remove checksum and counter alignment checks"

This reverts commit 0d30ee9b85.

* don't check counter offset

* tweak comment

* handle checksum not starting at zero

* remove unused argument

* add LDW_Textbits to LDW_1

* Update can/common.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* fix counter again; minimize diff

* additional door-open signals

* add trunk lid state

* update LDW_Status message and signals

* typo

* make XOR checksum generic

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-07-15 10:29:12 -07:00
Adeeb Shihadeh dd5c3f1bbd
packer/parser: generic counter handling (#659)
* packer/parser: generic counter handling

* pedal isn't special
2022-07-11 12:36:43 -07:00
Jason Young fe6241dcc6
refactor per-manufacturer checksum calculation (#650)
* synchronize function signatures

* if-spaghetti reduction

* add to cython

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-06-30 11:31:58 -07:00
Adeeb Shihadeh 1599f2e370
Kia EV6 (#567) 2022-05-15 18:26:19 -07:00
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 5e1a4440e4.

* 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
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 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 24538ceb04 Revert "CANParser: add field for all updated values (#548)"
This reverts commit da47fe5e45.
2022-02-09 22:01:25 -08:00
Shane Smiskol 6770f1cdfb
CANParser: remove ts field (#557)
more usages
2022-02-09 11:59:15 -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 fd4558289d.

* fix order

* use vals

* fix dup
2022-02-07 15:36:00 -08:00
Shane Smiskol eea4ba1cba
CANParser: remove configurable default values (#527) 2022-01-27 17:02:12 -08:00
Dean Lee b6ceded26b
use std::string for SignalPackValue::name (#390) 2021-09-02 14:25:47 -07:00
Adeeb 7f3b1774dd
Chrysler: calculate checksum in can packer/parser (#255)
* calculate chrysler checksum in can packer/parser

* remove comment
2020-04-30 14:06:26 -07:00
Adeeb a57e7ddbd7
CANPacker: Subaru checksum support (#241)
* subaru global: use standard checksum signal naming convention

* subaru checksum

* ignore first byte

* update other subaru dbcs

* revert outback changes, checksum is in a different byte
2020-04-13 15:06:28 -07:00
Willem Melching 0ba7926bfe unify can packer and parser 2019-12-03 08:43:05 -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