-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
UI broken when editing multiple non-default component params #7049
Comments
Thanks for the detailed report |
Now the UI updates as expected, but for some reason, some components parameters are displayed correctly, but for others, all the parameter values show up as zero. See the two pics below; cID 240 and cID 38 are two instances of the same code running on a companion computer. 38 has two additional parameters defined (at runtime), but they are otherwise same, and its parameters are definitely not all zero. The param messages are presumably getting to QGC, since it populates the list, but then something weird seems to happen. |
I can capture some of the QGC log messages if you tell me which would be helpful; turning on all the ones related to "parameter manager" creates about a million pages of text which you probably don't want. |
Is it just the parameter editor list display that is wrong. Can you click on one to open the editor dialog? That will show the value for the parameter. If that is 0 as well, then there is some sort of protocol problem. |
The affected values also appear as zero in the editor dialog. |
Can you capture a ParameterManagerLog and attach. |
Attached, but a cursory search doesn't show anything related to any component other than cID 1? This was captured by first connecting with the logging disabled, enabling it, then refreshing the parameters, to minimise the amount of unrelated stuff in the log. |
Wow, some really strange things going on with parameter download. Can you also turn on ParameterManagerVerbose1Log |
It looks like component ids = -1 are getting through the system somehow. |
No there is a bug in the logging. Let me fix that, and then log again with the next build. |
Assuming this makes it in, I will test against the next daily build. |
Here you go; with ParameterManagerVerbose1Log. |
If you look in the log you can see that for example the majority of the AIRSIDE_PORT values are coming across as 0. The log should you the raw values from the mavlink message. So not a QGC side problem. |
The values are definitely not being sent as zeroes, because my software receives and decodes as expected; it must be some kind of protocol incompatibility between QGC and my software. I suspect something to do with casting the value to the right type? Hmm, but no idea why one of the instances works when the others don't since they should be the same binary. I'll investigate on my end. |
Param values are stored in a struct based on type: mavlink_param_union_t |
I've learned something new: Ardupilot has a different interpretation of the parameter protocol (as referenced in On the system I'm testing against, while the flight controller is Ardupilot, all my companion computer modules should implement the parameter protocol per the original spec. So I'm guessing the issue is that, for whatever reason, cID38 (which doesn't work) is being treated as an 'Ardupilot-like' device, while cID240 (which does work) is being treated as a 'PX4-like' device. |
That's shouldn't be the case. A FirmwarePlugin is associated with a Vehicle. All mavlink traffic should be routing through that single vehicle to the same FirmwarePlugin for futzing with on ArduPilot vehicles. |
You need to match the ArduPilot parameter spec in your companion code as well. |
Is there some way I can efficiently obtain the raw messages which the parameter manager is decoding? Because as far as I can tell, what I'm sending over the wire is identical except for cID, yet one component works and the other doesn't. |
Telemetry logs have the raw data in them. |
The main and obvious difference is that ardupilot stores and transmits ALL parameters as floats, and that if you're using pymavlink I'm not sure it properly encodes other types. @auturgy might have more useful information about the differences. Probably not helpful for this case ... |
@DonLakeFlyer - Yep, I was just hoping there might be some secret way of just getting the param messages in question, rather than trawling thought the telemetry log file! So basically: This message works: And this one doesn't: Can anyone tell me why? I feel like I'm going insane. @hamishwillee - I'm talking to some of the AP devs about it currently. |
I’ll ping @peterbarker to make it easier for him to find this. |
Great. Just FMI, the component id in the first case is f0 (UDP bridge) and the second is Hex 25 - what sort of component is that? |
I guess. But who knows what other ArduPilot bits expose themselves as another component and do params they same way main component does. Cameras? The rPi wifi APSync stuff? If not, then it could be spec'ed to say other components always follow spec. But I'm not sure if that is currently the case. |
@hamishwillee Can you discuss in the next mavlink dev meeting? If it works I would propose specifically saying only MAV_COMP_ID_AUTOPILOT1 has special handling and everything else follows spec. Then it's an easy change in QGC to deal with that. |
Re the MAV_COMP_ID_USER thing: I swear at some point in the past, common.xml actually had comments which denoted parts of the comp ID range as being reserved for vendor specific messages (I think maybe there was more like two ranges, each denoted as reserved for distinct purposes). But that seems to be gone now? If there are multiple devices out there with the other behaviour, seems like a pretty fundamental issue that needs to be addressed, since it breaks the concept of MAVLink compatibility pretty badly? |
Welcome to the world of QGroundControl... |
Absolutely disagree. Please get an ID for components you plan to use because whatever gap you use may well be filled at some point. The component id is used for routing and filtering; so even if nothing is broken by this misuse, it is still likely that messages will be pushed around the network that don't need to be. I have not seen "MAV_COMP_ID_USER " |
@hamishwillee It would be unreasonable for common.xml to include component definitions for things which have no meaning to most other users: "UDP loopback bridge to mysterious bit of proprietary software 12". Per my comment to @DonLakeFlyer, I am sure there used to be ranges reserved for vendor definitions, what happened to those? In my case, all my MAVLink components send heartbeat messages as required by the spec, so routing and filtering works just fine. |
@edwinhayes Yes, but when component X uses that ID, they're going to get all your messages forwarded even if their at the end of a separate interface, even if they can't do anything about them. I don't know about user components. I have a sneaking feeling I've seen them though. Not sure. Have to think about whether they are a good idea. Probably OK as long as there are rules for how they are treated/not treated. |
Forward, but don't touch. |
@hamishwillee True, but that's my problem: as an aircraft manufacturer, I can control the presence of other MAVLink devices. If some new device appears in the common message set which uses an ID I'm already using, it's up to me to rearrange my allocations, or my products stop working properly. However, the presence of defined ranges for vendor definitions does make this easier. |
That is planned for 3.5 weeks. We're skipping one because no one wants to have meetings on Xmas or Xmas eve. Can you wait? I think I need more context in order to represent your "case"/what you expect. If something isn't implementing the standard protocol(s) I would have though that would be based on the autopilot in use, as inferred from its heartbeat and via sysid to associated components. So I don't understand what special handling should be allowed on MAV_COMP_ID_AUTOPILOT1. And I'd be leaning towards @edwinhayes view that the trigger for managing behaviour for the parameter should not be component id for UDP bridge. |
ArduPilot and PX4 send PARAM_VALUE mavlink messages in a different format. |
@DonLakeFlyer Yes, but don't they both use MAV_COMP_ID_AUTOPILOT1? Oh, I see, you're saying that you only want to allow modifications to the spec for messages that originate from an autopilot - not from a (say) Camera or UDP bridge? Does that mean that a UDP bridge would need to do something special if passing info to QGC from ArduPilot (say) |
A ground station needs to know that and handle accordingly. Whereas what to do with component != MAV_COMP_ID_AUTOPILOT1 is unclear. Two options:
QGC Currently does 1 except for the UDP_BRIDGE component where it does 2. Which is a bit strange. |
Well, to be a bit cheeky, you couldn't control the use of QGC on your network. But hopefully to be less annoying, if you think user ranges will help (and I can see they might) then let's allocate a few items for this purpose and discuss in a PR in the mavlink/mavlink repo. How many IDs do you think you might reasonably need? No guarantees they will get through, but that is the right channel for getting this change. |
Yes. Firmware differences are identified from MAV_AUTOPILOT. |
The point of user ranges is to not conflict with known device types which may have special handling (like UDP_BRIDGE). The only possible thing on user range component is support for the parameter protocol. |
@DonLakeFlyer So you think that if we resolve this issue we won't need user ranges? |
I think both need to be resolved. There should be a user range for components ids and the parameter protocol handling for != MAV_COMP_ID_AUTOPILOT1 needs to be resolved. |
For now I'll change QGC to not translate PARAM_VALUE message for anything other than MAV_COMP_ID_AUTOPILOT1, which is the most likely solution. And then it can be tweaked as needed when the final thing is decided. That will get Edwin working and then we'll see who else complains that we just broke them! |
@DonLakeFlyer Sounds like a pragmatic solution. @edwinhayes Can you please create PR for the user range in mavlink/mavlink so we can have right forum to discuss it. Don, thanks, #7049 (comment) is the clarification I needed. |
Yup |
Really, I would like the APM vs PX4 param thing solved somehow; it erodes the whole attraction of 'MAVLink compatibility': will talk to @tridge and @peterbarker about it. @hamishwillee Sure, I can probably do something tomorrow. @DonLakeFlyer Thanks, that would be great. |
OK, so this will be in the next Dev Meeting agenda 20190102 The most relevant bit is where I suggest the text:
I could not agree more/please do. Along with Mission protocol it is the most damaging incompatibility between the two stacks for MAVLink. I know that ArduPilot need to evolve the parameter protocol for their needs. This should be done collaboratively with PX4 to represent the next (common) iteration of the protocol. I'm hoping @auturgy will be able to help make that happen.
Thanks very much. |
I would not say that. Anything new should follow spec. The fact that ArduPilot does not is just history which I don't know the background of. I would just mention how ArduPilot works and the fact that anything moving forward should not work that way. |
You misunderstand. I'm trying to say that this is how GCS should support spec evolution (spec deviations are a fact, but not something that can ever be "supported"). Even though this doesn't cover the deviation case per-se, it allows me to make it clear that a GCS only needs to support variation for MAV_COMP_ID_AUTOPILOT1. Even so, this is challenging because:
How about:
I'm also trying to capture what ArduPilot does different for params in mavlink/mavlink-devguide#140 - what else should I say? |
Perhaps this isn't MAVLink scope? It is something that should be send in the QGC dev guide. |
Just confirmed that #7094 has fixed the issue which this issue originally described: I now have correct behaviour for both flight controller parameters (with their special ArduPilot treatment) and other component parameters (per the spec). I will chase up the ongoing aspects (incompatibility between stacks etc) separately. |
Expected Behaviour
When connected to a system comprised of multiple MAVLink components, the advanced parameter view should display a list of component IDs on the LHS (underneath the category groups for the default component). Clicking on each component ID in turn should populate the table on the RHS with the parameters for that component.
Current Behaviour
Clicking on the first non-default component shows the table of its parameters as expected. Clicking on another non-default component does not change the table to show the parameters for the new component, the table appears not to update, so continues to show parameters for the first non-default component.
Clicking on one of the categories for the default component still has the expected behaviour, after which you can then click on another non-default component as expected. So it's possible to view the parameters for many components by alternating between viewing parameters for the default component, and one of the non-default components.
Steps to Reproduce:
Please provide an unambiguous set of steps to reproduce the current behavior
System Information
When posting bug reports, include the following information
Detailed Description
Log Files and Screenshots
I will capture screenshots to explain this better when back in the office on Monday.
The text was updated successfully, but these errors were encountered: