feat: consume vehicle-provided parameter metadata - #4069
Conversation
8f65459 to
f4818af
Compare
|
@JackSkellet can you rebase the PR over master ? |
f4818af to
fcbb104
Compare
|
@patrickelectric rebase has been completed. |
| set -e | ||
|
|
||
| VERSION="t0.11.25" | ||
| VERSION="1.0.2" |
There was a problem hiding this comment.
you should not update mavlink2rest since it breaks the api from 0.X to 1.X.
There was a problem hiding this comment.
t0.11.25 does not contain the COMPONENT_METADATA message (ID 397) required by this implementation. That message becomes available in mavlink2rest 1.0.x, but I understand that upgrading breaks the existing API. Would you prefer an API-compatible 0.x backport of message 397, or an alternative BlueOS integration path?
There was a problem hiding this comment.
The best way to workaround that, is to..
Send a PR to https://github.com/mavlink/rust-mavlink/tree/0.10 (0.10 branch), with a patch commit like this one mavlink/rust-mavlink@b0da5b2 and a update version commit like this one mavlink/rust-mavlink@b210832. After that, I will create a release.
With that done, we can then create a 0.x-dev branch to release an API compatible update mavlink2rest release.
|
rust-mavlink 0.10 backport: mavlink/rust-mavlink#527 Tested on BlueOS with mavlink2rest 0.11.25; parameter metadata loads successfully. |
|
check: #4089 |
a1e015f to
0531528
Compare
|
Updated to mavlink2rest 0.11.26 and reverted the temporary 1.x compatibility handling, restoring the existing BlueOS MAVLink code paths. Parameter metadata now decodes correctly on a live BlueOS system, while the remaining message handling works as before. |
ES-Alexander
left a comment
There was a problem hiding this comment.
Thanks for the contribution @JackSkellet! :D
From some internal discussion, MAVLink Server includes MAVFTP support, and using its API for that would be a preferred approach over re-implementing MAVFTP handling in the ardupilot manager service.
| await fetchFirmwareVehicleType() // required to populate autopilot.vehicle_type | ||
| const jsons = ardupilotParamPaths | ||
| let folder = "Copter" | ||
| let folder = 'Copter' |
There was a problem hiding this comment.
Was there a reason for this change (and the others like it)?
We generally avoid cleaning up code that we aren't already touching for other reasons, outside of occasional dedicated cleanup commits.
There was a problem hiding this comment.
Ah, yes might have missed those, i had been doing some other unrelated changes on this branch. and then once i made the split, some of those changes might have slipped through.
i can revert those if that is prefered, so we keep the changes to a minimum.
As for the Mavlink Server. i will switch this implementation to the API later today.
There was a problem hiding this comment.
i looked into the MAVLink Server API and tested it.
The API receives the complete Metadata file, but then discards it when TerminateSession returns an EOF NAK. So there might be some cleaup handilng error going on here, unless i am missing something.
so should i make another Pull request over there for this specific issue?
There was a problem hiding this comment.
The API receives the complete Metadata file, but then discards it when TerminateSession returns an EOF NAK. So there might be some cleaup handilng error going on here, unless i am missing something.
@patrickelectric thoughts on this^?
i can revert those if that is prefered, so we keep the changes to a minimum.
Yes please. Minimal changes are easier to review, including after a PR has merged (e.g. when inspecting the commit history to investigate something that's gone wrong).
There was a problem hiding this comment.
Hi @JackSkellet can you describe exactly what you are doing for me to replicate your issue ? If you use the mavlink-server GUI, does it work ?

Summary
This adds support for consuming parameter metadata published by the connected flight controller instead of relying exclusively on BlueOS's bundled ArduPilot metadata files.
The implementation:
COMPONENT_METADATAadvertisements;t0.11.25to0.11.26, addingCOMPONENT_METADATAwhile preserving the 0.11 API.Why
BlueOS currently assumes that parameter names, descriptions, units, ranges and enum choices are fully described by a static metadata file bundled with the frontend. That does not work well for custom firmware or for parameter choices that depend on devices discovered at runtime.
This enables use cases such as:
EK3_SRC1,EK3_SRC2andEK3_SRC3;The live metadata overlay has exact-name priority and also supports parameter templates. Invalid documents fail closed and do not replace the last valid snapshot.
Parameter import reliability
The parameter loader is also made tolerant of parameter files from another firmware version or feature set:
PARAM_SETuses the live parameter's MAVLink type;This allows a useful subset of a parameter file to be applied without leaving the loader permanently failed because optional parameters are unavailable.
mavlink2rest compatibility
COMPONENT_METADATAis not available through the previously pinned mavlink2rest release. Version0.11.26adds it through rust-mavlink0.10.13while preserving the existing 0.11 JSON API.Validation
0.11.26artifacts resolved for x86_64, ARMv7 and AArch64.