-
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
Could we have some kind of sub-protocol to handle multi-GCS configurations in a graceful manner? #2098
Comments
Thanks @Davidsastresas This has come up before, both for multi GCS control of components (e.g. separate flight and gimbal control) and also for multi GCS observers. There is a (closed) proposal here #1954 (discussion rambled off-topic but the core bits may be useful). I can't remember the detail, but I think it was conceptually similar. It was closed by the author and I don't remember why. I think it is a reasonable use case - if you need it and want to provide an implementation then very happy to discuss/take this further. |
Thank you @hamishwillee, very interesting. I read that proposal. There were some very interesting topics in that discussion. I think I miss the point at the ending, as you guys reference something you discussed in the dev call, and I have no details about it. From what I understood from that thread, the way they presented it on its totality would mean a bunch of other changes in the mavlink protocol in general. This is not necessarily bad of course, some very valid points were mentioned there, and they seemed to have spent a bunch of time studying the situation. But maybe it is overkill to discuss about such substantial changes it if we can have something working with the current version of mavlink, without messing with system id adquisition protocol and some other topics raised on that thread. I wasn't aware of the current CHANGE_OPERATOR_CONTROL messages. It is cool, but I would add a broadcast message, like: MSG CONTROL_STATUS: Message broadcasted by the vehicle, by the "owner" of a system ID corresponding to a vehicle ( A payload should not broadcast it ). It could be a very low rate as long as the system sends it right away after changed. I can think of the following field:
I like the fact that CHANGE_OPERATOR_CONTROL and CHANGE_OPERATOR_CONTROL_ACK are standalone messages and not MAV_CMD based. Because this would allow an interesting scenario:
So, with the adition of that CONTROL_STATUS message I would be happy. However, I think it is worth discussing some "guidelines" or actual specifications of a first iteration of a "operator control microservice". For instance, these are some topics that come to my mind would be worth discussing, and trying to reach a consensus:
Now, not strictly related with the scope of this discussion, but kind of related too:The issue mentioned in #1954 about several GCS having the same sysid is a problem indeed. Of course it is not a mavlink protocol issue, as if the architecture of the system has the system id on all the nodes correctly set this would not even be a problem. But I think we can all agree this is a very likely situation to happen eventually. So, I would like to also establish some guidelines about this, something for GCS to implement to try to prevent or fix ASAP when they detect there is another GCS in the system with same sys id. I think the straightforward approach would be to evaluate this when any mavlink traffic is received. If a GCS connects to a vehicle, and through the network of that vehicle it sees another GCS heartbeat with same sys id, it changes its sysid. Maybe it can prompt the user with a dialog explaining the issue, and auto suggest a new system id, and maybe stop sending momentarily heartbeat to that vehicle, until the situation is resolved. This would be possible with the current protocol right? Of course it would not be extremely robust and "idiotproof", but as discussed in #1954 if we keep adding layers and layers of robustness we will end up re-inventing the wheel. But for the moment, I think it is worth at least establishing some guidelines about this and document them. I think we don't need much or any change in the protocol for this particular matter, and I think it would be good to have something very basic about the matter, so new projects facing this need could at least have a base to work over, or we could all have a base from where we can possibly start discussing building a more sophisticated new mavlink version in the future, possibly considering this discussion on the improvements. Thanks! |
@Davidsastresas Grep of PX4 and ArduPilot are not showing an implementation of CHANGE_OPERATOR_CONTROL. I think we
The problem of duplicate ID allocation is hard to detect - it is possible for commands to loop back through different channels in a network, so to know that the message you just got that has your ID was not sent by you, you'd have to remember that you didn't sent it. Lots of work that shouldn't be needed. I'd prefer a setup where all system ids were allocated from a server. FYI the RAS-A variant of mavlink, which only lives on IP networks, uses the IP address instead of a system ID for addressing. This can be allocated like any other IP address. Which is all very cool provided you only want to run on IP networks. I've added to the MAVlink call agenda to see what others think. |
One use case for a clear MAVLink operator notion to me is the MANUAL_CONTROL message. With this one, I can see conflicts between ground stations both sending it. |
So the summary of mav call is that:
|
Sorry I missed the call, I read your message too late. About your points, it looks great to me, I think it is a great summary of the scope of this, and I would be totally happy with such changes. I will try to catch the attention of Ardupilot for them to join. Thanks! |
Thanks. Would appreciate if you and @julianoes could keep me posted. |
I will keep you posted. I recently talked with @rmackay9 for AP dev team to be aware of this. Thanks! |
Hi, yes, it seems like a good idea and I agree that the message or command could be much like the MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE command. I think I also prefer a command over a new message although I don't feel really strongly about it. I also agree with the idea that it's not meant to be a super strict security feature. In AP we already check that the MYGCS_SYSID parameter matches the message/command trying to control the vehicle via RC_OVERRIDE, MANUAL_OVERRIDE (I think) and mavlink commands so I suspect extending this would not be too hard (but who knows for sure). Anyway, we've had requests from users over the years about multi-gcs control so there is interest out there and AP would be happy to implement this. |
Ah, I forgot to mention that I think we should separate out the issue of multiple GCSs using the same sysid. That's a misconfiguration so in the short-term at least we could "handle it through documentation" as we say. |
Absolutely.
Great. Let's see what the final design looks like. |
And try to add some sort of warnings to make the user aware of potential conflicts, if possible. |
Great, so we are all on the same page for preparing a draft PR based on this discussion? The summary would be: - MSG CONTROL_STATUS: Message broadcasted by the vehicle, by the "owner" of a system ID corresponding to a vehicle ( A payload should not broadcast it ). It could be a very low rate as long as the system sends it right away after changed. It would have the following fields:
- CHANGE_OPERATOR_CONTROL/ACK: Do we preserve these? or we use CMD instead? What about the passkey, we preserve it right? I personally like it, could be a parameter living in the autopilot or similar.Thanks! |
That sounds reasonable. Do we need sysid+compid in control or sysid only? 🤔 I would probably suggest to use a proper command instead of having this bespoke message+ack combo. |
It depends on what the final proposal looks like - I've lost track. I think the proposal is something like:
If something can be owned, then you know its owner from the message, but you also know its source system and component ID from the message by default. So you can target to the message to that sys/comp id combo, and you should. However I'm not sure what you do if you allow multiple components to be owned? Sure, two components with owners can emit the message, and you can change their owners, but it won't be clear to other components of the system how they determine their owner. But without the flow and use cases, not able to comment helpfully. EDIT - I think this actually a case which might benefit from using the RFC process template to ensure that the options are explored. |
@hamishwillee, your points make sense to me, but as you say, some of the points are not clear. My take on them is as follows, adding in bold my thoughts:
I am happy to start preparing some diagrams and charts to keep the discussion, I am learning how they have been done for mavlink docs in mermaid ( very cool by the way! ) but I wanted to iterate just a couple of messages more to understand better if we are all on the same page on the base of it. Overall, my thought is to keep it as simple as possible. If this works nicely it will certainly evolve. I think the key is to have something that works and covers the basic needs of multi GCS operations, so people start using it. If people start using it on real scenarios we could have real feedback on what else is needed, and extend the implementation. Although I am pretty new to engineering new mavlink features, so maybe my approach is not good and it is better to think more in the future and spend more time if needed in cover extra scenarios, be more "futureproof". I am of course open to your opinions on this front! About Ardupilot, indeed, they have SYSID_MYGCS parameter, and it serves the purpose just fine, with that parameter and mav_cmd_user sent between GCS on the system we could really do this. In fact that is how this all started, planning multi GCS support for Ardupilot based on that parameter and custom commands. I brought the matter here because it would be cool if this isn't something that depends on an Ardupilot specific parameter and it is rather a protocol standard. I really think it is a feature worth having, multi GCS systems are not that strange nowadays. |
@Davidsastresas Thanks very much. All of that sounds good, so happy for you to progress with diagrams, messages etc. Here are some "thoughts" from reading this:
Not entirely sure about last option because a requestor has to wait for a pretty open ended time to know whether they are going to get ownership - there is no refusal notification or "i'll get back to you". But on the plus side, at least the GCS has right of refusal. I'm not sure how important that is as a use case though - you might argue that in a trusted network the parties should be talking before taking control. So I lean towards "4".
Anyway, looking forward to seeing what suggestions you have/compromises you think we should make. FYI @julianoes |
Thanks @hamishwillee. I agree with your points, and I agree we should forget for the moment on more "complex" ownership like companion computers. In the end of the day they can control the autopilot using mavlink commands ( guided mode in Ardupilot, I am not sure in Px4 but I think the concept works similarly ) so I also think we can consider autopilot-companion a single logic block. I just have one question. Why do you say that we could not do that for Ardupilot? In any case, I think we have discussed enough to start preparing those diagrams, and start shaping this. I will work on it on the next few days. Thank you! |
@Davidsastresas AFAIK Ardupilot does not currently support the long running commands. I'm not 100% convinced of them myself, though I think the use case is valid. |
I have seen this situation recursively. Multi GCS configurations where the "request control" functionality is needed.
Right now, if the autopilot supports it by a parameter or similar, like Ardupilot does, we can do workarounds playing with GCS-GCS custom mavlink messaging. But we don't have any mavlink standard for this, and I think we could have, it is a nice feature.
I am thinking about something like:
All the above is inspired by how we work with it on gimbal protocol v2 and GIMBAL_MANAGER_STATUS.
Would something like this be valuable? I would like to hear your thoughts @hamishwillee @julianoes
The text was updated successfully, but these errors were encountered: