Commit Graph

520 Commits

Author SHA1 Message Date
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
Justin Newberry 5801582baf
Subaru: convert measured angle to centigrees (#1567)
convert to centigrees
2023-08-07 09:29:34 -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
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
Cameron Clough 0c33554624
Ford CAN FD safety (#1455) 2023-07-16 15:09:37 +01: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
Cameron Clough 55ef91d9ab
Ford: don't check vehicle roll quality flag (#1461) 2023-06-17 01:11:21 +01: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
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
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
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
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 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 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
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
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
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 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
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
Shane Smiskol f29125f6ad
DriverTorqueSteeringSafetyTest: remove useless function (#1275)
Update common.py
2023-03-22 21:57:18 -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
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
Jason Young 3a5bbc6f20
VW PQ: Corrected message name for ACC_GRA_Anzeige (#1286) 2023-03-13 13:36:41 -07: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 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
Adeeb Shihadeh 14051f9ce3
Chrysler: revert rate limit increase (#1240)
* Revert "Chrysler: add flag for alternate steer limits (#1238)"

This reverts commit d15250cb14.

* Revert "Chrysler: increase torque rate limits (#985)"

This reverts commit ae051c94a3.
2023-02-13 14:13:40 -08:00
Shane Smiskol 7d27eb10fb
GM: adjust steering rate limits for slower message rate (#1235)
* Adjust GM steering limits for 50Hz -> 33Hz change

* fix test
2023-02-07 23:33:51 -08:00
Shane Smiskol 0f964c6db3
Ford: lateral motion control safety (#1228)
* assert the other signals are zeroed

* add to tja function

* fix misra

* test

* should tx

* ?

* rm line

* up here

* Update tests/safety/test_ford.py

* faster

* adjust round
2023-02-02 23:02:03 -08:00
Adeeb Shihadeh ae051c94a3
Chrysler: increase torque rate limits (#985) 2023-01-25 18:51:36 -08:00
Shane Smiskol 0b3b906036
VW: match openpilot standstill check (#1064)
* VW: match openpilot standstill check

* fixes

* check > 0

* fix comments

* misra

* better
2023-01-10 22:00:20 -08:00
Shane Smiskol 345147fe2b
tests: clean up abstract methods (#1196)
* don't need to redefine _torque_cmd_msg in abstract subclasses

* fix

* pylint has a bug?

* test pylint

* clean up
2022-12-15 15:50:15 -08:00
Adeeb Shihadeh 4edd1a6021
Hyundai: alt steering limits (#1186)
* Hyundai: alt steering limits

* parans
2022-12-02 23:34:06 -08:00
Shane Smiskol a6d0765b69
safety: common angle checks (#1182)
* common angle checks

* clean up

* clean up check and add comments

* readable

* ints

* tests draft

* clean up

* comment

* pylint exception

* clean up

* duplicate
2022-12-02 16:45:23 -08:00
Shane Smiskol 6e8a4fcc38
safety tests: common angle tests (#1185)
* basic formatting

* common tests

* assert truthfulness

* ignore single pylint exception

* wya too many lines
2022-12-02 16:05:35 -08:00
Shane Smiskol 2ae7b9a4d5
scons: put targets in global SConscript (#1180)
* Revert "remove unused scons argument (#1169)"

This reverts commit 702e5281d8.

* try this

* clean up

* default true

* default true

* already built
2022-11-30 20:22:09 -08:00
Shane Smiskol a0b1d64e4e
Honda Nidec: max gas safety and common speed cmd checks (#1179)
* limit gas and speed

* gas safety test
2022-11-30 18:56:05 -08:00
Adeeb Shihadeh 1f73c70fdc
generic libpanda for tests (#1177)
* generic libpanda for tests

* move safety helpers

* fix ci build

* fix running

* opendbc is in the image

* make can packet

* rename
2022-11-30 17:41:24 -08:00
Adeeb Shihadeh 27504639f0
cleanup + prep for more tests! (#1172)
* panda for pc!

* little more

* fake panda

* move some more stuff

* increase timeout

* move that

* print helpers

* cleanup

* just move it for now

* revert jenkins changes
2022-11-30 14:15:09 -08:00
Shane Smiskol e8bd1df511
safety: common gas & brake safety checks (#1168)
* do toyota, hyundai, gm

* comments

* honda draft

* Revert "honda draft"

This reverts commit a1f466a5c9.

* do tesla

* vw draft

* finish vw

* fix safety

* clean up

* fix function names

* do honda and fix safety test not checking pos accel for bosch

* clean that up
2022-11-29 23:45:55 -08:00
Shane Smiskol 2baa0ffed5
Safety: common acceleration cmd checks (#1171)
* do toyota, hyundai, gm

* comments

* honda draft

* Revert "honda draft"

This reverts commit a1f466a5c9.

* do tesla

* vw draft

* finish vw

* fix safety

* only accel

* only accel

* some clean up

* fix mqb tests

* rename
2022-11-29 16:46:32 -08:00
Shane Smiskol 702e5281d8
remove unused scons argument (#1169)
* clean

* also here
2022-11-29 01:28:46 -08:00
Shane Smiskol 8accca13ad
VW: explicitly test for inactive accel (#1167)
* explicitely test for inactive accel

* fix the safety

* and catch the mistake

* revert
2022-11-28 22:37:59 -08:00
Jason Young e4c4253964
VW MQB: Redundant brake pressed signals (#1137)
* VW MQB: Redundant brake pressed signals

* bump timer for safety tests in CI

* use nicer f-string syntax

* don't need that
2022-11-22 14:27:52 -08:00
hoomoose 5dc5cd8e20
Hyundai: longitudinal support for all CAN-FD EV + Hybrid (#1128)
* Update safety_hyundai_canfd.h

* Update safety_hyundai_canfd.h

* Update safety_hyundai_canfd.h

* cleanup

* add test

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-15 14:48:45 -08:00
Shane Smiskol c0632cd32b
GM: enable on rising edge of resume (#1157)
* rising edge of resume

* fix test

* comment

* todo fix tests

* fix test

* we want to test the transition from btn prev to btn cur, not unpressed to x to y

* range
2022-11-13 19:10:45 -08:00
Shane Smiskol 0096d0c4fc
GM: handle run-away set speed (#1156)
* Revert "GM: enable on rising edge of resume (#1155)"

This reverts commit 5aa33e1b2f.

* allow set/resume to any other button (except cancel)

* explicit test

* This is a test of both PRs combined

* Revert "This is a test of both PRs combined"

This reverts commit c7fdc3b00c.

* fix test
2022-11-12 01:55:41 -08:00
Shane Smiskol ff48ecc34e Revert "GM: enable on rising edge of resume (#1155)"
This reverts commit 5aa33e1b2f.
2022-11-12 01:47:13 -08:00
Shane Smiskol 5aa33e1b2f
GM: enable on rising edge of resume (#1155)
* rising edge of resume

* fix test

* comment
2022-11-12 00:01:15 -08:00
Shane Smiskol d573111268
Hyundai: fix button enable controls mismatch (#1152)
* fix hyundai long button controls mismatch

* test

* comment
2022-11-11 14:43:35 -08:00
Shane Smiskol 281eb7731b
GM Camera: use ECM brake pressed bit (#1138)
* GM camera: use ECM brake pressed bit

* back to ECMEngineStatus

* length 8

* common gmcamera class

* move to longitudinal base

* Revert "move to longitudinal base"

This reverts commit 67abe4c86b.

* fix
2022-11-08 20:17:02 -08:00
Shane Smiskol 8f7befa9bb
GM: clean up safety classes (#1143)
* add PCM_CRUISE flag to GM safety tests (like safety code)

* pcm_status_msg

* rm 2
2022-11-08 19:50:11 -08:00
Jason Wen 1ccdff90c5
HKG CAN-FD: support radar ACC cars (#1134)
* HKG: Car Port for Genesis GV70 2023

* Revert "HKG: Car Port for Genesis GV70 2023"

This reverts commit 01bfda6dff.

* 0x1a0 rx check

* Wrong one oops

* Check 0x1a0 based on param

* no need

* getting a bit messy, clean up soon!

* clean up

* clean up

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-11-07 22:44:13 -08:00
Jason Wen f3fc343262
Hyundai CAN-FD: support for ICE cars (#1031)
* Hyundai: Car Port for Santa Cruz 2022

New struct and params for CAN-FD ICE models

fixup! New struct and params for CAN-FD ICE models

* Longitudinal Control: ICE CAN-FD models

* fixup! Longitudinal Control: ICE CAN-FD models

* fixup! Longitudinal Control: ICE CAN-FD models

* fixup! Longitudinal Control: ICE CAN-FD models

* fixup! Longitudinal Control: ICE CAN-FD models

* Gate radar disable behind HDA2 only

* Remove unnecessary HDA2 checks

* Fix MISRA violation

* not needed, in HYUNDAI_CANFD_HDA2_LONG_TX_MSGS

* revert longitudinal changes

* fix addr check logic, clean up

* revert more long stuff

* fix addr check

* temp

* tests

* work?

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-11-04 16:43:33 -07:00
Shane Smiskol 34cfc43b40
Hyundai CAN-FD: more complete tests (#1133)
* more complete tests

* use parameterized_class

* make clear this only tests EV right now

* fix python linter

* rename reference

* clean up and fix python linter again
2022-11-04 15:34:16 -07:00
Adeeb Shihadeh bfce4c72f0
Hyundai: update tests with new DBC names (#1129)
* Hyundai: update tests with new DBC names

* fixed
2022-11-03 14:36:09 -07:00
Jason Young 0ca6d9d924
VW MQB: Longitudinal safety (#920)
* VW MQB: Longitudinal safety

* disregard ACC_13 for now

* abstraction cleanup

* fix long control flag name

* quick hack

* VW MQB: Cleanup message counter handling

* various cleanup

* try without ACC_04

* follow DBC updates

* bump Docker opendbc ref

* additional main switch and cancel handling/testing

* pacify linter

* style

* handle the overlap tests like HKG CANFD

* update replay route

* commonize elements between MQB and PQ

* Apply suggestions from code review

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

* proper use of globals/conventions

* make these global

* this is better for now

* better comment on accel boundary scaling

* spelling error

* reset on init

* try bumping openpilot

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-01 08:13:58 -07:00
Jason Shuler cf4aa6bb30
GM: longitudinal support for camera-integrated cars (#1014)
* Allow brake TX on PT bus

* Initial Panda GM cam harness support
 * Complete rewrite / simplification
 * Add param for cam harness (default is OBD2)
   - Forward btw 0 and 2
   - Filter LKAS and optionally ACC from cam
 * Add param for stock ACC
   - Allows ACC on PT bus when set, not otherwise
   - Allows ACC from cam when set, not otherwise
 * Add temporary WIP EPS timing workaround in ifdef

* Remove keepalive; regen == braking

* Fix MISRA violations

* EPS timing opt-in by param

* Minor clean up

* remove timing code for readability

fix and formatting

* we only need to send one message if cam harness and stock long

* Simplify params

* Removed dup brake msg

* revised params, split 3-ways

* add test

* clean up a bit, no need to send ACC yet

like this

* split out button enable and pcm enable into seperate tests

* some formatting

some formatting

* GM CAM uses PCM cruise for controls_allowed

* fix gas safety tests

* misra

* fix static analysis

comment

* fix brake pressed

* Add OP VOACC override stock cam

* Add VOACC safetyparam to init.py

* openpilot long safety

* do this in another PR

* add back

* add safety tests

* rename

* struct for safety

* not used

* temporary fault fix

* adjust max gas

* allow PSCMStatus in long mode

* stash

* fix max gas

* fix and clean up tests

* clean up longitudinal tests into a common class

* fix pylint

* subclass

* clean that up

* rm

* blocking

* comment

* comment

* lower case

* brake bus

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-11-01 00:58:18 -07:00
Shane Smiskol 494c5a403a
GM Cam: pass on useless tests (#1122)
* pass

* Caps
2022-10-27 21:23:36 -07:00
Shane Smiskol 187fdee385
safety: remove pre-enable state (#1121)
* current_controls_allowed is now unused

* reduce diff

* remove from honda

* these test nothing

* fix
2022-10-27 17:51:20 -07:00
Shane Smiskol 2db69bc941
Revert "GM: different brake thresholds by platform (#1104)" (#1116)
This reverts commit 5962bcd08a.
2022-10-21 18:11:31 -07:00
Shane Smiskol d51dd496cb
GM: more longitudinal safety (#1115)
* seems cleaner

* abort struct

* fix

* add variable in test_gm (TODO: add tests)

* fix test for new safety

* cmt

* && -> ||
2022-10-21 00:20:01 -07:00
Adeeb Shihadeh fcb1a5a8e2
Hyundai CAN-FD: common brake pressed signal (#1113)
* Hyundai CAN-FD: common brake pressed signal

* change bit

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-10-20 19:52:06 -07:00
Shane Smiskol 54f9390ff5
GM: allow TX PSCMStatus message (#1111)
* forwarding

* add to tx msgs

* don't block

* Revert "don't block"

This reverts commit b1ca52f86d.

* fix forwarding tests

* comment

* add comment
2022-10-19 23:25:22 -07:00
Adeeb Shihadeh 723e60cb43 Hyundai CAN-FD: fix SCC bus for HDA1 2022-10-19 22:58:52 -07:00
Adeeb Shihadeh 24ccc34c46
Hyundai CAN-FD: use cruise signals from SCC ECU (#1112)
* Hyundai CAN-FD: use cruise signals from SCC ECU

* cleanup
2022-10-19 22:26:22 -07:00
hoomoose dd751862c3
Hyundai: support button resume on CAN-FD HDA1 (#1102)
* Update safety_hyundai_canfd.h

* run tx checks

* fix tests

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-10-19 15:17:23 -07:00
Shane Smiskol b95a65df58
GM: match ECM standstill check (#1105)
* match ECM check

* fix

* needs to be <= 10 to avoid a fault, fix for safety tests

* fix
2022-10-18 11:22:04 -07:00
Shane Smiskol 842cf65818
Hyundai CAN-FD: support 90deg angle limit bypass (#1098)
* h90d CAN-FD

* torque

* one liner

* adjust safety

* Revert "adjust safety"

This reverts commit e3539edc31.
2022-10-17 20:27:30 -07:00
Jason Wen 62868c36a8
Hyundai: CAN-FD Hybrid gas pressed signal (#1106)
* Hyundai: Gate 0x105 behind hybrid CAN-FD only

* update tests

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-10-15 12:26:01 -07:00
Shane Smiskol 5962bcd08a
GM: different brake thresholds by platform (#1104)
* Different brake pressed thresholds

* Update board/safety/safety_gm.h
2022-10-14 16:51:53 -07:00
Shane Smiskol c39528d299
Hyundai tests: fix counter in FCA message (#1092)
* tests: fix counter in FCA message

* Update tests/safety/test_hyundai.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-10-12 21:48:04 -07:00
Adeeb Shihadeh de380961fc
Hyundai: support non-HDA2 EV gas signals (#1100)
* Hyundai: support non-HDA2 EV gas signals

* update tests
2022-10-12 21:00:24 -07:00
Adeeb Shihadeh 622ce923e9
Hyundai: share flags with CAN-FD platform (#1099)
* Hyundai: share flags with CAN-FD platform

* update flags there
2022-10-12 20:29:15 -07:00
Adeeb Shihadeh ffb3109e28
Hyundai: HDA2 longitudinal control support (#1096)
* ev6 long

* update steering
2022-10-11 20:50:23 -07:00
Shane Smiskol d68b1b0a98
Hyundai: support 90deg angle limit bypass (#1091)
* h90d safety

* quicker rate

* update comment

* support multi frames?

* stash

* stash

* might work?

* stash

* clean up

* revert that

* add test

* fixup tests

* clean up

* remove test

* try to combine tests

* Revert "try to combine tests"

This reverts commit f147955b94.

* seems simpler

* more explicit

* shouldn't be needed

* comment

* fix that test
2022-10-11 17:57:03 -07:00
Adeeb Shihadeh aa0be4d3dc
Hyundai: move shared definitions to a separate file (#1097)
* Hyundai: move shared definitions to a separate header file

* same with tests

* cleanup
2022-10-11 17:38:34 -07:00
Shane Smiskol 0a819ad465
Torque request bit: support multiple invalid frames (#1094)
* h90d safety

* quicker rate

* update comment

* support multi frames?

* stash

* stash

* might work?

* stash

* clean up

* revert that

* add test

* fixup tests

* clean up

* remove test

* try to combine tests

* Revert "try to combine tests"

This reverts commit f147955b94.

* seems simpler

* more explicit

* shouldn't be needed

* no hyundai stuff

* no line

* consecutively

* comment

* comment

* comment

* revert

* comment

* check earlier

check earlier

* ensure we don't set a negative value

* add todo comments

* for loop
2022-10-11 13:20:24 -07:00
Shane Smiskol 3644d9412b Revert "Hyundai: steering fault bit safety (#1095)"
This reverts commit 2334a413bc.
2022-10-11 11:25:41 -07:00
Shane Smiskol 2334a413bc
Hyundai: steering fault bit safety (#1095)
comment

smaller comment

simpler test

check controls allowed

more classical

more like the buttons

revert

flip
2022-10-10 21:56:22 -07:00
Shane Smiskol aaa70b10be
Toyota: remove redundant test (#1093)
already test this
2022-10-10 17:01:49 -07:00
Shane Smiskol 1303af2db2
GM: change brake pressed signal (#1089)
* Match openpilot brake check

* comment

* simple

* Update test

* doesn't take an int

* msg varies in size by platform

* 2 extra bytes of zeros on Escalade

* label platforms

* space
2022-10-07 16:10:09 -07:00
Cameron Clough c09a1cd520
Ford: allow sending buttons msg to camera (#1085)
* allow sending steering buttons msg to camera

The DBC lists both the IPMA and PCM as receiving modules for the `CcAslButtnCnclPress` and `CcAsllButtnResPress` signals used to cancel/resume ACC.

Sending resume to both buses is confirmed to work by three testers, now it's just down to tweaking openpilot to get high reliability.

* add test for both buses

* only send TJA to bus 2
2022-10-07 10:47:04 -07:00
Shane Smiskol 9bcd9b9a24
GM: update max brake (#1087)
update max brake
2022-10-04 00:20:31 -07:00
Shane Smiskol 38257a93e4
Hyundai: lower CAN FD torque rate limits (#1066) 2022-09-15 11:22:21 -07:00
Shane Smiskol f120999e19
Subaru: match openpilot standstill (#1070)
match openpilot standstill
2022-09-14 18:42:16 -07:00
Shane Smiskol 19983f13b3
Chrysler: match openpilot standstill check (#1065)
* match openpilot standstill, and fix ram standstill parsing

* misra

* cmt
2022-09-13 13:52:44 -07:00
Shane Smiskol 788e0b5ac9
GM: same regen check as openpilot (#1026)
* it was only checking a specific bit

* same check as openpilot

* reset on init

* unsigned

* should fix conflicts

* common

* comment

* Add missing function

* Tests

* the alternative is a mess

typo

typo

* draft

* finish common

* works but you need RegenSafetyTest before all other classes

* Revert "works but you need RegenSafetyTest before all other classes"

This reverts commit 256f3be9a8.

* This works too

* need parameterized, subtests nor super() calls correctly reset state

* Fix test and comment

* comment

* another fix...

* subclass

* ABC

* order

* fix static analysis

* can do this

* Revert "can do this"

This reverts commit 6bc63a345a.

* this is nicer, no pylint errors

* Update tests/safety/common.py

* underscore

* dynamically detect and add tests

* simpler

* only for safety modes with a regen message

* check attr

* Revert "check attr"

This reverts commit bc37a7eedd.

* need to check at test time not class init time
2022-09-12 21:32:06 -07:00
Cameron Clough 8f13ca3f66
Ford safety updates (#1052)
* allow resume button press while controls allowed

* add ACCDATA_3 msg

* change msg name style to match DBC

* fix

* wrong msg

* chmod +x

* always allow other acc buttons e.g. tja toggle
2022-09-08 15:35:10 -07:00
Shane Smiskol 0ca23b6778
Toyota: generic steer fault workaround safety (#939)
* toyota steer fault safety

* fix

* alternative safety

* no comment

* should be good

* same behavior, a bit simpler

* better tests

* fix comment

* update safety comment

* const is actual number of messages

* Fix bug

* misra

* Fix test

* clean up logic a bit

clean up logic a bit

fix

* fix

fix

* clean up tests

* unsigned

* forgot to rename message when merged

* Comments

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

* Update names

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

* rename rest of variables

* real time checks

* clean up safety tests

* revert

* add this

* clean up

* better name

* use common steering checks

* reverse order

* make common

* re-organize the safety

* clean up safety_toyota

* more clean up

* add comment back

* 19

* recover

* some variable name clean up

* rename and reset `valid_steering_msg_count`, another recover message

* move comment

* remove reset_toyota_timer, minor test clean up

* common test

* use init_tests

* threshold used to be: frame you can cut steer on, now it's min num of valid frames (next frame you can cut, 18+1)

* Update tests/safety/test_toyota.py

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

* fix realtime

* Update board/safety/safety_toyota.h

* Apply suggestions from code review

* Update board/safety/safety_toyota.h

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-09-06 19:12:06 -07:00
Shane Smiskol 77cfc32d37
Toyota: match openpilot standstill check (#1045)
* Match openpilot

* check against zero value

* formatting

* use intermediary variable

* comment

* hmm... this works now??

* fix misra
2022-08-30 23:24:37 -07:00
Jason Wen 9d6496ece8
Hyundai CAN-FD: Tucson Hybrid 2022 support (#999)
* Hyundai: Car Port for Tucson Hybrid 2022

* Remove test comments

* Fix fwd_hook

* Allow tx on 0x1a0

* Fix byte counts

* Send LFA and HDA icons based on engageability

* Add FLAG_HYUNDAI_CANFD_HDA2 flag

* Update __init__.py

* Allow tx with CRUISE_INACTIVE

* Panda safety cleanup

* Include bus 0 in rx checks

* Missed one

* Remove redundant check

* Add comments

* start cleanup

* little more

* more cleanup

* tests

* one more test case

* rename

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-08-19 19:43:58 -07:00
Jason Young 4412eeaf1a
VW MQB: Cleanup message counter handling (#1034) 2022-08-15 20:49:06 -07:00
Jason Young 199bc10db3
VW PQ: Longitudinal control safety, lateral torque update (#989)
* VW PQ: Updated checksum and counter handling

* first pass PQ long control safety

* refactor stock test to prep for long test

* long control tests

* falling edge enable logic and tests

* accidentally worked but this is better

* test misra/cppcheck evaluation of debug build

* Revert "test misra/cppcheck evaluation of debug build"

This reverts commit 7594fc5e2f.

* allow use of manufacturer ramp-up rate

* soften wheel-touch threshold

* fix tests

* check/test ACC main switch state

* fix CRC for Motor_5

* derp

* retry CI

* try that again

* fuuuu

* fix Motor_5 checksum validation

* use existing acc_main_on global

* re-pin opendbc

* no need for resume spam in longitudinal mode

* concise

* consistency cleanup

* comment and whitespace cleanup

* more cleanup

* more

* restore driver torque threshold

* add long control replay route

* obsolete comment

* proper flag name

* wild to mild-ish

* bump openpilot ref

* Update test_safety_replay.py

* handle non existent routes

* comment consistency/polish

* flip comparison order for falling edge clarity

* restore refs

* read the diff next time, speedy

* srsly

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-08-12 18:50:00 -07:00
Jason Shuler 5e0dde7b48
GM: Add support for cam harness & stock ACC (#962)
* Allow brake TX on PT bus

* Initial Panda GM cam harness support
 * Complete rewrite / simplification
 * Add param for cam harness (default is OBD2)
   - Forward btw 0 and 2
   - Filter LKAS and optionally ACC from cam
 * Add param for stock ACC
   - Allows ACC on PT bus when set, not otherwise
   - Allows ACC from cam when set, not otherwise
 * Add temporary WIP EPS timing workaround in ifdef

* Remove keepalive; regen == braking

* Fix MISRA violations

* EPS timing opt-in by param

* Minor clean up

* remove timing code for readability

fix and formatting

* we only need to send one message if cam harness and stock long

* Simplify params

* Removed dup brake msg

* revised params, split 3-ways

* add test

* clean up a bit, no need to send ACC yet

like this

* split out button enable and pcm enable into seperate tests

* some formatting

some formatting

* GM CAM uses PCM cruise for controls_allowed

* fix gas safety tests

* misra

* fix static analysis

comment

* fix brake pressed

* Add OP VOACC override stock cam

* Add VOACC safetyparam to init.py

* Revert "Add VOACC safetyparam to init.py"

This reverts commit 2e46f8746f.

* Revert "Add OP VOACC override stock cam"

This reverts commit a4b096cc1e.

* better comments

* better comments

better comments

fix

* move non-base msg definitions to subclass

* various comments

* TODO: add button safety

* add button safety

* use new pcm_cruise_check

* revert regen braking change

* only cancel button allowed

* Apply suggestions from code review

* Update board/safety/safety_gm.h

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

* fix suggestion

* Fix tests

* Revert "Fix tests"

This reverts commit 500577921f.

* this is a much simpler fix, do full fix in another PR

* tx button safety

Co-authored-by: Shane Smiskol <shane@smiskol.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-08-12 15:56:39 -07:00
Adeeb Shihadeh 06592b5c0e
Hyundai: rename HDA2 platform to CANFD (#1027)
* Hyundai: rename HDA2 platform to CANFD

* one more
2022-08-11 22:06:54 -07:00
Adeeb Shihadeh 486af79503
Chrysler: add Ram HD support (#1010)
* ram hd safety

* bump opendbc

* dt prefix

* remove that
2022-08-11 14:41:46 -07:00
Adeeb Shihadeh 291d9e3eb9
safety: refactor steering safety checks (#1013)
* start with vw

* hyundai

* rest of driver torque cars

* remove hyundai for now

* fix cppcheck crash

* set committer

* revert gm

* remove those
2022-08-09 19:53:15 -07:00
Adeeb Shihadeh e30f7e8fc7
Chrysler: cleanup + prep for Ram HD (#1012)
* Chrysler: cleanup + prep for Ram HD

* prefix with chrysler
2022-08-08 21:16:28 -07:00
Jason Wen 89989abca5
Hyundai: support camera-based SCC cars (#965)
* Hyundai: Car Port for 2022 Kona Electric Camera SCC

* add missing flag

* set camera_scc in other safety modes

* Add safety test

* this will be a stock longitudinal port for now

* common cruise check

make this check common

* Fix comment typo

* Camera SCC HKG send CLU11 on bus 2

* Update CLU11 comment

* fix button test when txing

* just add bus 2 to existing addr checks

* actually no, this will never be on bus 2

* CLU11 is always on bus 0

line

* consistent param ordering

* fix test

fix test

* this is fine

* Mistook SCC for CLU, fix

* try to make this a little more clear

* add comment

* fix that

Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-08-03 00:54:41 -07:00
Adeeb Shihadeh 4b86b83991
Subaru: support Outback and Global Gen 2 (#991)
* Subaru: support Outback and Global Gen 2

* send 0x321

* check bus

* fwd that

* gen2 limits

* lower max steer

* update safety replay route
2022-07-29 20:44:41 -07:00
Cameron Clough 3a17c2e07f
Ford: add safety code for LCA vehicles (#966)
* Ford: add CAN messages and signal definitions

* Ford: implement safety hooks

* Ford: add safety unit tests

* Use standstill signal

* Rename bus

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

* Simplify brake pressed

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

* Ford LKAS msg helper

* Simplify button violation check

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

* Simplify LKAS action check

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

* Tidy up tests

* Use standstill signal for tests

* Misra fix

* Unused definition

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

* Simplify signal bit shifting

* Remove type hints

* Add panda safety type hints

* Fix vehicle moving signal

* Fix button checks

* Fix steer allowed tests

* Fix standstill threshold in tests

* Maybe this works?

* More button tests

* Revert "Simplify button violation check"

This reverts commit c649626984.

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-07-23 16:54:58 -07:00
Adeeb Shihadeh a1686ca3ca
safety tests: use can packer for counters (#995)
* safety tests: use can packer for counters

* bump opendbc
2022-07-21 18:50:42 -07:00
Adeeb Shihadeh 1dfee5973b
Subaru: cleanup counter handling (#992) 2022-07-19 17:18:42 -07:00
Jason Young 4ce5b5a44d
VW PQ: Updated safety test checksum and counter handling (#964)
* VW PQ: Updated checksum and counter handling

* bump opendbc for Docker/CI
2022-07-15 10:49:34 -07:00
Adeeb Shihadeh 2abeab913f
EV6: reject fake cruise engagements (#987)
* EV6: reject fake cruise engagements

* bump opendbc

* update comment

* raise to 8

* add addr check
2022-07-12 17:42:13 -07:00
Adeeb Shihadeh baecd2ecc6
Chrysler: increase Ram rate limits (#981) 2022-07-11 15:01:35 -07:00
Adeeb Shihadeh ca927fe931
EV6: allow TX of 0x2a4 (#983)
* EV6: allow TX of 0x2a4

* don't fwd
2022-07-08 22:08:54 -07:00
Adeeb Shihadeh 53466f0934
Chrysler: allow resume button (#980) 2022-07-06 23:43:56 -07:00
Adeeb Shihadeh fae3ee2e81
Chrysler: Ram 1500 support (#969)
* RamInit

* Some fixes

* ram param

* cleanup steering

* invert

* couple fixups

* tests pass

* check that

* misra fixes

* same limits

* revert that

* remove those

Co-authored-by: Jonathan <jraycec@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-07-06 22:50:29 -07:00
Adeeb Shihadeh 6c0d0b43c2
Chrysler: update tests after DBC updates (#979)
* Chrysler: update tests after DBC updates

* lil cleanup
2022-07-05 16:33:12 -07:00