* partial body safety tests
* cmt
* test this flasher msg
* move
* address check on can flashing msg
* no other test tests this, valid when we rx one
* this is more reflective on the current behavior
* better test
* clean up
* stash
* clean up
* revert
* Update board/safety/safety_body.h
* fix misra
* gm: test the other relay malfunction addr when using long with gmcam (ASCMGasRegenCmd)
* make it a dict
* might want to split these changes
* messy
* Revert "messy"
This reverts commit 25cd68fcab.
* some more
* ford: check longitudinal addr
* chrysler
* fix ford!
* gm and subaru
* common
* draft
* clean up
* clean up check
* rm line
* clean up
* add context
* apparently None isn't optional
* conventional test
* Revert "conventional test"
This reverts commit 4b265ad4ab.
* whoops, clean that up
* more clean up
* add a helpful cmt
* more hlpfl cmt
* can remove this test now
* hyundai cmts
* not really needed
* use get bit
* simplify parsing
* add get_honda_fwd_brake for latching test
rm print
* can also test with txing brake
* Revert "can also test with txing brake"
This reverts commit f75eb6eb56.
* rm this
* 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
* 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
* draft
* now clean up old comments
* no more special broken ice addr checks
* revert
* fix
* add test for ICE HDA1
* Revert "add test for ICE HDA1"
This reverts commit 76d2b0f066.
* can be separate
* macro for addr check struct
* add checks for alt buttons (fixes race condition)
* add macro for array len
* add comment
* misra
* comments to help separate
* can't put parenthesis around array item
* review suggestions
* no intermediary macros for making the structs (remove misra violation)
* Update board/safety/safety_hyundai_canfd.h
* single lines
* can avoid double checking hda2 since we have addr checks for it now
* 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>
* 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>
* 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>
* Safety: Utilize boolean values for message block checks in forward hooks
* Revert "Safety: Utilize boolean values for message block checks in forward hooks"
This reverts commit ee9809dbd3.
* others
* Revert "others"
This reverts commit f64cc1c76a.
* just do hyundai
* function to get steering address
* unclear if this is cleaner
Revert "function to get steering address"
This reverts commit 2a2b972a20.
---------
Co-authored-by: Shane Smiskol <shane@smiskol.com>
* 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>
* 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
* improve readability
* cleanup for PR
* switch to #define
* i guess i forgot how #define works
* fix #define
* improve for preglobal too
* rename because of conflicts
* rename with subaru in name
* missed some
* missed that one too
* made it pretty
* whitespace
* infotainment match opendbc
* whitespace
* whitespace
* parameterize the bus too
* fix that
* fix misra violation
* multiline
---------
Co-authored-by: Shane Smiskol <shane@smiskol.com>
* 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
* 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
* 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>
* 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>
* 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
* 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
* 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
* 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
* draft clean up
* always check
* add angle to name
* ford sends curvature when not steering and bit is 0.
it's not torque, curvature of 0 will still apply torque
* need this to be generic
* formatting
* rm
* 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)
* revert ford tests to master
* this <i>should</i> preserve behavior
* this is fine to remove
* and this should also be covered
* yeet
* change opt name, combine checks, much better!
* one more
* modes
* Add comment
* misra has a bug :(
* ugh
* make this clear
* ?
* order
* fix
* comments
* 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
* 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
* 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
* 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
* cleanup and fix
* dos must stall
* clean those up
* fix misra
* more test
* fix import
* cleanup
---------
Co-authored-by: Comma Device <device@comma.ai>
* 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>
* 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>
* VW MQB: Cleanup HCA control message
* update opendbc ref
* revert this before merging
* MISRA
* revert Dockerfile to comma master
* reverted a little too much
* 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>
* 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>