development.xml: copy MAV_COMMAND_REQUEST_OPERATOR_CONTROL from mavlink/mavlink/master#503
Conversation
…nk/mavlink/master
|
@lthall this was the spit-balling stuff I was working on: peterbarker@18003cf |
|
I'd like to submit another user story, for BVLOS operations. There are 2 GCSs, the operator of the first is on Landing Site A, there is another operator at LSB. LSA and LSB are far from each other. Each operator has overview of only his own LS, hence he's the only one responsible for operations around that LS. LSA is initially in control of the vehicle. Takes off plans a route to LSB. At some mid-way point he transfers command to the LSB operator. Then it's exclusively up to the LSB operator to handle the operation. Take-over can still be requested and granted at any point of the operation. |
@Georacer That is the exact use case @hamishwillee and I had on mind when we started working on this almost 2 years ago. I don't think companion computers should be on this protocol, they should have the same system ID of the vehicle, so messages accepted/rejected by vehicle due to this protocol should propagate naturally to the CC. Very happy to see this moving forward. By the way, support for QGC was already added some time ago, more info in mavlink/qgroundcontrol#12410 |
A CC is not an operator, and attempting to consider it one makes the problem unsolvable. For a start, who's really in charge? The proposal deals with everything else in the list. There is only ever one thing in charge or nothing in charge, and handover is either automatic or requires permissions. The thing in charge is the only external system that the autopilot and other components will accept state changing commands or messages from - where it is up to each component to decide the set of things it considers risky to object form any other system. The second proposal we made allows multiple things in charge but only one thing that can send movement controls. |
@hamishwillee did this 2nd proposal become part (and got merged) in the upstream mavlink PR? Do you want to try to add support for it in ArduPilot starting from this PR here? |
Yes, it merged mavlink#2313. The updates allows support for both models, with slightly different behaviour in each mode.
@Davidsastresas Is planning on working on this once there is more clear direction from ArduPilot on whether it is acceptable. @peterbarker Has clients doing similar things. I am sure they would both like to coordinate. What this is waiting on is deeper evaluation of the use cases and whether the proposal meets them. My understanding is that is what @peterbarker is trying to achieve with this PR. |
|
Hi! I'd like to add following user story. Educational/competition operations Organizers provide the drone platform while participants are allowed to run their own scripts on a companion computer connected via MAVLink. Participant scripts should be allowed to:
Participant scripts should not be allowed to:
Ideally this restriction could be applied per MAVLink link/node rather than globally. |
|
@TharakaUJ I am sorry but I think that use case is totally out of the scope of what we are discussing here, it is very niche and we are not planning on bringing companion computers to this, they use the same system ID of the vehicle and are considered "part of vehicle" from this protocol's point of view. I think such situation could probably be handled in a much better way in custom code in those companion computers used in the competition. |
|
@Davidsastresas I see, that makes sense. Thanks for the clarification and pointers! Out of curiosity though, if the competition participants connected as separate GCS/MAVLink nodes instead of applications running inside the companion computer, would that kind of use case fit better into the scope of this discussion? |
|
@TharakaUJ not really... Such a custom mavlink filtering as you describe in your first comment is really not in the scope of what we are discussing. I really think your use case is better suited for custom software in your CC. |
|
@Davidsastresas Got it, thank you for the clarification! |
|
I really like where this is going. From my perspective the proposal is ready for testing, there is only so much we can do with a theoretical discussion, we need to try it. |
I could not agree more. I think it is solid. The handover of control stuff has already been verified in the version 1 PR - its testable. Since that went in ArduPilot added support for multi-GCS in charge, and the protocol proposal was adjusted to compensate. These are the things that most need testing:
More generally there will always be discussions about what services should be restricted to the GCS in charge. We've worded it such that telemetry is available to all, but that commands and command-like messages should be reserved. Anything really that can change the flight state should be restricted. |
|
I think one of the key things coming out of this discussion is that we are still treating “control” as a single thing, when in practice there are several different classes of control with different requirements. At a high level I see:
I also don’t think configuration control can really be separated from flight control. Changing parameters, accepted input sources, failsafe behaviour, mode configuration, etc. can absolutely and materially alter aircraft behaviour. Operationally those are inseparable. The other important distinction is that some resources are naturally exclusive while others are naturally shared. For example:
are fundamentally exclusive resources. Multiple simultaneous writers create unstable arbitration and “fighting” between controllers. On the other hand:
are naturally shared. Then there are resources that are technically shareable but operationally conflict-prone:
FOLLOW_TARGET is a good example of why control should not be defined purely by message type. Multiple systems may be sending FOLLOW_TARGET messages at the same time. In ArduPilot, the selected target is determined by configuration, for example by setting FOLL_SYSID, and the aircraft only uses that source when the pilot/operator enters Follow mode. So the authority is not ownership of the FOLLOW_TARGET message stream itself. The authority is the ability to configure which source is accepted, and the ability to place the aircraft into a mode that consumes that source for motion control. That means the pilot/operator in command owns the chain of custody by:
I think this points toward a model that looks more like:
rather than a single global “vehicle owner”. The primary authority holder retains ultimate authority over the vehicle and may always reclaim complete control. If the primary authority holder disconnects, the system should not become uncontrollable simply because the preferred primary GCS is unavailable. A better model may be that the primary authority holder is preferred, but not required to be continuously connected. If the primary GCS link is lost, the current connected authorised GCS, or the next authorised GCS to connect, should be able to act as the primary authority holder until the original primary returns. This would be a temporary acting-primary role, not a permanent transfer of ownership. When the original primary reconnects, it should be able to reclaim primary authority, either automatically or through an explicit handback policy depending on the operation. That gives us:
Payload control is probably another area where we should avoid making the core authority model too detailed. There may be many payloads on a vehicle, and MAVLink should probably not try to define detailed ownership semantics for every possible payload type. A camera, gimbal, winch, release hook, sensor package, sprayer, or custom payload may all have different operational requirements. One practical approach is to treat payload control as a delegated capability group. Payload delegation could support two modes:
This keeps the model flexible without requiring detailed per-payload ownership in the core protocol. For higher-risk payloads, the primary authority holder may delegate payload control only to a specific controller. For lower-risk payloads, such as cameras or sensors, the system may allow any authorised external controller to use the payload functions. In both cases, the primary authority holder retains the ability to revoke payload authority, reclaim complete control, and reject further payload commands. So the model becomes:
To me this feels closer to how these systems are actually operated in practice. |
|
@lthall while I find your approach and vision ideal, I don't see how this can be served by the existing mavlink messages. The two new mavlink messages are https://mavlink.io/en/messages/development.html#CONTROL_STATUS and https://mavlink.io/en/messages/development.html#MAV_CMD_REQUEST_OPERATOR_CONTROL. I think this is the framework we have to work with in the context of this PR; and what it allows for is only a transfer of full-access control. Nothing in between. What you describe (again, I wish we can implement it somehow) isn't possible with those two messages. So the question is: Are we satisfied with what those two new messages offer us? Do we want to implement them? |
|
@Georacer Respectfully I disagree. Until a shared design is agreed by the MAVLink stakeholders and whatever messages we come up with moves into common.xml we should be open to all options. Once things are in common they are frozen, and it becomes hard to change them, so we need to make sure we address as many use cases as we can. That said, perfect is the enemy of good, and I'd prefer not to iterate for-never. @lthall Sounds ideal as long as:
Intuitively I think that such a model naturally supports both use cases above, and more. It might be overkill in terms of implementation though - i.e. the extra needs might not be worth the complexity. Do you have a MAVLink interface in mind? |
|
@hamishwillee I'm also open to modifying the protocol if needed, but only if there's real commitment from everyone involved to follow through. I don't mean to be rude, I'm genuinely happy to see this moving forward. But Hamish and I have been working on this for over a year, tagging several AP devs at each iteration and going through many rounds of revision with no objections raised. It's worth noting that the current protocol was designed with the assumption that operators maintain good direct communication — voice comms, coordinated procedures — and are well synchronized operationally. Security was intentionally left out of scope, as that belongs in a higher layer of abstraction, or to a next revision of this protocol. The protocol handles authority and handover, not trust or authentication. @lthall I think your vision of primary authority with delegated capabilities and resource-level ownership is the right long-term direction. But adding that layer of granularity now, realistically, means months of additional protocol design and coordinated implementation across MAVLink, ArduPilot, and GCS software. As @timtuxworth said, there's only so much we can do with theoretical discussion. We need to fly this. |
The problem with that approach is we put our selves in a position where we need a new message to support what I believe is the minimum viable product. I suspect that if a primary isn't set in my vision it could fall back to the system you outlined were basically who ever has control is the primary. I understand the frustration of not getting engagement from the community. That happens with limited bandwidth. I have been waiting for that critical mass interest level (and industry maturity) since #20373. |
|
@lthall What you proposed in ArduPilot/ardupilot#20373 is a nice initiative, but it's a draft. What we have here is finished work — protocol design merged upstream (mavlink#2158, mavlink#2313), GCS implementation done and tested (mavlink/qgroundcontrol#12410). You can see a video of it working with multiple QGC instances and SITL there. What frustrates me isn't community engagement. It's that we notified AP devs many times ( in public channels like discord dev channels or directly mentioning in github threads ) across every iteration, and nobody raised objections. In fact, the opposite, the feedback was positive from a lot of people. And now, with a working implementation ready, we're discussing a significantly expanded scope. But that's fine, I understand the situation evolved that way and I'm ready to move on. Let's all agree on a minimum viable product and move forward. |
I would not even describe this as "a nice initiative", it was an attempt to get engagement on an area I was aware was lacking for many years at that time. My point is I have been thinking about this and looking for the critical mass to form for years and I am very happy it is here. I also appreciate the work you have put in and I understand the frustration of having something working and so close to the finish line to then have a bunch of people, that have not been running with you, say they want you to do two more laps. I am sorry I was not exposed to your work earlier. |
For this use case I would suggest adding a proxy which the user's scripts must use which has a whitelist of commands and messages which are passed through from the student's scripts. I really think a fine-grained and relatively-easily-changed mechanism would be better there. Perhaps take ArduPilot's "output" mechanism and add filtering in there. We already support filtering commands coming in from "outputs" when the vehicle is armed, for example. |
@Davidsastresas @lthall @peterbarker @tridge We and I think many other have been waiting a lot for this, since even before David started to work on it. We were so happy when they did and following with keen interest. For our base use-case it would be very beneficial as is and would be so sad to have to wait several months for release just to take it to another level that Leo is looking for. Of course it is cool and the use case is sound, but I think there is a strong case in making that a V2 or Pro version, and not throttle the current one as it stands. That way we can all benefit from the current iteration and there will be no time pressure for the V2. Everybody wins. |
|
My use case, we have two drones (in the future we would like 3,4,5...), When we fly we currently have two laptops set up with a pilot monitoring each drone, but the second laptop has no control of the follow drone. The pilot with the starlink connection, needs to select the follow drone, then take control, which in an emergency isn't ideal. We would like each laptop to have control of each drone, without needing a Starlink on the second drone. This is probably possible currently, but I haven't got that far in development of follow mode yet. |
This is a PR to discuss implementation of multi-operator control.
This message has already been merged in mavlink/mavlink/master
There was a stab at implementing the message.
I'm not sure the messages are fit for purpose.
Key points:
SET_POSITION_TARGET_GLOBAL_INT)FOLLOW_TARGETRC_CHANNEL_OVERRIDES/MANUAL_CONTROLSome user stories