Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modular Assistive Driving System (MADS) #40

Draft
wants to merge 63 commits into
base: master-new
Choose a base branch
from
Draft

Conversation

devtekve
Copy link

@devtekve devtekve commented Nov 15, 2024

Refactor MADS safety with improved state management

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.

Relates to:

@sunnyhaibin sunnyhaibin changed the title Feature: Modular Assistive Driving System (MADS) Modular Assistive Driving System (MADS) Nov 21, 2024
sunnyhaibin and others added 27 commits November 22, 2024 19:18
#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants