-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Component information protocol - move into standard #1806
base: master
Are you sure you want to change the base?
Conversation
Makes sense. |
Thanks @bkueng . Updated to reflect your confirmations. Yes, lets discuss translation in #1656 (comment) |
Questions for James to ensure are answered in docs:
|
How would this deal with dynamic parameter creation (ie https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Scripting/examples/orbit_follow.lua)? |
@bkueng We discussed stability and fitness for purpose of this in the dev call. There was some concern around assumptions made that everything in general metadata was static, and whether it should be. A few points for discussion below. Note, @julianoes I asked you to do this, but taking a shot myself. Can you sanity check I did not miss anything? TranslationsTranslations are defined in the general metadata and therefore the theory is that they can be statically built at runtime. This prevents the translations being extended and improved after release - an unreasonable restriction. I am not sure about the solution, but here are some kind of "requirements":
I don't know how others handle this. My thinking is perhaps we:
Is parameter metadata really staticIs the assumption that parameter metadata can be all be known at compile time actually true? We discussed that while some parameters may not exist at compile time, as they are enabled at runtime by the values of other parameters. Don't think that matters - a GCS that has all the metadata can apply it as needed when the parameters become visible. I presume that was the intent (we should make clear in docs)? What about dynamically added parameters? For example ArduPilot allows a script like https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Scripting/examples/orbit_follow.lua to add a parameter at runtime. It would be good if we could provide a way to allow the metadata to be updated by the vehicle using the component information message. If this is not possible we need to explicitly preclude it. SuggestionsIt could be that you already have answers to all this, but just my two bits:
|
Re parameters
Yes that's how it's implemented.
I see several options for this:
Generally I want to make sure we reduce dynamic updates as much as possible, because:
|
@auturgy (As we surmised in the dev call) Beat confirmed that the expectation is that the GCS is provided with all metadata for all parameters known at compile time, whether or not they are enabled at a particular time. So the intent is that the GCS will only display metadata for active parameters. I assume that is what things like Mission Planner and QGC currently do via whatever mechanism they are currently supply metadata. |
@bkueng Your response
is the same answer we had for lua-based actuator metadata. We don't require that the files are compile-time generated - just that they are fixed after boot. In other words we don't preclude using metadata for Lua but nor do we explicitly support it, and we don't support plugin/plugout after boot. In principle I'm OK with the same answer here "for Lua". IMO it would be stupid to block huge benefit of this approach for parameter metadata delivery because it doesn't support Lua parameter metadata, especially I don't think Lua has a way to even set such metadata internally yet. But in practice I don't fully believe it will work for all cases. In particular, this forces you to have the parameter metadata on the vehicle and not on a server somewhere. So adding your own parameters on top of that would be hard. Further, we keep on running into cases where some level of dynamic behaviour would help. So I'd like us to think through whether this could realistically be done with the dynamic updates, and whether there is anything else we might do to improve that proposal to help with cases like this. And because we're trying to get this approved, I'd like to do it now before we freeze the interface. The fundamental flaw in our current dynamic design is that it is all or nothing. If someone adds a Lua script with 4 new parameters, we have to regenerate the 1000 static ones as well, and compression is "hard". Ditto for a new smart battery. It seems silly to regenerate the whole parameters file we already compressed for a small addition. What might be better is if we could specify two files for metadata - one fixed and one dynamic. Thoughts? |
It would all get a bit simpler - in my opinion - if we had a flat list of things that can be queried, some might be static, others might be dynamic. Having the overall file that pulls them all together in yet another file makes it harder indeed, I also realized that while I was doing the implementation. It becomes quite complicated with multiple steps, some of them involving caching which I did not even bother about yet (see MAVSDK source). Wouldn't it be simpler if an autopilot could just send out a COMPONENT_INFORMATION(_UPDATE) with a URL and CRC announcing one file with one type at a time, static or dynamic. This could be the static list, peripherals, lua additions, whatever. And for the metadata that we have in general, I would use COMPONENT_INFORMATION_BASICS instead. I think no one can be bothered to implement MAVLink FTP just to send the version and vendor name. |
@julianoes I went around a few loops with @bkueng on this over the week. This is more or less what I proposed at one point. Several options discussed below, including this one. Let's discuss in the dev call and agree the costs and benefits of each approach. Proposed change to original designThese changes to the original design that address the issues we had with translation files, files that must be built at runtime, dynamic updates, in a compatible way. In summary it removes dynamic CRCs from the metadata and provides a more efficient and tunable mechanism for change notification. Everything can be done in the same way, but it is more consistent and scalable if you need that functionality. Detail:
So in summary, for a purely static system nothing changes
For a dynamic system you read the general metadata and you wait for a matching The update will be streamed at an appropriate rate for the data and use case. So for example you could treat the lua parameter update case as a single runtime update on boot, and emit that at incredibly low rate. Or you could emit it regularly and literally plug and play lua scripts.
Julian/separated approachThis is kind of what I was thinking as discussed with Beat, merged with Julian's points:
Pros and consTo be very clear, both approaches will work and are actually not dissimilar except in the mechanism used to discover the supported metadata types. I "think" the main benefit of @bkueng approach is that it could be done without a break. If you were willing to break the message then I'm not sure which would be better. TLDR; Beat's approach queries just one metadata file, and from that gets all the information about all other metadata files used by the system. Julian's approach gets the metadata file details in multiple messages (which is slightly less reliable). If you accept that we have to do something like My "intuitive preference" is for a design like Julian's - but this is mostly because it is a familiar pattern. That said, I can't think of great reasons why you need to be able to make the message more granular. Perhaps:
|
To address the reliability I would add an I understand this would cause churn in QGC but I'd argue it's worth it to clean it up. |
@julianoes I agree the message is ugly, but then we don't have to manage the churn. Saying that, if I was @bkueng I'd rename it to Either way, we'd still need to agree the form of the messages - both ways work. Good discussion for the dev call. I've asked @bkueng if he can attend, but he might not get the message. |
Discussed in 20220317-Dev-Meeting. Summary:
New round of prototyping, then we should be able to get this in. |
Given a couple of people I have talked to in the past that "just wanted to share a version and not bother with FTP" I would suggest we leave the BASICS message. Otherwise it makes the hurdle to create a MAVSDK component unnecessary high which hinders adoption. |
Thanks @julianoes - makes sense. And I think we can leave it in the general metadata too, since a GCS is happy to get all the data in one go |
This PR is being used to scope precisely what of the Component Information Protocol is stable and can move into the standard.
In this case stable means:
The things that are stable:
COMPONENT_INFORMATION
The following types/schema are not stable, and have had wip added:
COMP_METADATA_TYPE_COMMAND
COMP_METADATA_TYPE_ACTUATORS
COMP_METADATA_TYPE_EVENTS
Non blocking but relevant:
Outside scope of this discussion:
COMPONENT_INFORMATION_BASIC
(a separate service/API which is not part of metadata)