* 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
* 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>
* 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>
* 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 f147955b94119eca0abd1b605844ab5002fb0305.
* 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 256f3be9a86e2412220d473037d64b84167ae98d.
* 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 6bc63a345a2d63019a640092dd9538203e8b213d.
* 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 bc37a7eedd2269bb3bc77d96762f0f0df6890991.
* 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>
* 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>
* 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 7594fc5e2f058d7db1a166e9d61781d6817d9f81.
* 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>
* civic 2022
* remove
* maybe not the right way
* Honda Radarless: add tests
* update
* different bus
* other bus
* Revert "other bus"
This reverts commit 691e045f8724e57f135ad8d1683e83acbc16b91f.
* add new HUD message
* add
* different bus
* correct freq
* small updates
* comma
* remove
* remove for now
* missing
* not needed
* make into a safety param and clean up
* this can be reverted
* clean up tests (something's broken)
* fix some errors
* this message doesn't exist on any bus
* this car doesn't have BRAKE_MODULE
* make safety more explicit and fix button safety
* fix some tests
* fix tests
formatting
clean up
* radarless uses SCM_FEEDBACK too
* fix tx msgs, clean up, make test common between bosch tests
* misra
* Fix python linting errors
add comment
* not sure where that came from
* add comments
add comments
* we can guarantee honda_bosch_long is true only if not radarless
* these are the same! 🎉
* use updated route with correct tx msgs
* helper pt bus function
* this is explained above
* use function
* no more blocked messages!
* bump openpilot
* comment
* line too long
* needs system
* send on bus 0
* Camera needs bus 2 for buttons
This reverts commit f90db5d359c1c952de87ea4a2127ae599306e729.
* fix button tests
* bump openpilot
* move this down
* make this explicit
* comments
Co-authored-by: vanillagorillaa <ntmccoy@yahoo.com>
Co-authored-by: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com>
* rename to torque_cmd_msg
* Move most of the driver torque tests into common.DriverTorqueSteeringSafetyTest
* fix static analysis so far
* HDA2 just works
* TODO: Subaru
* Subaru
* Move Mazda steering constants into class
* rm line
* split into classes
* move test_against_torque_driver into common driver torque tests
* rename to match all other tests
* fix linter
* revert changes
* block lkas
* taco time
* local changes
* start
* tx checks
* counter + vehicle moving
* support big can fd
* check crc
* add torque to rx checks
* tests
* little more
* little more
* get some misra coverage
Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
* check steer_req
* think this is clearer on first glance
* add test
* also test recovery
* Update tests/safety/test_toyota.py
* Update tests/safety/test_toyota.py
* move
* safety for non-longitudinal
* flip around param for easily replaying old logs on new panda
* fix misra: a function parameter should not be modified
* safety
* the toyota tests all share common messages
* fixup tests
* update comment
* same as tesla test
* check if subset
* update comments
update comments
* test implemented for Toyota
* fix Toyota interceptor
* use hasattr
* do Honda (still need Nidec ACC_HUD safety)
* add longitudinal_allowed to ACC_HUD (Nidec w/ no pedal
* rx not needed
* add base test for longitudinal
* update name
* stash
* do GM
* use gas_pressed_prev
* do tesla safety
* add full tests
* add get_longitudinal_allowed for simpler tests
* remove unnecessary tests and revert honda/hyundai
* fix honda after revert
* make sure releasing gas allows longitudinal again
* clean up
* clean up
* Just check longitudinal allowed
* don't need to reset detection
* use prev and add brake detection
* only on gas
* make sure we don't change current_controls_allowed braking behavior
* clean up tests
* use current_controls_allowed for honda & GM
* this is pretty much tested in common
* fix up tests and move common tests
* revert
* better place
* add for body
* _brake_msg and _gas_msg were confusing
* use class inheritance to define test specific safety variables
* Revert "use class inheritance to define test specific safety variables"
This reverts commit 734efd96f3f66c2cff62674a6510c1c4b08f22cd.
* common function to set up each test
fix honda
* Revert "common function to set up each test"
This reverts commit fe4e71b3c64c6dd9717ea4f188abef7114cbfce8.
* rename related function
* formatting
* consistent name
* revert this change
* alternative experiences
* not unsafe
* more renames
more renames
* not yet true
* I think we import from panda now
* update comments and test
* not needed
* bump health pkt version
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
* setUpClass never did anything
* oh, comments work as pass?
* pass
* Update tests/safety/test_honda.py
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
* tesla safety cleanup + long WIP
* more long safety
* longitudinal safety tests
* fix misra
* add safety for main bus DAS_control
* acc_state is not enabled
* fix tests
* we don't want this
* fix Tesla common test
* Update safety_nissan.h
Updated brake CAN address to 0x25e and brake pressed to byte logic
* Update safety_nissan.h
missed a change
* Update safety_nissan.h
* Update safety_nissan.h
* Update safety_nissan.h
Corrected Line 79 to pull from the "CRUISE THROTTLE" message at address 0x239, byte 4, bit 6, which gets us to the "USER_BRAKE_PRESSED" bit for comparison if the brake pedal is being pressed.
* Update safety_nissan.h
Removed duplicate 0x239 message in "AddrCheckStruct"
* Update safety_nissan.h
Just adding back 0x1cc to see if that fixes things?
* leaf safety tests
* clenaup
* bump openpilot
* Update tests/safety/test_nissan.py
Co-authored-by: Kirk Miller <kirk.miller92@gmail.com>
* Add support for new Honda Bosch vehicles
- Support extended LKAS_HUD IDs on Honda Bosch
- Support extended ID checksum on incoming frames in safety hook (currently unused).
condense
Cleaner. Don't need to store the value in checksum at the return.
Co-Authored-By: Adeeb Shihadeh <adeebshihadeh@users.noreply.github.com>
* revert checksum change
* use full space
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@users.noreply.github.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
* fix W391
* E262
* E703
* W293
* some E
* E231
* some more E
* E225
* more E
* E252
* no tabs
* more tabs
* E701
* uds.py
* almost all of them
* only e265 left
* not sure why this is triggering on commented out code
* ignore esptool
* Add pre commit checks
* untested but should work
* fix typo in dockerfile
* add sqlite
* add pylintrc to ignore usb1 members
* Typo in stage name
* Move to requirements