Skip to content
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

Update mission protocol with info old site #88

Merged
merged 2 commits into from
Aug 6, 2018

Conversation

hamishwillee
Copy link
Collaborator

@hamishwillee hamishwillee commented Jul 23, 2018

Merge interesting content from http://qgroundcontrol.org/mavlink/waypoint_protocol and http://qgroundcontrol.org/mavlink/mission_interface

  • Includes adding info on clearing missions and monitoring state
  • Add plain text mission format
  • Add descriptions for protocols
  • Tidy the description of the mission type extension.

This is ready to review.

Still some open questions, but I have captured them separately in #95


MAVLink 2 supports several different mission types in the [MISSION_COUNT](../messages/common.md#MISSION_COUNT) and [MISSION_REQUEST](../messages/common.md#MISSION_REQUEST) messages using the `mission_type` field. This instructs the autopilot to read and write to different lists containing the regular mission ([MAV_MISSION_TYPE_MISSION](../messages/common.md#MAV_MISSION_TYPE_MISSION)), geofence ([MAV_MISSION_TYPE_FENCE](../messages/common.md#MAV_MISSION_TYPE_FENCE)) and safe points used as alternate landing sites ([MAV_MISSION_TYPE_RALLY](../messages/common.md#MAV_MISSION_TYPE_RALLY)).
The protocol supports re-request of messages that have not arrived, allowing missions to be reliably transferred over a lossy link. <!-- not quite guaranteed :-) -->
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, we can't really say "guaranteed". We make more reliable with resends, but we do fail on a certain number of resends and if the link goes down.


## Upload a Mission to the Vehicle
MAVLink 1 supports only "regular" missions.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried to make this section more clear. I "assume" that if you use the MAVLink 2 library but specify MAVLink 1 the mission type you enter will be ignored. But in either case, the protocol expects you to ignore it, because it doesn't "exist" for MAVLink 1.

- On failure, `type` must set to [MAV_MISSION_ERROR](../messages/common.md#MAV_MISSION_ERROR) or some other error code.
1. GCS receives `MISSION_ACK`:
- If `MAV_MISSION_ACCEPTED` the operation is complete.
- If an error, the transaction fails but may be retried. <!-- not clear here -->
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not 100% sure of the handling here if the transaction fails. It appears to be that there is cleanup and an error message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I missed this PR. If the mission is rejected, there is no cleanup, the transaction gets aborted. I also don't know how other autopilots implement it, but PX4 has a double buffer - if the transaction fails, it does not replace the current mission.

Note:
- The GCS (client) sets a [timeout](#timeout) after every message and will resend if there is no response from the vehicle.
- The client will re-request mission items that are received out of sequence.
- The protocol also works with "similar" messages: [MISSION_ITEM_INT](../messages/common.md#MISSION_ITEM_INT) and [MISSION_REQUEST_INT](../messages/common.md#MISSION_REQUEST_INT).
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need these different types?

@@ -122,4 +249,36 @@ The standard file format for missions is JSON, as implemented in the QGroundCont
```


## Plain Text File Format
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a defacto standard. I think worth keeping the information.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

@hamishwillee
Copy link
Collaborator Author

Can I please get this checked @LorenzMeier

Copy link
Member

@LorenzMeier LorenzMeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please clarify the abort section, otherwise good to go.

@LorenzMeier LorenzMeier merged commit 1a9ce6a into mavlink:master Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants