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

Add unitType attribute to mavcmd.xml #3475

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

robertlong13
Copy link
Collaborator

This fixes an issue where commands that used the parameter for anything other than altitude were getting unit conversions applied when they shouldn't have been. I'm also adding a unit label to the altitude column.

This also opens up the possibility of converting units (distance or altitude) for other columns, which I'll do next, probably as part of this PR, but I haven't gotten that far yet.

This will take some careful review to make sure I haven't screwed things up. I looked long and hard at all the places in FlightData that look at multiplieralt, but I could have missed something. I've done some basic testing, and it appears to be working.

One thing I noticed is that we don't seem to updata mavcmd.xml when we update Planner. If the file exists, we don't overwrite it with the one baked into the resources, which seems to be a problem IMO. Someone running Planner that was installed ages ago might not have up-to-date mavcmds, unless I'm mistaken. I can understand not wanting to immediately clobber a customized file, but we have other paths to add custom mission items in config.xml. I made sure to try to handle legacy files just in case.

This fixes an issue where commands that used the <Z> parameter for
anything other than altitude were getting unit conversions applied
when they shouldn't have been.

This also opens up the possibility of converting units for other
columns.
@robertlong13 robertlong13 requested review from EosBandi and meee1 January 8, 2025 14:26
@robertlong13
Copy link
Collaborator Author

Also, I noticed the Xamarin resources mavcmd file was way out of sync with the other one. Was this intentional? The Xamarin file is still the one used by Android, iOS, etc, right? Or is it defunct? I added a commit syncing that, but I'm not 100% sure if that's right.

@meee1 meee1 merged commit 215a22f into ArduPilot:master Jan 9, 2025
6 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.

2 participants