Commit Graph

177 Commits

Author SHA1 Message Date
Shane Smiskol 3d1be8427a
CAN packer/parser: clean up after alloc (#1007)
* Update packer_pyx.pyx

* this new also needs to be cleaned up
2024-02-06 19:02:08 -08:00
Shane Smiskol 2b96bcc456
CANParser: process all signals before updating values (#977)
* process all signals before ending early

* this is more clear

* this is more clear

* Revert "this is more clear"

This reverts commit 75511ec262c7a2c1b84a1e8cefe0d9f323a6834f.

* test!

* comment

* it would return false if any checksum or counter was invalid, not updating last_seen_nanos, so don't change behavior

* we can do this, but I don't like how it's reliant on last_seen_nanos (not explicit) to not break

* back to sanity

* cmt

* rename
2023-11-21 19:23:30 -08:00
Shane Smiskol 098fbe1b0e
CANParser: clip `counter_fail` to the max (#976)
* test

* fix

* clean up

* test

* fix

* clean up

* debug

* Revert "debug"

This reverts commit 3fc8cf5a2073d65cf1efa81515b420a29e8298a4.

* recover

* also can update at bottom since we don't break early

* changes

* Revert "changes"

This reverts commit a3b6fb5f6b38bb2f7ebd46c730487552bde8c6cb.

* don't need \n

* cmt

* no need to change print behavior here

* fix

fix

revert

* info needs \n
2023-11-17 23:53:13 -08:00
Shane Smiskol a7b8bcfebb
CANParser: rename timestamp variables (#972)
replace sec with nanos
2023-11-10 01:24:44 -08:00
Shane Smiskol 1b38ec5cfb
CANParser: capture C++ DBC parser exceptions (#965)
Update common.pxd
2023-10-25 13:51:15 -07:00
vanillagorillaa 23324b20e4
Honda: new EPS faulted value (#874)
* Honda: new EPS faulted value

* fix test

* fix
2023-09-20 00:13:48 -07:00
Dean Lee 538695192c
parser_pyx: build value maps for requied messages (#939) 2023-09-07 22:28:14 -07:00
Dean Lee 33c7097321
CanPacker: removing unnecessary string copying (#940)
remove string copy
2023-09-06 07:37:04 -07:00
Dean Lee 8f7e15202d
common_dbc.h: remove ARRAYSIZE (#941)
remove ARRAYSIZE
2023-09-06 07:35:52 -07:00
Adeeb Shihadeh 81aea1a7c3
pre-commit: autoupdate hooks (#931)
* Update pre-commit hook versions

* fix static analysis

---------

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-29 13:18:26 -07:00
Justin Newberry 034ca989bd
Parser: disallow duplicate message checks (#930) 2023-08-29 10:09:43 -07:00
Dean Lee bfc03db461
cpplint: more filters (#925)
more filters
2023-08-24 11:32:13 -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 eb5e9209ebfeeb9a8856305d00ea6f6fcb4efbad.

---------

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
Adeeb Shihadeh 7d61776e2b disable parser perf test for now 2023-08-08 11:15:16 -07:00
Shane Smiskol 46b59dd99e 'test_dbc_parser: ensure we're running on real DBCs'
Split from https://github.com/commaai/opendbc/pull/828
2023-08-05 00:03:47 -07:00
Adeeb Shihadeh 7d23b4c01b pre-commit: autoupdate hooks #908 2023-08-01 11:18:44 -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
Cameron Clough b03468a714
packer: import stdexcept (#897) 2023-07-14 16:48:22 +01: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 bc0bb60f4fdd8ffdca7197ff6dbd3cb50b857c30.

* 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
Shane Smiskol 2e54e4d4f2
CANPacker: don't track size (#895)
clean up
2023-07-14 03:47:25 -07:00
Shane Smiskol f45946fecb
test parser: cleanup test (#894)
* test

* Revert "test"

This reverts commit 406505313cfd6f45569a99fd9546475cb8f65179.

* no partial
2023-07-13 21:59:14 -07:00
Shane Smiskol fe8d535a7f
CANDefine: test all DBCs (#888)
* change addr for ioniq 6

* add new msg

* a test for this

* add to test_dbc_exceptions

* cmt

* fix
2023-07-07 01:09:24 -07:00
Shane Smiskol 33940105be
tests: global constants (#889)
small clean up
2023-07-07 01:02:12 -07:00
Dean Lee 008104f940
CANParser: check if signals exist (#870)
* check if signals exist

* add failing test

* better args and test msg in checks

* also need to check message addrs

* fix up new_msg

* consistent

* check signals if msg addresses are used

* cleanup

* cleanup

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-07-01 02:04:33 -07:00
Shane Smiskol ecd0613872
tests: rename CAN Parser performance test file (#872)
rename
2023-07-01 01:41:22 -07:00
Shane Smiskol 7a760a130a
CANParser: test missing messages in DBC (#871)
test
2023-06-30 15:29:46 -07:00
Cameron Clough 7e1f7d5b7e
setup cython linting (#851) 2023-06-14 15:55:49 +01:00
Shane Smiskol ae0d02ce2c
parser: fix wrong message name check/print (#846)
* can do this

* or just this

* rm
2023-05-30 16:05:08 -07:00
Kacper Rączy bffa93d782
dbc: add missing include for setlocale (#845) 2023-05-29 20:49:15 -07:00
Dean Lee 3ba8e77bd4
dbc: force C locale for numbers. (#839) 2023-05-23 22:03:19 -07: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
Adeeb Shihadeh 5adb62bf04
fix parser perf test (#827) 2023-04-21 13:11:53 -07:00
Willem Melching 9eec5335a0
DBC parser: assert no duplicate signal names in msg (#821)
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-04-17 09:59:20 -07:00
Adeeb Shihadeh f50e9d78bd
CANParser: add msg name to debug prints (#813) 2023-04-13 14:48:00 -07:00
Adeeb Shihadeh 3c81860270
test parser: bump up one signal threshold 2023-04-08 15:36:23 -07:00
Dean Lee f01929f0b9
CANParser: improve cython performance (#802)
* improve cython performance

* change thresholds

* Trigger CI

* reduce threshold for test all signals

* change

* reduce min

* change

* Trigger CI

* Trigger CI

* Trigger CI

* Trigger CI

* change

* Trigger CI

* Trigger CI

* Trigger CI

* Trigger CI

* Trigger CI

* Trigger CI

* Trigger CI

* Trigger CI

* Trigger CI

* Trigger CI

* change

* Trigger CI

* Trigger CI

* Trigger CI

* Trigger CI

* Trigger CI

* Trigger CI

* Trigger CI

* Trigger CI
2023-04-02 07:45:51 -07:00
Dean Lee 9a1de83e4b
CANParser: use emplace_back to reduce the cost of copying values (#797) 2023-03-31 13:51:14 -07:00
Dean Lee 0ff25034c4
CANParser: add performance test (#801)
* add benchmarks

* cleanup

* unittest

* thresholds

* add test for update_strings

* change thresholds

* increase to 50000

* trigger ci

* update thresholds

* trigger ci

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-03-31 13:50:03 -07:00
Dean Lee cc966f5c47
CANPacker: pass values by reference in cython (#803) 2023-03-28 12:33:37 -07:00
Dean Lee 1f0e04f444
libdbc: build both static and shared library (#786) 2023-03-27 16:01:39 -07:00
Willem Melching ee9f7e63b9
dbc.cc: put check for duplicate message name behind flag (#800) 2023-03-27 11:48:45 -07:00
Dean Lee b79b8f523a
CANParser: pass string by referer (#796) 2023-03-26 17:02:27 -07:00
Shane Smiskol 21457f0b46
CANParser: ts_nanos test (#785)
* ts_nanos tests

* check set is length 1

* same style as below
2023-02-20 15:19:05 -08: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 107b96abfc
add some type hints (#774)
* type stubs for common, parser_pyx

* Cleanup imports

* values are indeed floats

* common.pyi complete, added cpp stubs

* parser_pyx.pyi complete

* CANPacker completed

* Holding temp changes...

* remove *.pyi

* just remove skip-file

Co-authored-by: Jason Shuler <jshuler@gmail.com>
2023-01-01 17:09:27 -08:00
Adeeb Shihadeh 06a3e7db6f
add cpplint (#773)
* add cpplint

* passes

* bump cereal

* here's a real hash
2022-12-31 16:49:26 -08:00
Willem Melching 16efea3247
add missing iterator include (#747) 2022-11-15 10:51:42 -08:00
Dean Lee c131dce74e
CANParser: parse DBC from stream (#718) 2022-10-17 21:25:13 -07:00
Greg Hogan 738e8aaeac
CAN-FD messages can be 64 bytes (#711) 2022-09-25 08:31:57 -07:00