-
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
Common - Opaque IDs for detecting plan changes #2012
Conversation
Thanks for the proposal @hamishwillee. |
Thanks @KonradRudin
Thinking about this, the bigger issue about a counter is that it can reset, and possibly should if the mission is removed. That would mean that you'll far more often see a lower number than a high number and potentially have more chance of clashes. I will add a note that if the mission is remove the associated id should be zero or max value. Let's see what @peterbarker thinks about 8 extra bytes. If you're on an old 3DR radio, that might be a problem. |
|
@peterbarker @KonradRudin I have done minor update to description for readability (no semantic changes). As discussed with both of you this reflects the original proposal above where:
Need an implementation and validation this is OK before this can be merged, as it affects common.xml. Do you guys have a plan/timeline for release so we can plan getting this in? |
On Tue, 4 Jul 2023, Hamish Willee wrote:
Do you guys have a plan/timeline for release so we can plan getting this in?
Sorry, this one is currently on an "as time permits" regime. My PR is
failing all sorts of autotests right now, so there's still things to be
sorted through.
|
Thanks @peterbarker . Maybe @KonradRudin can get a testable version in faster :-) |
I will have time in the next few weeks to update and test on the PX4 side. |
Thank you. I assume you can fake the required mavlink, as though this had merged. |
@KonradRudin How's the work on this going? |
Hey @hamishwillee |
Thanks @KonradRudin - when you have a QGC PR can you please point me to it. It would be good for @peterbarker to test his changes at the same time so that we know we have two compatible implementations. |
Hey @hamishwillee we started to work on the implementation for the opaque ID again. We now have a working setup including PX4 and a groundstation. However, it is only for our own QGC version currently so sadly not shareable atm. At least you could check it out. How do we want to proceed? |
Hi Konrad, just back from flying so a bit Jetlagged. I guess logging or testing that it works as advertised? @julianoes is this something MAVSDK might be interested in providing user access to? @auturgy Any thoughts? |
@peterbarker do you have an update? |
@KonradRudin When will this version of AMC be published? (AMC is closed source, but that doesn't mean it can't be used to observe the behaviours of interest). When do you plan to un-draft the PR and get it reviewed? Is there any testing done and if so, how? Our interest is not in merging stuff until we're sure that it will appear in flight stacks and is really common. Until your PR has seen some constructive criticism we can't proceed. @auturgy Thanks for your point, I hadn't really looked at the PR - was more after "what is minimal testing do we need evidence of". The ArduPilot PR appears to be stuck - @peterbarker is keeping it updated but no obvious moves to merge ArduPilot/ardupilot#20834 |
Sure, if someone wants to sponsor me, it'll happen sooner rather than later. |
@hamishwillee well i can't really get it out of the draft status as long as i need to point on a special branch on mavlink for it to work. But i can get it reviewed. But the order must be that this gets merged first before it can be merged in PX4. |
@hamishwillee so i discussed the issue and we can provide the binary file for our qgc. AS far as testing goes, apart form unit testing we did an integration test by connecting multiple GCS instances to PX4 in SITL mode and changed the mission on one GCS, then the other GCS automatically updates the mission and geofence as well. |
Of course! Ping me when you have enough of a review where someone with merge rights says they would be willing to press the merge button if this was not dependent on the wrong branch and we can move forward. Then let's see about the binary. |
I still think a mission checksum would have been better, but this is close enough for what I wanted to address in PX4. |
@hamishwillee I can share the link to google drive for the binary of our groundstation implementation. This can be tested then with the PX4 PR f you need more confidence. |
@KonradRudin Great. @auturgy has requested access to look at this. After that, If you feel this has been tested enough I think after that we can merge because:
@dagar That wasn't going to work for ArduPilot, where the stored on-vehicle and off vehicle mission are different. There is nothing to stop PX4 using an opaque ID that is a checksum but MAVLink can't mandate that. But FWIW I would have much preferred that too. @KonradRudin If we haven't heard from @auturgy by Tuesday next week and you feel due diligence has been done, please ping me so I can chase this up. My intent is for this to merge next week. |
Hey @hamishwillee can we merge now? So far i had one request for access which i granted for our GCS for testing. |
@KonradRudin Yes. Thanks for your patience. |
This PR proposes a mechanism (for discussion) for determining whether part of an on-vehicle plan type (mission, fence, rally points) have changed, so that a GCS can upload the changed plan, or more importantly choose not to upload a plan that it already has.
This replaces the
MISSION_CHECKSUM
which is being removed in #2010.Overview
Plan upload/download can consume quite a lot of bandwidth, especially for large missions.
Currently ground stations upload the vehicle plan every time they connect, even if they already have a matching plan. Further, if a second ground station or companion updates the plan on a vehicle, there is no reliable way for other ground stations to know that they have to update.
The ideal solution for this problem is for vehicles and ground stations to have a common way of calculating a representation of the plan (such as a checksum) and for the vehicle to publish its current representation. That way the ground station could always know if it has the current plan. Unfortunately the shared-representation approach is flawed because the vehicle will commonly not store a precise match to the GCS version - parameters that are invalid on the vehicle might not be stored, and other values might be stored as some kind of rounded value.
We're therefore limited to solutions where the ID representing a mission must be shared between a vehicle and GCS on upload and then published for all other vehicles. This allows a GCS that has uploaded a mission to know that it does not have to re-update, and for other GCS to know that they do.
This proposal does not require it to be a globally unique UUID, though that might be handy for systems that want to manage missions.
In theory this ID could just iterate for more than the likely number of missions uploaded between vehicle reboots (or several reboots?). It might be a checksum or UUID.
The id might be set by the Vehicle or a GCS. This PR currently defines a proposal for the first case, but both options are discussed here.
Vehicle supplies ID on upload (see PR)
Proposed solution :
opaque_id
to the GCS in the finalMISSION_ACK
(the value is set to 0 on download to GCS). This is the current id for the particular plan type.MISSON_CURRENT
MISSION_COUNT
. Note that a round-tripped downloaded mission might not look the same as the original mission that was uploaded from a GCS, but it has the same on-vehicle characteristic.With this
Open questions/concerns
Should we just suggest the opaque ids iterate?
Do we need separate ids for each plan part?
Is uint32 the right size?
GCS supplies ID on upload.
An alternative is that
With this
The main difference between the two approaches is that for the GCS you probably have to have a bigger ID because you can't reliably iterate (I don't think). The benefit is that the MISSION_COUNT changes are simpler, and occur early in the mission upload/download - so systems that for some reason don't get the ACK will still get the value.