Commit Graph

1013 Commits

Author SHA1 Message Date
Shane Smiskol 120ea2c5bb
safety test: fix incorrect error message (#1702)
don't add a generator
2023-10-31 18:04:40 -07:00
Shane Smiskol 7304f92663
safety test: simplify tx address check (#1701)
* convert to set

* Revert "convert to set"

This reverts commit 85863c37a7.

* minor speed up
2023-10-31 17:58:30 -07:00
Shane Smiskol f3bdfdd435 Rename safety coverage flag 2023-10-30 11:43:56 -07:00
Shane Smiskol da66779b43
safety: coverage report (#1696)
* coverage report

* test script

* not needed

* option

* options

* re-build if file missing

* rename

* rename flag

* just always build

* cmt

* fix rebuild, panda.c is what does gens gcno

* clean up

* check coverage

* rename

* add skip flag

* Revert "add skip flag"

This reverts commit 6991c174ce.

* both do same thing

* clean up script

* don't test here

* Revert "don't test here"

This reverts commit 43fe4c961f.

* try running in CI

* nproc

* move

* Revert "try running in CI"

This reverts commit 912017c7fa.

* don't test here

* fix path

* re-compiling does this
2023-10-25 22:01:01 -07:00
Shane Smiskol f62d1723fd
Hyundai CAN: fix driver torque safety scaling (#1695)
* how does this/did that pass?!

* fix misra

* add comment

* we could do this

* or could do what eps torque does

* another pr

* not unused

* need this for special gm

* support testing integer torque

cmt

* there we go

* stash again

* Revert "stash again"

This reverts commit 4ecf6cc91c.

* this works!

* clean up

* cmt

* ugh this test was broken

* add some comments for this behemoth, and switch to rxing real msgs

* for now, no measurement test since we don't have any info about driver torque on can. for ex:

max value, factor on CAN, etc.

clean up

* more clean up

* just use it everywhere

* better cmt

* cmt
2023-10-24 23:20:33 -07:00
Shane Smiskol f8c2041a9c
safety tests: fix driver torque override test (#1698)
* this was failing for the wrong reason

* stash

* Revert "stash"

This reverts commit b29e09ca85.

* call it driver torque

* Revert "call it driver torque"

This reverts commit 1ed5ce5ebe.
2023-10-24 22:44:30 -07:00
Shane Smiskol 331829bfac
safety tests: clean up measurement tests (#1694)
* hmm this works

* hyundai fix in another pr

* support testing integer torque

cmt

* there we go

* Revert "there we go"

This reverts commit 6c5a19aad8.

* Revert "support testing integer torque"

This reverts commit 2c381077d5.

* clean up

* Update tests/safety/common.py
2023-10-23 20:04:05 -07:00
Shane Smiskol 229107f120
replay drive: fix space formatting 2023-10-19 19:57:10 -07:00
Shane Smiskol 549fa32fc7
safety replay: support Toyota LTA angle control (#1693)
* safety replay: support toyota lta

* one line
2023-10-17 16:48:13 -07:00
Adeeb Shihadeh 7b323413d2
jenkins: run bootkick tests (#1688)
* jenkins: run bootkick tests

* flip that

* little longer

* increase

* disable can

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-10-09 21:52:15 -07:00
Adeeb Shihadeh aaa1172fa2
HITL bootkick tests (#1685)
* HITL bootkick tests

* both bootkick cases

* more

* som use gpio

* cleanup

* pretty reliable now
2023-10-06 13:38:35 -07:00
Adeeb Shihadeh ea826ccea6
CI: whitelist hitl jungles (#1687)
Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-10-05 18:27:33 -07:00
Igor Biletskyy 5778c0ae5d
H7: fix GMLAN bitbang timer (#1542)
* init

* move Adeeb's test

* bitbang expected to fail can_health
2023-10-03 13:14:14 -07:00
Shane Smiskol 43af1df79e
safety: sample_t is not fully reset on safety mode init (#1376)
* found another bug!

* update test

* why does toyota add 1 but not chrysler?!

* test/fix others

* clean up

* more

* global

* clean up

* one function to reset AND update

* without abs and only negative values: this is not caught (since negative error < 1)

* ugly draft

* clean up, tests work

* now only should use this function

* better cmt

* better loc

* constant in python too!

* actually duplicate comment
2023-10-03 03:15:16 -07:00
Shane Smiskol 846c807797
safety tests: fix measurement test (#1679)
* Update common.py

* without abs and only negative values: this is not caught (since negative error < 1)

* ugly draft

* this catches it

* draft

* draft

* draft

* works now!

* no blurry tests

* ugh subaru is like this too

* okay some can scaling makes it slightly off (wheel speeds)

* uncommont

* clean up
2023-10-03 02:46:58 -07:00
Shane Smiskol 635db84095
Subaru: consider true angle sign in safety (#1681)
* this fails

* this doesn't!
2023-10-03 02:18:10 -07:00
Shane Smiskol 9fd1b268b4
Nissan: consider true sign in safety (#1680)
* works

* simpler

* cmt again

* better
2023-10-03 01:50:37 -07:00
Adeeb Shihadeh 43bed1aa47
jungle HITL tests setup (#1665)
* setup new zoo

* run

* fix

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-09-30 23:19:06 -07:00
Adeeb Shihadeh b6e37f25b6
Remove flash logging (#1674)
* Revert "Disable flash logging (#1667)"

This reverts commit 62db60595b.

* Revert "Faster log retrieval (#1484)"

This reverts commit 694aae9c26.

* Revert "Flash bounds checking outside of bootstub (#1459)"

This reverts commit 054344de6b.

* Revert "Logging (#1445)"

This reverts commit 0cc91a7f7b.

* cleanup

* cleanup
2023-09-30 12:49:46 -07:00
Adeeb Shihadeh 62db60595b
Disable flash logging (#1667)
* disable logging to flash

* update tests

* fix hitl
2023-09-21 15:28:19 -07:00
Justin Newberry 90eb24bf19
Safety: assert that torque safety modes check the steering request bit (#1625)
* test the steering request bit

* not in the angle yet

* not angle yet

* fixes

* draft

* can do this

* adapting the 3 steer req mismatch tests might be too intricate

Revert "can do this"

This reverts commit 775abf877b.

* don't change safety and test the actual behavior

* add comment

* rm

* revert

* For example, now this caught

* "fix"

* Update tests/safety/common.py

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-13 01:08:37 -07:00
Adeeb Shihadeh 047d36398d
SPI flash dump + restore tools (#1654)
* dump

* restore

* fix

* update

* update

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-09-12 20:04:54 -07:00
Justin Newberry d4e63daf34
VW PQ: Check steer req bit (#1630)
* vw pq

* misra
2023-09-11 13:59:30 -07:00
Adeeb Shihadeh d87d33cb51
pre-commit: autoupdate hooks (#1639)
* Update pre-commit hook versions

* fix

---------

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
2023-09-07 19:10:30 -07:00
Justin Newberry cb0cd1bfaa
Subaru: add safety around cutting steer req bit (#1632)
* wip

* steer bit

* add tolerance

* increase a bit more

* test too

* Had that backwards

* Here too

* review suggestions

* minimal diff

* minimal diff

* add type hints

* spacing

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

* update test name

* add tolerance comment

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

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-06 20:34:24 -07:00
Justin Newberry c12cbc1b94
Safety: separate test for steer request bit cutting (#1653)
* common test for that

* canfd too

* we set this everywhere

* never none

* subclass

* Update tests/safety/common.py

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-06 19:35:54 -07:00
Jason Wen 39bc5a4886
Nissan Altima: add a param for alternate EPS bus (#1649)
* Nissan Altima: Specify panda flag for alt bus safety config

* test this safety mode

* test this safety mode

* rm

* nl

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-09-06 00:46:33 -07:00
Shane Smiskol 0b6adad9c8
Nissan: test alternate EPS bus param (#1651)
* test this safety mode

* test this safety mode

* use int

* clean up

* clean up
2023-09-06 00:36:25 -07:00
Justin Newberry 104d708547
Precommit: ensure executable bit is set (#1650)
* precommit ensure executable

* fix the violations

* the correct shebang
2023-09-05 15:32:44 -07:00
Justin Newberry 72f1603a89
VW MQB: Check steer req bit (#1631)
vq mqb
2023-09-01 16:32:08 -07:00
Justin Newberry 62bb0c2e33
Subaru: gen2 long safety (#1594)
gen2 long safety
2023-09-01 13:08:04 -07:00
Jason Wen 579fff0c2f
Safety tests: Convert message addresses from decimal to hexadecimal (#1633) 2023-08-31 20:13:37 -07:00
Justin Newberry ef1a9338a1
Chrysler: check steer bit (#1628)
* chrysler

* misra
2023-08-31 16:01:16 -07:00
Justin Newberry fbe81a1753
GM: check steer req bit (#1629)
for gm
2023-08-31 16:01:05 -07:00
Justin Newberry f4d0904d94
Subaru: preglobal check steer req bit (#1626) 2023-08-31 14:26:51 -07:00
Adeeb Shihadeh bc2f10da57 Revert "pre-commit: autoupdate hooks (#1618)"
This reverts commit 526588b3e9.
2023-08-30 10:38:12 -07:00
Justin Newberry e30ba9547c
Subaru: add steer req bit test (#1613)
add active bit test
2023-08-30 01:29:27 -07:00
Adeeb Shihadeh 526588b3e9
pre-commit: autoupdate hooks (#1618)
* Update pre-commit hook versions

* fix ranges

---------

Co-authored-by: adeebshihadeh <adeebshihadeh@users.noreply.github.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-30 01:27:07 -07:00
Jason Wen e6c1648835
Hyundai CAN-FD: Alternate `LKAS` steering message (#1504)
* new steering message!

* fix

* check tx

* fix var

* allow all tx to test LFA suppression

* Attempt to block laneline information to suppress LFA

* Try 0x364

* Block all bus 2/6 messages

* Final test to block LFA

* Fix tx

* in another PR

* cleanup

* lint

* Add new tx to unit test

* linter

* Apply suggestions

* Revert to this

* Unnecessary

* clean up

* rename to hda2

* prototype

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-29 23:40:14 -07:00
Shane Smiskol ca9d8675b9
Revert "Toyota: ACC message relay check (#1612)" (#1617)
This reverts commit 5a9d8cfaaf.
2023-08-28 23:18:42 -07:00
Shane Smiskol 5a9d8cfaaf
Toyota: ACC message relay check (#1612)
* toyota: add safety for tester present

* block ACC_HUD

* check stock ECU

* clean up

* not this

* test new addr

* comment

* rm

* cmt
2023-08-27 15:43:59 -07:00
Shane Smiskol cca252c8d4
Honda: match openpilot button enable check (#1607)
* NONE -> not BUTTON

* update test and fix safety

* cleaner
2023-08-25 16:11:08 -07:00
Igor Biletskyy 0a32b17513
H7: few more Kb of RAM found (#1605)
* init

* remove discard
2023-08-24 16:56:31 -07:00
Willem Melching a48678f625
MacOS: Homebrew GCC is now version 13 (#1603) 2023-08-24 13:52:59 -07:00
Justin Newberry 04df95db1c
Subaru: add new angle LKAS message definitions (#1602)
* just add the lkas message to start

* added to tests too

* default parameter
2023-08-23 13:17:36 -07:00
Justin Newberry 3d91d78018
Revert "Subaru: infrastructure to support the new angle based control… (#1601)
Revert "Subaru: infrastructure to support the new angle based controllers (#1590)"

This reverts commit ea16a54166.
2023-08-22 17:30:11 -07:00
Justin Newberry ea16a54166
Subaru: infrastructure to support the new angle based controllers (#1590) 2023-08-22 00:21:19 -07:00
Adeeb Shihadeh 57ec466a91
prefix openpilot imports (#1593) 2023-08-20 17:50:31 -07:00
Adeeb Shihadeh aed103d537 Revert "Subaru: gen2 long safety (#1587)"
This reverts commit 2ae2567d8d.
2023-08-17 15:58:45 -07:00
Justin Newberry 95c89b8045
GM: switch to common gas/brake test (#1578)
* gm switch to common gas/brake test

* fix typo

* add comment about regen
2023-08-17 01:55:11 -07:00
Justin Newberry 2ae2567d8d
Subaru: gen2 long safety (#1587)
* setup proper safety for gen2 long

* whitespace

* misra

* alt bus

* high beam assist

* better names

* whitespace

* whitespace

* whitespace
2023-08-17 01:32:34 -07:00
Shane Smiskol 1f475a8aff
Hyundai: match openpilot standstill check (#1586)
* checks that we can replicate in openpilot

* clean up

* fix test

* can simplify this

* can also simplify this
2023-08-16 23:51:07 -07:00
Igor Biletksyy cfff3386c5 fix linter 2023-08-16 16:14:21 -07:00
Igor Biletksyy 16b3ec4ca3 add FW size checker script 2023-08-16 15:49:08 -07:00
Justin Newberry 02bcd14376
Subaru: cleanup to prepare for angle controller (#1585)
cleanup prepare for angle
2023-08-16 12:40:29 -07:00
Justin Newberry 8bd3e93813
Subaru: Global gen1 longitudinal safety (#1500)
* Add subaru long TX and RX messages

* misra c2012 fix

* fix tests

* Reorder signals

* increase max steering torque

* merge fix

* merge fix, remove cnt from test

* Move subaru logitudinal behind flag, add safety test

* update subaru_longitudinal checks

* cleanup

* Add subaru longitudinal checks

* misra fix

* Add subaru rpm and throttle rate limit checks

* temporary disable cruise throttle and cruise rpm checks

* update subaru long test

* update longitudinal safety and add tests

* fix tests

* fix misra

* subaru long signals limits checks

* Add controls_allowed to long tests

* remove unused variables

* Add AEB passthru and tests

* Add bus

* Update AEB logic

* Add GEN2 AEB support

* syntax fix

* Update AEB tests

* Add comment for subaru_aeb

* Do not check cruise_throttle and cruise_rpm limits when gas pressed

* use long limits struct

* Subaru: longitudinal checks only when controls_allowed, use ES_LKAS_State LKAS_Alert for AEB

* fix misra, set controls_allowed for es_brake test

* fix misra

* Fix es_brake violation check

* Add 0x323 to longitudinal test

* Remove stock fcw from aeb signals

* Use GET_BYTES

* Revert "export FW_PATH"

This reverts commit 2a5058d858.

* Revert "cleanup fw filename conventions (#1434)"

This reverts commit 4dd2735e38.

* Revert "Revert "export FW_PATH""

This reverts commit 86e8d321d0.

* Revert "Revert "cleanup fw filename conventions (#1434)""

This reverts commit 5aae6716fa.

* cleaned up safety

* cleanup subaru long safety

* subaru_aeb -> stock_aeb for other platforms

* fix unittests

* pretty

* need to upload this route

* remove AEB stuff for now

* remove unrequired rpm checks

* add comment

* added comment about acceleration and use throttle limit for rpm too

* inactive_throttle_fix

* Update board/safety/safety_subaru.h

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

* added comments about long limits

* increase max brake

* revert that

* cleanup

* rename throttle to gas

* add safety replay

* remove todo

* rename throttle to gas

* move subaru stuff out of common test

* PR cleanup

* added min gas

* reduce initial complexity by not intercepting cruisecontrol or brake_status

* create common gas brake safety test

* remove unrelated subaru reference

* also test below min_value

* fix fwd hook test

* better name and hardcoded

* use same as acceleration limits

* revert gm

* remove callable

* also limit rpm

* remove safety replay for now

* revert unrelated changes

* pr cleanup

* remove unused gasbrake safety test

* fix ruff linter

* PR cleanup

* pr cleanup?

* added common brake test and moved generic test to base safety class

* remove duplicate test

* wip

* wip

* rename longitudinalaccelsafety

* revert limits correct test

* fix controls allowed test

* move gm over to long gas brake test

* assert that limits are reasonable

* fix typing

* fix linter again

* fix linter again

* fix linter again

* like to make it clear

* typo

* fix from merge

* clearer names

* dont need thesemore

* subaru: use common test

* fix merge issue

* inactive gas from long limits

* fix tests

* linter

* fix gen2

* fix linter

* also test torque when doing long control

* renamre transmision rpm

* consistent whitespace

* rename declarations too

* rename transmission rpm

* same line

* actually is transmission rpm

---------

Co-authored-by: Martin Lillepuu <martin@mlp.ee>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-15 18:51:13 -07:00
Adeeb Shihadeh d7f75ca722
safety tests: test one of each MCU type 2023-08-14 21:08:46 -07:00
Justin Newberry 10a2727882
Subaru: prepare tests for long and angle control (#1580)
* prepare tests for long and angle control

* fix names
2023-08-14 19:26:00 -07:00
Justin Newberry 4ea50fbb09
Ruff: propgate config from OP (#1579) 2023-08-14 12:52:02 -07:00
Justin Newberry a0344a11e7
Subaru: cancel safety (#1576)
* subaru cancel safety

* misra
2023-08-12 17:16:28 -07:00
Justin Newberry 7dbdf6ba2b
Safety Tests: Create common gas brake safety test (#1537)
* create common gas brake safety test

* remove unrelated subaru reference

* also test below min_value

* better name and hardcoded

* use same as acceleration limits

* revert gm

* remove callable

* added common brake test and moved generic test to base safety class

* remove duplicate test

* wip

* wip

* rename longitudinalaccelsafety

* revert limits correct test

* fix controls allowed test

* move gm over to long gas brake test

* assert that limits are reasonable

* fix typing

* fix linter again

* fix linter again

* fix linter again

* like to make it clear

* typo

* fix from merge

* clearer names

* dont need thesemore

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-08-12 14:03:40 -07:00
Justin Newberry f29c753ba4
Safety: generic limit safety check (#1575)
* generic limit safety check

* fix messagefunction
2023-08-12 13:51:26 -07:00
Shane Smiskol 20b1e505c3
GM: move more longitudinal related function into class (#1574)
move these into the long test
2023-08-10 23:59:58 -07:00
Shane Smiskol 61590b681a
GM: clean up longitudinal safety test (#1573)
* clean up gm long safety test

* move to long base

* common brake
2023-08-10 23:49:28 -07:00
Igor Biletskyy 25f1444d73
panda: add CAN-FD throughput test (#1572)
init
2023-08-10 18:41:50 -07:00
Adeeb Shihadeh 61e987f6e2
remove safety replay test (#1569) 2023-08-07 18:38:01 -07:00
Igor Biletskyy a651fe3c6b
set OBD to False after test (#1568)
* reset OBD after test

* add comment
2023-08-07 10:54:39 -07:00
Justin Newberry 5801582baf
Subaru: convert measured angle to centigrees (#1567)
convert to centigrees
2023-08-07 09:29:34 -07:00
Adeeb Shihadeh 235067a22b
run HITL tests in parallel (#1566)
* seems to work

* cleanup

* run in ci

* fail on first

* fix jungle scope

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-08-06 20:51:26 -07:00
Adeeb Shihadeh 77b09a3160
misc hitl test cleanup (#1562)
* misc hitl test cleanup

* adjust that

* update

* tres fix

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
Co-authored-by: Comma Device <device@comma.ai>
2023-08-06 16:30:21 -07:00
Adeeb Shihadeh 3dc3b58e20
ruff: enable bugbear checks (#1565) 2023-08-06 14:59:22 -07:00
Adeeb Shihadeh fc506e7b39
switch to ruff linter (#1564)
* switch to ruff linter

* cleanup
2023-08-06 14:29:28 -07:00
Adeeb Shihadeh 33a95d6bea
pedal: fix warning on invalid serial (#1563)
* pedal: fix warning on invalid serial

* fix

* fix:

* shouldn't need that

* fix

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-08-06 13:47:37 -07:00
Adeeb Shihadeh c66b98b2a6
finish esp/gps removal (#1559) 2023-08-06 12:29:54 -07:00
Adeeb Shihadeh b976cf426a libpanda: silence build warning 2023-08-04 22:16:49 -07:00
Adeeb Shihadeh 6e1d35b033
more complete jungle reflash (#1557)
* more complete jungle reflash

* no spi!

* mv flash

* mv that
2023-08-04 21:51:09 -07:00
Adeeb Shihadeh 0f479a30a3
CI: reflash jungle (#1546) 2023-08-04 18:11:29 -07:00
Justin Newberry 7b6806c270
Safety: Add desired angle to safety helpers (#1554)
add desired angle
2023-08-04 17:30:10 -07:00
Justin Newberry 2a72404ccb
Subaru: Add measured steering angle and vehicle speed (#1528)
* correct vehicle speed and add measured angle

* misra

* misra

* common test for angle

* PR cleanup

* use subaru prefix

* clean it up a bit

* minimize whitespace diff

* need float for deg_to_can
2023-08-04 17:16:35 -07:00
Adeeb Shihadeh 1950ba6f83 cleanup bus count constant 2023-08-04 10:47:03 -07:00
Adeeb Shihadeh 977d702770
cleanup old pedal stuff (#1552) 2023-08-04 10:40:53 -07:00
Adeeb Shihadeh d7120be904
panda jungle (#1547)
* mv jungle

* match pedal style

* fix linter

* fix fw path

* fix paths

* safety!
2023-08-03 23:55:13 -07:00
Adeeb Shihadeh e7894e6770
Move CanHandle to python/ (#1550) 2023-08-03 23:10:16 -07:00
Adeeb Shihadeh f37f8d90ba
cleanup build, prep for jungle (#1549)
* cleanup build, prep for jungle

* cleanup

* update pedal obj path
2023-08-03 19:07:41 -07:00
Adeeb Shihadeh 1eac0d7634
HITL: remove old check, it's always checked on panda connect now 2023-07-20 11:25:06 -07:00
Adeeb Shihadeh b2741013f6
instructions for flashing internal panda (#1521)
* instructions for flashing internal panda

* Update board/README.md
2023-07-17 20:17:18 -07:00
Adeeb Shihadeh 5d873444b2
SPI: connect by VERSION command (#1495)
* SPI: connect by VERSION command

* shorter timeout

* add exception

* simple test

* fallback

* bootstub check

* update comments

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-07-16 19:33:18 -07:00
Cameron Clough 0c33554624
Ford CAN FD safety (#1455) 2023-07-16 15:09:37 +01:00
Shane Smiskol 8e31711aa2
safety helpers: cruise engaged prev setter (#1511)
* bbb

* Apply suggestions from code review
2023-07-14 18:21:28 -07:00
Justin Newberry c8acdc6f61
Subaru: cleanup tests (#1508)
* macro

* base tests

* leave it same as ford

* call base setupclass

* Update common.py

* Update test_hyundai_canfd.py

* merge
2023-07-14 12:43:49 -07:00
Adeeb Shihadeh 6b9b448259
log device boot time (#1503)
* log device boot time

* misra

* only log real boots

* set gpio

* true

* initial

* log bootkick

* fix RPv2

---------

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Igor Biletksyy <bs@privacy.im>
2023-07-12 20:34:46 -07:00
Adeeb Shihadeh 14fd5ff5a3
SPI: send bootstub status in version request (#1492)
* mv first

* switch to crc8

* bootstub

* test

* cleanup

* little more

* misra

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-07-03 15:23:12 -07:00
Adeeb Shihadeh d693e89df2
SPI: send hw type with version (#1490)
Co-authored-by: Comma Device <device@comma.ai>
2023-07-02 23:50:30 -07:00
Adeeb Shihadeh abcbfb44b4
SPI: send serial with protocol version (#1489)
* SPI: send serial with protocol version

* misra

* fix test

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-07-02 23:13:57 -07:00
Adeeb Shihadeh 5abb2b58da
SPI: add protcol version request (#1488)
* SPI: add protcol version request

* quick test

* fix linter

* misra

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-07-02 15:51:35 -07:00
Adeeb Shihadeh 21843092ff
bump to python 3.11.4 (#1481)
* bump to python 3.11.4

* Update .pre-commit-config.yaml

* lint

* import

* no | yet

* rm ignores

* Update tests/libpanda/libpanda_py.py

---------

Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
2023-07-01 17:43:34 -07:00
Igor Biletksyy 04f0c4261c Revert "HITL tests: reset jungle on init (#1473)"
This reverts commit 1c574f8a99.
2023-06-28 12:34:18 -07:00
Igor Biletksyy 6309bb8a6a Normal to have REC and TEC counters > 0, but less than threshould 2023-06-26 14:16:34 -07:00
Adeeb Shihadeh 1c574f8a99
HITL tests: reset jungle on init (#1473)
Co-authored-by: Comma Device <device@comma.ai>
2023-06-20 19:34:05 -07:00
Adeeb Shihadeh 6eb3a7324f
tres: enable fan overshoot test (#1465)
* tres: enable fan overshoot test

* rm
2023-06-16 21:56:11 -07:00
Cameron Clough 55ef91d9ab
Ford: don't check vehicle roll quality flag (#1461) 2023-06-17 01:11:21 +01:00
Adeeb Shihadeh c6283759e6
increase fan test timeout, can take a while to recover 2023-06-16 14:06:32 -07:00
Adeeb Shihadeh fc994f5cf9
HITL: check FW version before every test (#1463) 2023-06-16 13:59:07 -07:00
Robbe Derks 0cc91a7f7b
Logging (#1445)
* try 1

* some fixes

* fix some misra

* first poc working

* more things

* more misra fixes

* fix misra

* add rate limiting

* fix misra

* add some unit tests through libpanda

* add more tests and fix some stuff

* fix misra again

* add startup log hitl test

* list

* don't fail on wrong timestamps

* improvements

* fix tests

* expected logs test?

* not sure why this passed

* oh, it doesn't reset

* only show last few

* guess at expected logs

* needs this

* ugh

* reduce compiler warnings

* adjust expected logs

* this is correct

* is it really 1?

* min max

* reduce spam in SPI test

* some cleanup
2023-06-13 17:00:56 +02:00
Adeeb Shihadeh adc0c12f7b HITL tests: enable flashing tests on tres 2023-06-11 19:56:09 -07:00
Adeeb Shihadeh a4ed5bb943
adjust timeouts (#1444) 2023-06-04 21:17:44 -07:00
vanillagorillaa aa03163a92
Nissan: use generated DBCs (#1438)
* update nissan dbcs

* update opendbc ref

* Update Dockerfile

* Update Dockerfile

* fix

* try again

* need that too

* cp

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-06-04 16:06:46 -07:00
Adeeb Shihadeh 92ed48ae5c
HITL tests: add timeouts (#1352)
* set timeout

* closest

* more timeout

* fan test is slow

* retry

* break

* bump
2023-06-04 01:00:17 -07:00
Adeeb Shihadeh e1e9bd048d benchmarking script 2023-06-03 15:22:47 -07:00
Robbe Derks 5847d7dbc0
Tesla safety: fix wrong message rate (#1277)
* half the freq, double the rate

* fix test

* fix names
2023-06-01 23:10:36 +02:00
Adeeb Shihadeh 4d7abcc2e6
PandaDFU: don't reset in program_bootstub (#1433) 2023-05-21 20:05:21 -07:00
Adeeb Shihadeh 52f96bac68
spi: nack on can tx endpoint if buffer is full (#1426)
* spi: nack on can tx endpoint if buffer is full

* handle in python lib

* fix timeout

* fix timeout

* fix linter

* cleanup

* fix

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-05-19 22:43:34 -07:00
Shane Smiskol 2a53833753
Ford safety: prevent disable AEB (#1428)
* Ford AEB safety

* whoops

* working tests

* debugging

* clean up

* stock aeb test

* split up test

* rm

* cmt

* rm

* just test stateless sigs for simple branch

* clean up

* rm

* just test this bit

* it's signed now

* cmt

* cmt

* clean up

* ohh
2023-05-18 14:14:26 -07:00
Shane Smiskol 831a296e39
Ford: test inactive gas (#1429)
test inactive gas
2023-05-18 13:43:04 -07:00
Shane Smiskol 803211a35a tests: remove temporary comment 2023-05-18 00:23:02 -07:00
Shane Smiskol 14bd994f83
Ford: add longitudinal safety (#1359)
* add ACCDATA msg

* ford long safety

* long flag

* split stock and op long tests

* use accel limits for brake

* add comment

* fix acceleration limits

fix acceleration limits

* fix gas limits

* temp bug

* fix min gas, allow -0.5 (engine braking?)

* fix test

* fix tests

* yay it caught this

* pylint

* base name

* typing

* Revert "typing"

This reverts commit 7fb5e304cb.

* temp fix

* rm line

* this is handled by PandaSafetyTest

* revert

* move

---------

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
2023-05-18 00:21:29 -07:00
Adeeb Shihadeh be2ca72f81 Revert "CI: automatically update on-device dependencies (#1420)"
This reverts commit 463795d497.
2023-05-17 18:03:45 -07:00
Adeeb Shihadeh 463795d497
CI: automatically update on-device dependencies (#1420)
* CI: automatically update on-device dependencies

* unset that

* bump
2023-05-17 17:21:26 -07:00
Adeeb Shihadeh a93bc954c5
SPI HITL tests + cleanup (#1417)
* start comms hitl tests

* pull that out

* revert that

* more test

* fix warnings

* fix linter

* another simple case

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-05-17 17:13:12 -07:00
Shane Smiskol 3c9d277276
safety: always allow inactive gas command (#1418)
* always allow inactive gas

* rewrite this

* revert

* no functional change but test it correctly

* also here
2023-05-17 15:52:50 -07:00
Justin Newberry 0a738b7ee8
Subaru: rename legacy to preglobal (#1415)
* rename

* missing some variables

* fix find/replace error
2023-05-15 17:22:40 -07:00
Kacper Rączy 822a7367c1
macOS: use homebrew gcc using version suffix. update setup instructions (#1409)
* Add version suffix to gcc on Darwin

* Update macos setup intructions

* Delete unused SConscript at tests/

* Move gcc stuff to tests/libpanda/SConscript
2023-05-12 11:06:08 -07:00
Adeeb Shihadeh 3d4b7b1afc remove unused sconscript 2023-05-11 13:02:20 -07:00
Robbe Derks 2c937656cf
Continuous harness detection (#1402)
* read in mV and make threshold board-dependent

* refactor and add SBU voltages to health

* refactor relay driving

* more refactoring and readout lock

* avoid race condition

* fix misra

* continuous detection

* 1Hz is fine

* another race condition

* use harness detection to trigger bootkick

* update orientation detection test

* more in-depth harness tests

* fix ignition

* fix

* raise threshold
2023-05-08 13:30:23 +02:00
Shane Smiskol 94cd9a0788
Ford: curvature rate limits (#1258)
* ford curvature rate limits draft

* make common angle tests work with curvature

* comment

* no need for this

* extra line

* fix test

* generic curvature test class

* more reasonable limits

* adjust limits

* draft

* works

* works

* clean up

* add vehicle speed

* works

* clean up

* clean up

* more clean up

* more clean up

* lower

* double

* add updated bp

* remove

* can clean that up

* draft

* this works!

* think that's the correct placement

* try this

* closer

* use min

* add/sub one to not falsely trip

* remove old angle error safety

* i'm not sure if clamp is more readable

* fix that

* fix

* stash

* fix these tests

* ternary

* floats are a pain

* draft, works kinda

* even better

* round that

* need tolerance

* this should work (adding tol=1 wouldn't let us have multiple rate limits)

* test works

* clamp breaks if low is higher than high :(((

down from 150 blocked msgs to 7!

* no blocked msgs!!!

* test a whole bunch

* stash

* stash

* clean up test

* clean up test to be more like torque (+ speeds)

* clean up

* cmt

* test up

* up and down are good

* rename and remove

* this is tested

* uncomment

* this is tested by ensuring we move towards error at a minimum rate

* not used any more

* revert common

* clean up test_ford a bit more

* some clean up (combine variables where it makes sense)

* yeah can't use clamp since min isn't always < max, min(max(.. handles this

* clean up

* revert that

* comments

* cmt

* another

* that's old

* misra!

* Update board/safety/safety_ford.h

* Update board/safety/safety_ford.h

* add todo, fix test case

* more clear, matches panda

* add comment

* Update tests/safety/test_ford.py

* more fine speed increments

* rm comment

* better names

* this is expected behavior (tested by common checks)

* CURVATURE_ERROR_LIMIT_SPEED

* better name?

* pretty clean!

* same for up

* only used in one place now

* these are now clear

* common term

* make vehicle_speed a sample_t

* need to use values[0]

* speed is a float

* Revert "speed is a float"

This reverts commit 01af02f1d3.

* Revert "need to use values[0]"

This reverts commit 8f6d68345a.

* Revert "make vehicle_speed a sample_t"

This reverts commit ecd8dc86b6.

* safety fixes for new speed sample

* test fixes for new speed sample

* fix misra and make intermediate variable

* this isn't needed
2023-05-04 04:59:35 +00:00
Shane Smiskol b44df8151a
safety tests: use rx/tx helpers (#1399)
use rx/tx helpers
2023-05-04 04:09:09 +00:00
Shane Smiskol 3a64b6ccb5
safety: make vehicle_speed a sample (#1391)
* convert vehicle_speed into sample_t, change no behavior

* draft

* round

* test

* clean up

* round

* round all

* use min

* remove round macro from this PR

* reset speed measurement

* debug

* bbd

* rm

* revert

* test above and below

* need this now

* misra pt 1

* misra pt 2

* misra pt 3

* i don't understand this one, not different from other cases

* fix test

* test

* revert that

* draft

* test the sample_t works properly for safety modes that use it (angle only)

* can combine these tests

* test decimals

* global

* misra

comment

* suggestions

* fix

* use new helper
2023-05-04 03:37:56 +00:00
Shane Smiskol 5a9603600e
safety tests: reset safety helper (#1398)
* reset safety

* use it

* clean it up

* two lines

* fix python linting
2023-05-04 02:51:08 +00:00
Shane Smiskol 776bb69945
Ford: test angle measurement (#1396)
* test angle meas readback (ensures speed and yaw rate are used properly)

* revert

* rm

* tuple

* temp

* clean up

* stash

* Revert "stash"

This reverts commit cab96b3e2b.

* use global

* test negative

* name
2023-05-03 21:37:04 +00:00
Shane Smiskol 4b04275514
Ford: test angle error speed in steering signal test (#1395)
* test above and below limit speed

* need this now
2023-05-03 21:19:52 +00:00
Shane Smiskol 810df6b5c1
safety replay: safety tick (#1364)
* make explicit, there was no bug only because the if statement is identical to above

* debug

* Revert "debug"

This reverts commit 2ec83677c3.

* Revert "make explicit, there was no bug only because the if statement is identical to above"

This reverts commit fcb2a106b9.

* fixes

* remove

* allow 1 second

* remove

* clean up

* call every can msg

* safety_tick_rx_invalid like test_models

* order

* skip end

* try that
2023-05-03 05:01:44 +00:00
Shane Smiskol 3a3e117d01
Ford: remove unused function (#1393)
we can just round this now
2023-05-03 04:35:00 +00:00
Shane Smiskol aa30b15de5
Ford safety: more clear variable names (#1392)
* that's a better name

* that too
2023-05-03 03:45:33 +00:00
Shane Smiskol 22b2453728
angle safety: consistent rate limit variable names (#1390)
consistent names
2023-05-03 00:34:24 +00:00
Shane Smiskol 14cfb78ab2
Subaru: add gen 2 Outback route (#1386)
gen2 outback route
2023-05-02 13:45:21 -07:00
Shane Smiskol 1d1284e863 Revert "Subaru: add gen 2 Outback route (#1385)"
This reverts commit c43f33191c.
2023-05-02 13:18:26 -07:00
Shane Smiskol c43f33191c
Subaru: add gen 2 Outback route (#1385)
gen2 outback route
2023-05-02 13:07:50 -07:00
Shane Smiskol 2fb25c4a0b
Subaru: fix Impreza replay route (#1384)
* fix

* impreza route
2023-05-02 01:21:33 -07:00
Shane Smiskol f9485c8d5d
Ford: more clear steering safety check (#1383)
one line
2023-05-01 20:01:03 -07:00
Shane Smiskol dbe941004a
safety: reset torque_meas on init properly (#1250)
* reset min torque meas too

* add test that fails

* cmt

* cmt

* clean up test

* don't be random

* above test tests this pretty much

* test angle too

* fix

* also test driver torque

* whoops

* whoops
2023-04-28 17:45:02 -07:00
Shane Smiskol 63db708491
driver torque limit: make driver torque message abstract (#1377)
* abs

* uncomment

* fixy
2023-04-28 17:36:35 -07:00
Shane Smiskol 99809f7071 angle safety tests: more clear helper function name
here too
2023-04-28 15:02:57 -07:00
Shane Smiskol aac46a2ef2
angle safety: enforce disabled angle when not steering (#1372)
* enforce disabled angle when bit not set, below we enforce bit to be 0 when not controls allowed

* test

* other test

* combine tests

* comment
2023-04-27 21:41:38 -07:00
Shane Smiskol 240370cdd1
ford: allow 0 curvature when controls are allowed if not steering (#1370)
* test that we can send curvature=0 if enabled=False while control_allowed=True (let's say EPS faults, OP doesn't want to actuate)

* draft

* only check error if apply bit is 1

* subtest

* no subtest

* fix safety and tests

* tests say this works

* clean up

* subtests are sloww

* Revert "subtests are sloww"

This reverts commit 560c6745c8.

* fix test from merge

* add comment

* add comment

* add another comment

* spacing
2023-04-27 17:44:32 -07:00
Shane Smiskol 07680692d9
Ford: add subtests (#1371)
* subtest here

* and here

* bit faster
2023-04-27 17:27:18 -07:00
Shane Smiskol c9c3cb38f6
Ford safety: curvature error limit (#1353)
* set ford vehicle speed

* parse yaw rate signals

* misra

* misra

* misra

* misra

* draft

* update module

* already checked

* and set it properly

* some stuff

* draft

* clean up (will fail tests because we don't send yaw rate yet)

* could do something like this

* this is better and less prone to bugs

* match simple op limiting, debugging

* set checksum for messages in tests

* clean up

* fix that

* one m/s fudge

* fix sign of yaw rate

* interpolate detects size

* forgot OP flips the curvature sign. it matches yaw on can

* all my debugging crap

* make replay work for ford

* fix panda blocking messages (array is fixed size so size-1 is 0 rate at high speed)

* uncomment safety test limits

* revert

* round for zero blocked msgs

* fix limits

* meas safety checks that down rate is >=, not <

* test pass

* lots of comments and draft what one meas torque check would look like

* fix that

* add curvature meas

* add debugging stuff

* Revert "add debugging stuff"

This reverts commit 449783fc62.

* messy but at least one test passes now

* draft

* add max_steer

* some safety clean up

* and that

* start with a test that works

* another test that works (sort of, we need more strict panda safety without false positives)

* no max curvature check (not safety related), allow any rate limits

* add new function

* also need to consider max val here, since OP will send up to that

* and now use the function

* lower to 10

* compilation fixes

* clean up (no rate limiting)

* remove that too

* curvature diff test

* more clean up

* debug

* ?

* better names

* more official

* use _curvature_meas_msg_array here

* bit faster

* no i don't

* revert that

* why not just use angle_meas?

* bb ll

* bb deb

* clean up debug vals

* more

* revert replay drive debugging changes

* Update board/safety.h

* rm line

* only need to round the final thing

* not needed, under 10 ms

* make a class variable

* fix a misra?

* another misra?

better

* ?

* 12.1

* need to explicitly convert

* add one to not false trigger the violation (float rounding)

* not really needed

* rm line

* cmt

* use clamp

* rename

* in struct

* comment

* use max_limit_check

* draft clean up

* Revert "draft clean up"

This reverts commit d1a0e8acd1.

* make a global

make a global

* this is fine
2023-04-27 00:40:29 -07:00
Adeeb Shihadeh 7aef934d4c
Fix undefined behavior in GET_BYTES macro (#1367) 2023-04-26 22:59:58 -07:00
Shane Smiskol f444f1554f
Ford: check second speed for mismatches (#1358)
* Add second speed

* 2.5 m/s is 9 kph, 4 kph is the max in the field

* add quality signal

* qf signal name

* comment

* checksum matches except it goes to zero when turning the car off despite counter still active

* update comments

* now test it

* spacing

* Update board/safety/safety_ford.h

* zzzz

* not needed

* whoops

* test vehicle state mismatch

* add to safety_helpers

* probably misra

* we might want to check it in both speed signals in case one doesn't exist on a car

* Revert "we might want to check it in both speed signals in case one doesn't exist on a car"

This reverts commit 3338931409.

* fix formatting

* 2 m/s (7 kph)

* set controls_allowed directly like other safety models

remove vehicle_state_mismatch

* obv
2023-04-26 22:37:36 -07:00
Shane Smiskol 5c21b14049
Ford: check 2nd speed message (#1365)
* Add second speed

* 2.5 m/s is 9 kph, 4 kph is the max in the field

* add quality signal

* qf signal name

* comment

* checksum matches except it goes to zero when turning the car off despite counter still active

* update comments

* now test it

* spacing

* Update board/safety/safety_ford.h

* zzzz

* not needed

* whoops

* test vehicle state mismatch

* add to safety_helpers

* probably misra

* we might want to check it in both speed signals in case one doesn't exist on a car

* Revert "we might want to check it in both speed signals in case one doesn't exist on a car"

This reverts commit 3338931409.

* fix formatting

* 2 m/s (7 kph)

* revert mismatch stuff
2023-04-26 21:49:39 -07:00
Shane Smiskol 23b5130de9
replay drive: fixes (#1362)
* make explicit, there was no bug only because the if statement is identical to above

* debug

* Revert "debug"

This reverts commit 2ec83677c3.

* Revert "make explicit, there was no bug only because the if statement is identical to above"

This reverts commit fcb2a106b9.

* fixes

* clean that up

* and this
2023-04-26 17:45:04 -07:00
Adeeb Shihadeh 08ed853bf9
log total stall count in fan tuning script 2023-04-21 13:47:13 -07:00
Adeeb Shihadeh 272b81e97b
fan: fix stall detection (#1351)
* cleanup and fix

* dos must stall

* clean those up

* fix misra

* more test

* fix import

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-20 15:44:12 -07:00
Adeeb Shihadeh 0e2eb9c0f5
fan debugging script (#1354)
* fan debugging script

* merge those

* disable

* better print

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-20 13:00:40 -07:00
Adeeb Shihadeh cf307348af
CI: run HITL tests on tres (#1326)
* run on tres

* disable those for now

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-18 22:17:11 -07:00
Adeeb Shihadeh 0b03ef5468
HITL tests: skip internal tests on uno (#1350)
Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-04-18 16:15:27 -07:00
Robbe Derks d3904a9f75
HITL fan test (#1330)
* hitl fan test

* enable cooldown on dos as well

* small cleanup

* get expected RPM from panda class

* fix

* overshoot test

* fix max RPM getting

* fix percentage

* revert cooldown fix

---------

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-04-18 14:47:22 -07:00
Robbe Derks 237ffedcb3
Dos fan fix (#1335)
* hitl fan test

* enable cooldown on dos as well

* small cleanup

* get expected RPM from panda class

* fix

* overshoot test

* fix max RPM getting

* fix percentage

* revert cooldown fix

* add cooldown for dos fan as well

* remove feedforward from the fan controller to eliminate overshoot

* update clip

* cleanup

* add that back

---------

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-04-18 14:15:06 -07:00
Justin Newberry 1f8b03666d
Subaru: add ability to send infotainment status message (#1333)
* added infotainment status to panda

* dont fwd infotainment status

* revert placeholder and add test case

* Fix test case

* gen2 only

* fix test case

* Revert "fix test case"

This reverts commit 8cc7579620.

* Revert "gen2 only"

This reverts commit 6a511a9976.

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-04-17 18:47:51 -07:00
Adeeb Shihadeh 9cd01ac263
PandaDFU: retry SPI comms (#1348)
* retry

* set exc

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-16 14:43:58 -07:00
Jason Young 6ec078db5a
VW MQB: Cleanup HCA control message (#1310)
* VW MQB: Cleanup HCA control message

* update opendbc ref

* revert this before merging

* MISRA

* revert Dockerfile to comma master

* reverted a little too much
2023-04-15 11:34:42 -07:00
Shane Smiskol ada8b49cb5
Honda Bosch Radarless: allow alt brake (#1341)
* radarless can use this

* fix addr check

* update opendbc ref
2023-04-14 01:51:19 -07:00
Jason Young fddca54fd6
VW: Allow inactive accel values at all times (#1247)
* allow inactive accel values at all times

* cleaner

* unnecessary, done by default

* better comments

* move test to common class

* fix

* flip

* comment

* append 0 and INACTIVE_ACCEL to test accels + check acc_07 sends if inactive only

* cleanup

* fix that

* copy testing convention of VW and Honda

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-04-13 17:28:33 -07:00
Adeeb Shihadeh 22b8e5df7f add extra fault assert in HITL tests for context 2023-04-12 16:28:45 -07:00
Igor Biletskyy 0832d65347
Fix CAN message corruption on H7 under high load (#1342)
* fix RX FIFO corruption

* Add checksum to CANFD test data

* cleaner and MISRA

* nah

* oops

* fix test
2023-04-12 11:07:58 -07:00
Adeeb Shihadeh 85cc70d4aa
safety: only pass addr to fwd hook (#1339) 2023-04-08 16:45:59 -07:00
Adeeb Shihadeh 2a567674dc
Tesla: move reading AEB state to RX hook (#1340) 2023-04-08 16:20:38 -07:00
Adeeb Shihadeh 6f852b44a9
SPI: log checksum errors in health (#1334)
* SPI: log checksum errors in health

* actually send it

* check in hitl teardown

* check that

* fix misra
2023-04-05 22:05:14 -07:00
Adeeb Shihadeh eef3d026e3
CI: run HITL tests on dos (#1304)
* run on dos

* skip voltage on dos

* run these

* revert that

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-04-03 20:21:10 -07:00
Adeeb Shihadeh b6c378ad02
CI: set PYTHONWARNINGS=error (#1323)
* CI: set PYTHONWARNINGS=error

* update resetter

* fix build warnings

* bump jungle

* fix one more

* fix linter

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-04-02 09:33:35 -07:00
Adeeb Shihadeh 6a8ed7f147
CI: setup dos (#1321)
* CI: setup dos

* just build and flash for now

* fix new device setup
2023-04-01 18:52:32 -07:00
Vivek Aithal a1e1451d1c
GM: Reduce steer down limit and increase driver allowance (#1281)
reduce steer down limit and increase driver allowance
2023-03-29 10:39:25 -07:00
Shane Smiskol 7392f24868
Honda tests: check endswith Base to skip test (#1305)
check endswith base
2023-03-28 00:05:35 -07:00
royjr db6c50cd09
Honda Bosch Radarless longitudinal safety (#1008)
* civic22_long

use long flag

* maybe?

* Update safety_honda.h

* revert the 0x1c8 addition

* init radarless safety check

* correct accel parsing

* add test class (WIP)

* remove current_controls_allowed

* Fix ACC_HUD

* patch

* Add missing safety to test name

* Pass irrelevant test

* move comment

* remove unused comments

* add comment to TestHondaBoschRadarlessSafety

* Fix message overlap

The "exceptions for common msgs across different hondas" fix does not seem to be working. Created another exception for TestHondaBoschRadarless based on the HondaNidec exception above

* Fix base

* remove comment

* remove buttons from LONG TX

* make a base Radarless test class

* can't remove them, since safety doesn't check bosch

* test accel limits

* test accel limits

* we can do the clean up in another pr

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: sshane <shane@smiskol.com>
2023-03-27 23:10:25 -07:00
AlexandreSato 6cb3561f16
safety replay: update Honda steer value getter (#1292)
* safety replay: update Honda steer value getter 

I think now it´s right!

```
BO_ 228 STEERING_CONTROL: 5 EON
  SG_ STEER_TORQUE : 7|16@0- (1,0) [-4096|4096] "" EPS
```

* ops
2023-03-25 19:02:34 -07:00
Shane Smiskol f29125f6ad
DriverTorqueSteeringSafetyTest: remove useless function (#1275)
Update common.py
2023-03-22 21:57:18 -07:00
Adeeb Shihadeh 7aaca348c2
HITL tests: nose -> pytest (#1301)
* HITL tests: nose -> pytest

* run all

* add back partial tests

* big speed up

* fix skipping

* enable all

* that's expected

* clean up after ourselves

* jungle is fixture

* fix

---------

Co-authored-by: Bruce Wayne <batman@comma.ai>
2023-03-22 21:38:37 -07:00
Shane Smiskol ba50c2ffee
safety tests: fix for common longitudinal accel class (#1299)
* fix

* fix

* something that would catch this
2023-03-21 12:42:02 -07:00
Shane Smiskol 2136e2e45b
safety tests: add common longitudinal accel class (#1298)
* add longitudinal safety test class

* rename to accel_cmd_msg

* line

* do hyundai

* set default min and max accel

* revert

* thanks pylint
2023-03-21 12:24:33 -07:00
Adeeb Shihadeh f658ecdd75 ci: speedup safety tests 2023-03-18 20:35:59 -07:00
Shane Smiskol e4cc97d882
Toyota: check SETME_X64 signal for LTA (#1296)
* check SETME_X64

* use itertools.product for better coverage

* fine
2023-03-16 22:56:25 -07:00
Shane Smiskol c83d6894ef
Toyota: base LTA safety (#1295)
* part 1 of clean up

* make it work and pass

* remove lta stuff

* remove commented lta tests

* more

* move test back to where it was

* rm line

* rename that

* fix that

* start to add LTA

* angle test

* fix tests and add base stock longitudinal class

* formatting

* clean that up

* convention

* add ALLOW_DEBUG
2023-03-16 22:32:56 -07:00
Shane Smiskol 7fdc66b957
Toyota: more modular safety tests (#1294)
* part 1 of clean up

* make it work and pass

* remove lta stuff

* remove commented lta tests

* more

* move test back to where it was

* rm line

* rename that

* fix that

* we always want to enforce LTA disallowed actually

* not sure if these are helpful

* endswith("Base")
2023-03-16 21:58:38 -07:00
AlexandreSato 6585cae978
safety replay: update steer value getter (#1273)
* toyota torque on toyota for safety replay

* Honda torque on Honda for safety replay

* Chrysler torque on Chrysler for safety replay

* Subaru torque on Subaru for safety replay

* fix

* Honda is Big Endian!

* Update helpers.py

* we already do this every where

* Update tests/safety_replay/helpers.py

* Update tests/safety_replay/helpers.py

* Update tests/safety_replay/helpers.py

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-03-15 21:19:05 -07:00
Igor Biletskyy 75792fb255
Fix different ADC scales (#1288)
* different ADC scales

* add HITL

* we had it, remove
2023-03-14 14:49:39 -07:00
Vincent Wright 0afee2e0ff
Raise max steer limits for Ram DT (#1284)
* Raise max steer limits for Ram DT

* Update test_chrysler.py

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-03-13 17:24:02 -07:00
martinl f674084db5
MacOS: use gcc-12 for building tests (#1241)
* MacOS: use gcc-12 for building tests

* Update README.md

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-03-13 16:21:43 -07:00
Jason Young 3a5bbc6f20
VW PQ: Corrected message name for ACC_GRA_Anzeige (#1286) 2023-03-13 13:36:41 -07:00
Adeeb Shihadeh efb36197bb
PandaDFU: SPI support (#1270)
* PandaDFU: SPI support

* get mcu type

* program bootstub

* little cleanup

* more cleanup

* connect by dfu serial

* time to remove that

* none

* fix linter

* little more

* catch

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-03-06 21:52:08 -08:00
Adeeb Shihadeh 18230831f3
PandaDFU: abstract out USB comms (#1274)
* wip

* revert that

* split list + connect

* some more

* mypy fix

* add clear status back

* rename

* cleanup

* cleaner mypy fix

---------

Co-authored-by: Comma Device <device@comma.ai>
2023-03-06 09:24:00 -08:00
Adeeb Shihadeh 946f952aa7
DFU HITL tests (#1276)
* DFU HITL tests

* fix + types

* fix

* clear first
2023-03-05 20:19:27 -08:00
Shane Smiskol e0e754de2c
safety replay: make Ford work (#1272)
* make replay work for ford

* revert debugging stuff

* clean that up
2023-03-03 20:48:04 -08:00
Shane Smiskol f7ba061279
Ford: test quality flags (#1266)
* adeeb

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

* check checksum

* think pylint won't like this

* complete test

* do this

* no need

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-03-01 19:17:40 -08:00
Shane Smiskol cb0cbf10d7
Ford: set quality flags, checksum in safety tests (#1265)
set quality flags, checksum
2023-02-24 23:03:21 -08:00
Shane Smiskol 8bb62cf226
Ford: check quality flag (#1264)
* quality flag support

* add NULL to other safety modes

* add to safety helpers debug print

* comment

* rename to quality_flag and add comment
2023-02-24 22:54:51 -08:00
Shane Smiskol f07309f74b
Ford: set vehicle speed and check counter (#1261)
* set vehicle speed and check counter

* organize

* fix

* and test it properly

* fix horrible bug :( test_models now passes!
2023-02-24 16:51:10 -08:00
Shane Smiskol 26ae1599ba
safety tests: refactor for cars with standstill bits (#1259)
* need this

* clean up

* pass on _speed_msg
2023-02-23 21:09:48 -08:00
Shane Smiskol ff39bc472d
Angle control safety: match openpilot limits (#1254)
* make limits match OP

* make tesla match too

* fudge speed

* we reason

* needs to be negative
2023-02-22 20:05:33 -08:00
Adeeb Shihadeh 9fe24bd368
Revert "GM: update steering limits (#1239)" (#1248)
This reverts commit 0d2ee00921.
2023-02-21 15:34:09 -08:00
Adeeb Shihadeh 0d2ee00921
GM: update steering limits (#1239)
* lower steer down val, increase allowance

* fix test fail

---------

Co-authored-by: nuwandavek <vivekaithal44@gmail.com>
2023-02-14 12:55:26 -08:00
Robbe Derks d6af117c62
Microsecond timer fix (#1236)
* add microsecond timer readout

* add CI test

* fix
2023-02-14 12:16:15 +01:00