Commit Graph

166 Commits

Author SHA1 Message Date
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
martinl e95ed311c1
Add test for Subaru Brake_Status Signal1 large value (#702)
* Add test for Subaru Brake_Status Signal1 large value

* fix

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-09-07 20:37:36 -07:00
Comma Device d588872218 can parser: reduce spammy debug messages 2022-09-02 19:00:25 -04:00
Shane Smiskol b913296c91
CANParser: message counters affect can_valid (#688)
* use can_valid flag from parser and make it consider counter checks

* clean up

* don't show incorrect messages

* add comments

* move threshold to cpp parser

* fix
2022-08-19 18:11:45 -07:00
Shane Smiskol 1c4deed968
CANParser: move can valid threshold into parser (#690)
* use can_valid flag from parser and make it consider counter checks

* clean up

* don't show incorrect messages

* add comments

* move threshold to cpp parser

* only the refactor in this pr

* fix bug and same logic as old cython wrapper can invalid

* still print everything

* clean up

* whoops

* make these properties

revert that
2022-08-19 16:19:36 -07:00
Shane Smiskol 7e095a90af
Remove Toyota counter exception (#687)
* ignore PRE_COLLISION counter

* remove toyota exception
2022-08-18 22:05:26 -07:00
Adeeb Shihadeh 1619c9a40f
Hyundai: add HDA1 singals (#686)
* Hyundai: Car Port for Tucson Hybrid 2022

* Button send attempt

* Fix bit

* Send button fixed bits

* Define all bytes and only send PAUSE/RESUME

* Use CRUISE_INFO to cancel cruise and resume

* LFA and HDA icons

* Send LFA and HDA icons based on engageability

* Update hyundai_tucson_hev_2022.dbc

* GEAR has 24 bytes only

* Fix CRUISE_INFO copy

* Combine LFA_GREY and LFA_GREEN

* LKAS_BTN -> LFA_BTN

* Little endian

* add to ev6 dbc

* rm old stuff

* another val

Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
Co-authored-by: Jason Wen <47793918+sunnyhaibin@users.noreply.github.com>
2022-08-18 17:33:00 -07:00
Adeeb Shihadeh 4885685171 fix that 2022-08-08 19:08:04 -07:00
Adeeb Shihadeh 8016dd43ac CANParser: better error for undefined messages 2022-08-08 18:58:35 -07:00
Adeeb Shihadeh d9a55f4f7c remove one more duplicate 2022-07-29 15:31:08 -07:00
Adeeb Shihadeh 4195e8f4c9 enabling this broke a bunch of stuff, revert for now 2022-07-21 20:22:52 -07:00
Adeeb Shihadeh 31bb1832fc always set checksum 2022-07-21 19:47:20 -07:00