* some refactoring still needing to be done here
* 50hz
* set rx checks
* tx msgs
* test
* fix
* forgot to check this since it's static now
* enable_gas_interceptor
* more
* remove int funcs since are common
* generic!
* not generic
* need to set counter now
* set_enable_gas_interceptor not needed
* already reset in safety init
* fix test
* remove gas_interceptor_detected (partly)
* oof need for hjonda too
* edit structs
* more honda (still broken)
* fix typo
* shift these down
* can also make this extensible
* stash
* defining classes is much simpler, maybe in future we will have some sort of wrapper after some more thought
* remove create_interceptor_test now
* add lta interceptor
* clean up print
* clean up
* once
* type hint
* rm
* no interceptor with stock long + good test
* add interceptor counter to honda
* need alt interceptor + set rx checks for honda
* we were never testing button enable with nidec + interceptor!
honda almost all passing
* these fixes make sense
* clean up
* better
* clean up test cov
* clean up
* not needed
* fix tx msgs
* clean up
* cppcheck
* fix
* unnecessary
* common honda addr checks
* oohhhh
* rename RxCheck from merge
* more rename
* checked data and found 0x1A6 does not exist on any Bosch, so combining with 0x296 is safe
* formatting
* need this since refactor
* clean up
* fixup
* misra
* coverage caught another bug!
* another duplicate addr from multi tests
* proper base class
* formatting
* misra
* flat
* Revert "flat"
This reverts commit d5ea2adf26.
* forgot to specify bus (fuzzy test caught it, but whitelisting rx addrs
would so much quicker)
* common honda addr checks
* oohhhh
* rename RxCheck from merge
* more rename
* checked data and found 0x1A6 does not exist on any Bosch, so combining with 0x296 is safe
* formatting
* need this since refactor
* clean up
* fixup
* misra
* coverage caught another bug!
* another duplicate addr from multi tests
* proper base class
* formatting
* misra
* flat
* Revert "flat"
This reverts commit d5ea2adf26.
* new fields
* add check
* do first one
* first two
* all done
* fix all output
* simpler
* unused now
* fix body and elm
* fix that
* fix misra
* revert that
* 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
* 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
* 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
* 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
* 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>
* simple chunking
* make pylint happy
* misra happy?
* good practice anyways since we cast to a uint32_t later
* fix bug dropping packets
* minor fixes + prepare for shared lib testing
* working library now
* first queue test
* can send test
* fix running in github actions?
* add big rx test and fix it
* don't complain about empty buffers
* disable for now
* comment
* test runs
* some cleanup
* merge those
* test works
* rm that
* comment
* proper logging
* makes things too slow
Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
* 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
* 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
* 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
* 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>