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

If one remaps the Mavlink profile in Cockpit, the changes are not retained in QGC #264

Closed
rafaellehmkuhl opened this issue Mar 22, 2023 · 2 comments
Labels
wontfix This will not be worked on

Comments

@rafaellehmkuhl
Copy link
Member

This happens because we change the buttons mapping in the Cockpit side, not in the Ardupilot side.

The solution is the same proposed for #263.

@ES-Alexander
Copy link
Contributor

@rafaellehmkuhl I don't think there's anything we can reasonably do about this.

While it's important for Cockpit to be able to set a new button function in an ArduPilot firmware, how those functions correspond to buttons is up to the control station software. Cockpit is fundamentally less restricted than QGC in terms of joystick button options, and if we try to consistently change ArduPilot's button function parameters whenever we re-map Cockpit's joystick buttons then it loses the possibility of using only a single MANUAL_CONTROL button index for multiple physical buttons that correspond to the same function, and also could be un-reconcilable if there are multiple joysticks connected that don't have identical orderings and button setups.

What makes the most sense (to me) would be Cockpit treating the ArduPilot BTNn_FUNCTION parameters as an array of values, and if a button is assigned to an ardupilot function that is not already in the array then it needs to reassign an available slot in the array, or fail/reject the button assignment if all slots are already (uniquely) full and mapped to buttons on currently connected joysticks. If a joystick profile is selected that uses ArduPilot button functions that are not currently assigned in the parameters then it can show a warning/error and allow re-assigning the parameters as necessary (if it's possible to do so).

@rafaellehmkuhl rafaellehmkuhl added the enhancement New feature or request label May 10, 2023
@rafaellehmkuhl rafaellehmkuhl added wontfix This will not be worked on and removed enhancement New feature or request labels Sep 21, 2023
@rafaellehmkuhl
Copy link
Member Author

We now support mapping any vehicle function as of #452.

As explained by @ES-Alexander it's an opinated matter, and we ended up implementing so that buttons already mapped inside the function are not remapped in Cockpit, and only unmpapped functions in the vehicle are being remapped in the vehicle itself (parameter being changed).

With that, we are able to support more than 16 buttons and also to support other protocols, including Cockpit Actions.

To finalize that, I've also talked to @Williangalvani, and we decided to slowly move from the BTNn_FUNCTION parameters to regular MAVLink messages, so that this will no longer be an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants