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

CurrentState: Silence redundant links #3258

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

robertlong13
Copy link
Collaborator

Some speech events, like mode changes, fire off on all connected com ports, not just the primary. Additionally, CurrentState ignores the speechenable flag of the MAVLinkInterface that it's attached to, causing it to go off even for interfaces that are supposed to be silent.

This PR makes CurrentState honor the speechenable flag. Additionally, it sets speechenable on an interface when MainV2.comPort is set to that interface, and clears speechenable on the old interface that MainV2.comPort was pointing to.

@EosBandi
Copy link
Collaborator

What about multi vehicle configurations ? Speech is the only feedback for changes on a non selected vehicle and this disables it as well...

@robertlong13
Copy link
Collaborator Author

I was thinking about this in the context of multi vehicle applications too. "Mode changed to X", "Heading to Waypoint X", without any indication of which vehicle it came from, is, at best, unhelpful. At worst, it's overwhelming vocal spam. Especially if you have a large swarm.

If that's not convincing, then I can reduce this PR to just making CurrentState honor the speechenable flag. That way plugins have the ability to control it, and we can add options for the stock behavior in the future.

@robertlong13
Copy link
Collaborator Author

@EosBandi and @meee1, thoughts on this? If you think it's best to default it so that all connections speak normally, I can reduce this PR to just fix it so that speechenable works correctly.


// Disable speech on old port and enable it on the new one
if (_comPort != null) _comPort.speechenabled = false;
if (value != null) value.speechenabled = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

what if it was disabled before hand?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Currently, we don't disable this on any interfaces that we also set as MainV2.comPort. I can't imagine a case where we want some interfaces to speak but don't want the currently selected interface to speak (if you want no interfaces to speak, this doesn't override the global Speech.speechEnable)

I can definitely see that the hard-coding of false on the old port, is pretty limiting though.

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.

None yet

3 participants