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

Alert when Cockpit is minimized while vehicle is still armed #1379

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ArturoManzoli
Copy link
Contributor

Two alerts will be fired, voice (warning level) and electron desktop notification.

Closes #1377

@ArturoManzoli ArturoManzoli marked this pull request as draft October 2, 2024 20:18
Comment on lines 170 to 172
alertStore.pushAlert(
new Alert(
AlertLevel.Warning,
'Warning: Vehicle armed and Cockpit minimized. Joystick inputs are stopped. Ensure vehicle safety.'
)
)
showElectronDesktopNotification(
'Vehicle armed and Cockpit minimized. Joystick inputs are stopped. Ensure vehicle safety.'
)
}
Copy link
Member

Choose a reason for hiding this comment

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

In this case the alert will be disabled if the user disabled the general voice alerts or warning alerts.
We should create add a "force" parameter to the pushAlert method and have a dedicated switch to disable this voice alert.

Comment on lines 173 to 178
'Warning: Vehicle armed and Cockpit minimized. Joystick inputs are stopped. Ensure vehicle safety.'
)
)
showElectronDesktopNotification(
'Vehicle armed and Cockpit minimized. Joystick inputs are stopped. Ensure vehicle safety.'
)
Copy link
Member

Choose a reason for hiding this comment

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

Messages are being replicated here. You can assign them to a variable and reuse. Will also consume less lines.

Also, could we make the message more explicit? Like "Cockpit minimized while vehicle is armed. Joystick inputs will not work. Ensure vehicle safety."?

Copy link
Contributor Author

@ArturoManzoli ArturoManzoli Oct 7, 2024

Choose a reason for hiding this comment

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

Critical alerts now act independently from the other 4 categories. They are not blocked from the "Enable voice alerts option" and have a special config item to be set on the Configurations->Alerts

Also an issue, #1389 was created to implement the desktop notifications on Electron Cockpit version.

image

@rafaellehmkuhl
Copy link
Member

You can use this to check if the application is running on Electron. Will work on both the Node process as well as the renderer.

@ArturoManzoli ArturoManzoli force-pushed the 1377-Users-should-be-warned-about-Cockpit-focus-loss branch from 831e8ab to bc85ef8 Compare October 7, 2024 12:53
@ArturoManzoli ArturoManzoli force-pushed the 1377-Users-should-be-warned-about-Cockpit-focus-loss branch from bc85ef8 to 6c72d0d Compare October 7, 2024 12:57
@ArturoManzoli ArturoManzoli marked this pull request as ready for review October 7, 2024 12:59
Comment on lines +16 to +26
<v-checkbox
v-model="alertStore.enabledAlertLevels.find((level) => level.level === AlertLevel.Critical)!.enabled"
v-tooltip="
'Critical system alerts work separately from your voice alert settings. These alerts are rare but really important, so we recommend keeping them on.'
"
label="Critical system alerts"
hide-details
color="white"
class="mt-1"
/>
</div>
Copy link
Member

Choose a reason for hiding this comment

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

The problem with reusing the Critical level is that it's being also used on MAV_SEVERITY_EMERGENCY, MAV_SEVERITY_ALERT and MAV_SEVERITY_CRITICAL, from Ardupilot. Their names suggest that they are only thrown on very critical situations, but I have found it to not be true.

Right now, with the Critical level enabled (which I want to have for the joystick warning), I'm being spammed by "Ardupilot logger stuck thread" voice alerts, so I will have to disable the critical level, and in consequence I will lose the joystick alert, which I want to have.

I can think of three solutions here:

  1. Have this joystick alert on a separate level.

  2. Make each MAV_SEVERITY have it's own dedicated level.

  3. Create a dynamic alert registration system, where each new alert will create an entry for it in the alerts menu, and the user will be able to disable each alert individually.

Solution 1 is the easy one. Solution 2 is also easy and more long-term, but makes Cockpit more tied to Ardupilot (and we want to go in the opposite direction). Solution 3 seems to be the correct one, but takes a little more work (although not that much I think).

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.

Users should be warned (with voice and/or notifications) when Cockpit is minimized while the vehicle is armed
2 participants