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

Bug Fix: Fixing Mode Change Selector Commanding Mode Change Back to Original Mode #795

Merged

Conversation

ericjohnson97
Copy link
Contributor

closes #742

This change fixes an issue where a user selects a new mode to change the vehicle to, but the mode does not change. This happens because the mode selector is commanding a mode change based on when the variable currentMode is changed. This variable is driven off of 2 sources.

  • 1.) the selection from the drop down menu.
  • 2.) the telemetry.

When a user changes the dropdown menu selection, it triggers the mode change command, but the mode change command doesn't happen fast enough so that the next telemetry update changes the drop down mode back to the original mode which triggers another command to the vehicle to change the mode back to the original state.

A simple solution to this is to check in the watcher function if the desired mode is already the mode of the vehicle if so, we know that the state change is due to a telemetry update and not from the user.

Copy link
Member

@rafaellehmkuhl rafaellehmkuhl left a comment

Choose a reason for hiding this comment

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

Nice fix!

src/components/mini-widgets/ModeSelector.vue Outdated Show resolved Hide resolved
src/components/mini-widgets/ModeSelector.vue Outdated Show resolved Hide resolved
@rafaellehmkuhl rafaellehmkuhl merged commit 911bb94 into bluerobotics:master Mar 1, 2024
7 checks passed
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.

Drive mode selection: Refusing to stay in POSHOLD - keeps switching back to ALT_HOLD mode
2 participants