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.
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.