Skip to content

Add CLEAR_ON_IGNITION_ON #35710

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

Merged
merged 10 commits into from
Jul 17, 2025
Merged

Add CLEAR_ON_IGNITION_ON #35710

merged 10 commits into from
Jul 17, 2025

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Jul 13, 2025

Closes #35708

Remembers if driver was distracted if a restart_needed toggle was flipped

Copy link

sentry-io bot commented Jul 13, 2025

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: system/hardware/hardwared.py

Function Unhandled Issue
hardware_thread OSError: [Errno 22] Invalid argument openpilot.sy...
Event Count: 1

Did you find this useful? React with a 👍 or 👎

@sshane sshane requested a review from ZwX1616 July 13, 2025 08:23
@sshane sshane requested a review from Copilot July 17, 2025 03:50
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a new parameter clearing mechanism to remember driver distraction state across system restarts when ignition is toggled on. This addresses the issue where driver distraction warnings were lost when restart_needed toggles were flipped.

  • Adds CLEAR_ON_IGNITION_ON parameter type to selectively clear certain parameters when ignition turns on
  • Implements ignition state tracking in the manager to trigger parameter clearing when ignition transitions from off to on
  • Modifies driver monitoring to persist distraction state using the new parameter clearing behavior

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
system/manager/manager.py Adds ignition state tracking and clears CLEAR_ON_IGNITION_ON parameters when ignition turns on
selfdrive/monitoring/helpers.py Implements persistent driver distraction state using DriverTooDistracted parameter
common/params_pyx.pyx Exposes new CLEAR_ON_IGNITION_ON parameter type to Python
common/params_keys.h Configures DriverTooDistracted parameter with appropriate clearing behavior
common/params.h Defines the new CLEAR_ON_IGNITION_ON parameter type constant

@sshane sshane merged commit 39673de into master Jul 17, 2025
16 checks passed
@sshane sshane deleted the clear-ignition branch July 17, 2025 03:59
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.

Add CLEAR_ON_IGNITION_ON
1 participant