* alternative experience
* safety init
* fix
* more update
* not really
* misra
* Add Custom MIT License (#38)
* brake check was not handled
* revert
* alt -> lkas
* explicit checks
* support toyota and ford
* rename
* hyundai can-fd support
* only allow lkas if enabled
* hyundai: main button handling
* revert
* hyundai: main button heartbeat
* add logging for controls allowed lateral
* fix panda safety
* ford btn
* toyota btn
* fca btn
* honda btn
* mads safety tests
* more tests
* safety misra
* safety mutation
* misra
* mutation experiment
* fix
* ford test main button
* ford test lkas button
* more ford test
* hyundai lkas and main
* more ford
* hyundai canfd
* rename
* rename
* cleaner
* more fixes
* more hyundai tests
* no longer needed
* thanks for tests!
* more tests for lat
* more explicit
* make sure to reset
* try this out
* probably needed
* move
* misra
* not needed
* move to safety_mads
* not really needed
* remove
* MADS: Refactor MADS safety with improved state management (pull request #46)
Refactor MADS safety with improved state management
This commit introduces a major refactoring of the MADS safety module, improving state management and control flow. Key changes include:
Core Changes:
- Introduced a MADSState struct to centralize state management
- Removed global state variables in favor of structured state
- Implemented button transition handling with explicit state tracking (PRESSED/RELEASED/NO_CHANGE)
- Added state flags for button availability detection
- Simplified lateral control permission logic
Button Handling:
- Separated main button and LKAS button state tracking
- Added independent engagement states for each button
- Improved button press detection across multiple platforms
- Added support for main and LKAS buttons on Hyundai platforms
- Modified ACC main state handling
Testing:
- Added comprehensive test coverage for MADS state transitions
- Added new MADS-specific test base class for consistent testing across platforms
- Added mutation testing for state management
- Extended timeout for mutation tests from 5 to 8 minutes
- Added extensive button press validation tests
- Enhanced debugging output in replay drive tests
The refactored code provides a more organized implementation of MADS safety features while maintaining compatibility with existing safety checks.
* adding note
* adding ford (WIP)
* adding honda (WIP)
* adding toyota (WIP)
* adding chrysler (WIP)
* Standardize Button State Handling Across Platforms
Refactor button state handling by replacing integer constants with an enumerated `ButtonState` type and updating logic to improve readability and maintainability. This change affects button press detection in Ford, Honda, Hyundai, and Toyota safety modules and aligns them with a unified MADS button state approach. Enums provide a clearer understanding of button states and transitions, facilitating easier maintenance and future enhancements.
* Disable LKAS button press logic in Honda and Toyota safety.
The code for processing LKAS button presses has been commented out in both Honda and Toyota safety implementations. This change aims to investigate or temporarily halt the button press effects without removing the logic altogether. It will be important to test for any impacts this may have on vehicle control functionality.
* Remove commented out code in toyota_rx_hook function
This commit cleans up the toyota_rx_hook function by removing unnecessary commented-out code that checks for LKAS button presses on bus 2. This helps improve code readability and maintainability without altering the existing functionality.
* GM, mazda, nissan, subaru (global & preglobal)
* Honda LKAS
* Revert "Remove commented out code in toyota_rx_hook function"
This reverts commit d6b012c01a08118d91fad56c9f6ac2f92b671968.
* Toyota, Subaru Global LKAS
* nissan fix
* gm fix
* use speed msg to force rx
* im bored
* misra
* subaru/toyota/honda
* nope
* attempt
* go through all buttons
* try nissan
* more nissan
* nissan tests passed!
* subaru lkas test (not sure why it's not passing 2 and 3 values)
* Improved code organization in safety_subaru.h and test_subaru.py
This commit includes a minor restructuring in safety_subaru.h and test_subaru.py for better readability and flow. The condition check in safety_subaru.h for lkas_hud now has explicit parentheses. With regard to test_subaru.py, an unnecessary import was removed, and the sequence of steps in the test was reordered - now enabling mads and cleaning up mads_states happens before each subtest.
* Refactor tests to use _speed_msg instead of _user_brake_msg.
Updated the MADS safety tests to utilize the _speed_msg(0) function call in place of _user_brake_msg(False).
* Reworking the tests a little for clarity
* disabling lkas again on toyota temporarily
* fix mads condition to engage
* hyundai and honda good with new tests
* Redoing more tests
* update for safety tick ensuring mads control is exited while lagging
* Updating tests for toyota
* cleaning up tests on hkg
* commenting out temp_debug for future use
* revert
* constants
* cleanup
* format!
* match yota
* Apply suggestions from code review
* force
* explicit checks
* revert
---------
Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
* mutation
* clone
* origin
* get diff
* better example
* better
* fix docker
* work on push
* make test fail
* real change
* test all modes
* ignore
* better
* reco
* fix
* no libpanda on device
* curl
* nl
* nl again
* delete
* clean
* clean
* this
* add this back
* cleanup
* update to ubuntu 24.04
* Apply suggestions from code review
* Update .github/workflows/repo.yml
* Update test.yaml
* docker builds
* bump
* no pyenv
* ugh this should just be removed
* fix
* add release/
* no openpilot
* remove those too
* build in the docker
* cleanup
* need the addons
* 9 added tests
* test speed with new del header
* mypy
* cleanup
* fix error in delete
* random
* change
* works on local
* sorted
* with order
* add pytest randomly
* test with ci
* remove sort
* cleanup
* all files
* no obj
* another bootstub
* fix
* cleanup
---------
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
* run in CI
* test
* make report optional
* 100% GM coverage
comments
* more coverage: these are unhittable lines
* vw mqb: convert switch to if, consistent with all other safety modes
* we don't check any of these yet
* rm
* ensure honda_fwd_brake is reset
* can rm this
* test honda brake latching
* honda: add rx brake function
* use loops for more coverage and more compact code
* other honda stuff
* remove car-specific stuff from init_tests
* don't need to have car safety modes reset interceptor detected (global init does)
* use get_bit
* ahh ford counter is unhittable: counter check disabled due to skipping
* misra
* test nooutput and alloutput
* required changes for that
* fix test
* more all/nooutput coverage
* start on lin
* rx coverage
* lin tx coverage
* some barebones body test
* double negative
* draft elm327 safety (git stash)
* fixes from merge
* clean up test cov
* add rm
* no body
* failed grep returns exit code 1
* more clear msgs
* 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
* cleanup is_enumerated, rename comms and init spi
* big comms refactor, building now
* misra fixes
* more fixes
* misra try 3
* cleanup
* this belongs in a separate PR
* remove unneccesary file
* revert llspi changes
* llspi misra fix
* enable SPI on F4 and setup gpio
* duh
* wip: spi comms
* more spi wip
* dynamic sector erasing
* Revert "dynamic sector erasing"
This reverts commit fce1215a2ede45e5e2a0e97ca23a86c1d8bfa94a.
* more sectors to be erased
* debugging
* woah, this works
* cleanup on the panda side
* add sync and checksum checks, and fix recovery on errors
* this seems relatively stable
* add retrying
* this is stabler
* some endianness and endpoint fixes
* builds
* revert that
* add that back
* checksum start
* start splitting up driver
* spi behind flag
* cleanup test
* bump up timeout
Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
* use docker buildkit
* enable push
* try this caching
* no regressions
* don't copy into the image
* move that
* getting there
* debug
* little smaller
* debug
* configure safe dir
* no sudo
* cleanup
* another timeout
* remove unused wifi tests
* remove that one too
* no bootmode from ESP
* clean that up
* remove two more wifi tests
* remove boardesp and esptool
* esp_gps -> gps
* missed those
* remove esptool refs
* remove esp certs
* no more wifi
* that was old
* cleanup jenkins dockerfile
* fix linter
* remove more wifi refs
* clone panda jungle from github
* no copy
* always default esp to off