-
Notifications
You must be signed in to change notification settings - Fork 13.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
Implement mission checksum #18418
base: main
Are you sure you want to change the base?
Implement mission checksum #18418
Conversation
76d3720
to
5a8e576
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Just please check all dm_lock
and dm_unlock
, and consider using a union
instead of casting.
Generally looks good, but I was wondering why not have this in mavlink_mission? Then we could calculate the crc for a mission upon receipt, and the crc could be broadcast as part of ORB_ID(mission). https://github.com/PX4/PX4-Autopilot/blob/master/msg/mission.msg Then instead of a new MISSION_CHECKSUM stream it can simply be a method in mavlink_mission alongside mission_count.
Later I'd also like to make it a more integral part of verifying the mission in dataman before usage. |
e61b2e6
to
1652941
Compare
0b54b1c
to
056fb77
Compare
|
056fb77
to
48b6650
Compare
116abad
to
72f9c3b
Compare
Gave it a shot to refactor to @dagar 's comments. The checksums are now computed upon receiving from mavlink and combined when requesting checksum for all. That's all fine and pretty clean.
|
72f9c3b
to
4e85014
Compare
46f0132
to
151c1cb
Compare
What about using development.xml for all boards?
|
@julianoes I think that was how it used to be before the mavlink auto-generation, right? Added a commit for that |
We did not have the development.xml dialect before auto-generation, so not really. |
@dagar Can you take a look at this one when you have time? We are already using this branch and everything works for us so far. |
91143da
to
f076348
Compare
Just rebased that to master and tested, @julianoes I think that should be good to go |
Any update on this? This seems like a cool feature we can have without much more effort, as the PR is almost ready (just need merge conflict resolve) |
f076348
to
7ed442a
Compare
I have rebased the PR on top of main.
|
…on mavlink_endianness. Send the mission checksum constantly at a frequency of 1 Hz.
7ed442a
to
2647663
Compare
FWIW the spec says
There is no requirement for it to be streamed. Though there is nothing to stop you doing so, and streaming at 1Hz would mean that you comply. |
@KonradRudin ArduPilot tried to implement this and found it "conceptually flawed". I've been waiting on retesting of proposed changes, which is why this is still in development.xml. The idea is that the autopilot generates the checksum and broadcasts it. The GCS can generate the same checksum and therefore knows that nothing has changed. However this is flawed in general, because of the vagaries of floating point implementations mean that the checksums might not match even if calculated in the same way. The problem is even worse for ArduPilot because they only store the data fields that they use, so the mission on the vehicle does not match the mission on the GCS even in the best case. The counter proposal is that vehicle calculates a UID for its mission and passes that to the GCS as part of the MISSION_ACK. This value is then added to MISSION_CURRENT and streamed. That way the GCS always knows that it has the correct UID. We dropped the idea of separate ids for fence, plan, rally points, though we could add if the tradeoffs are considered reasonable. The full discussion and counter proposal is here: ArduPilot/ardupilot#20834 (comment) I am very sorry that not notifying of this discussion has potentially cost you work. Thoughts? |
Hey @hamishwillee Thanks for mentioning this. |
@KonradRudin no, other discussion than on ArduPilot. It's a flaw in our MAVLInk process that stuff in development is kind of "open to all". The theory being that only one group are working on it . So my take on this is that the UID can be a checksum, and it can be streamed. That's all good. IN fact the MISSION_CURRENT is streamed anyway. So the proposed change here is that we add extensions to MSSON_CURRRENT rather than having a stand alone message, and we add a change to the mission ack on upload as well. You can PR a change, or ping me on Wednesday and I can do it. |
Here is the PR for the new Mavlink proposal: |
I would propose to close this Pr in favor of #21839. Reasoning: The Mavlink support for MISSION_CHECKSUM is deprecated as seen in mavlink/mavlink#2010 |
Describe problem solved by this pull request
Ground control station should be able to compare its flight plan with the plan stored in the vehicle to determine if download/upload of mission plan is necessary.
Describe your solution
Implement calculation of mission checksum as defined in https://mavlink.io/en/messages/development.html#MISSION_CHECKSUM
Ground control station can request it with MAV_CMD_REQUEST_MESSAGE and compare its missions with those that are stored on the vehicle.