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

Mission service - add section on mission execution #529

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

hamishwillee
Copy link
Collaborator

Recently had a query "how do I pause a mission". Made it clear to me that we don't have a clear explanation of the execution cycle of a mission - start, pause, reset.

@peterbarker @julianoes @tridge Would appreciate your review. I think this is accurate based on previous discussions with @tridge . For example, it captures (without being specific) that ArduPlane switches out of Mission mode when the mission is complete, while other vehicles (Copter say) loiter within the mission mode.

en/services/mission.md Outdated Show resolved Hide resolved
Once a mission has started it will iterate through the mission items, jumping and looping as indicated by jump mission items, until it completes.
While the mission is running you can change the current mission item, but this does not reset the jump counters used for loops, and once the mission is complete, changing the current mission item will not restart it.

The mission will reset after you land and the vehicle disarms.
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure?

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 thought so. What did you think - only on reboot?

Copy link
Contributor

Choose a reason for hiding this comment

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

On reboot for sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

And on re-upload, or manual reset to 0.

Copy link
Contributor

Choose a reason for hiding this comment

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

ArduPlane will not reset counters if you land the vehicle in auto. It's a bit more complicated because some missions have the vehicle land and disarm, but then be able to resume the mission from where they are in their sequence when they're armed in auto again.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And on re-upload, or manual reset to 0.

@julianoes Just to be clear,

  • I understand reupload on the ground will reset the counters and the current waypoint.
  • For upload in air the current waypoint does not change right? On PX4 you "finish the previously uploaded waypoint" and then the waypoint number increments and you progress to that waypoint in the newly uploaded mission.

On manual reset to 0

What do you mean by this? Is this the same as ArduPilot - setting mission current to 0 resets the whole mission? If so, that would be good.

ArduPlane will not reset counters if you land the vehicle in auto. It's a bit more complicated because some missions have the vehicle land and disarm, but then be able to resume the mission from where they are in their sequence when they're armed in auto again.

@peterbarker Thanks very much. This caveat is true of all PX4 vehicle too - its a configuration setting or a mission type setting. I will add a comment.

Copy link
Contributor

Choose a reason for hiding this comment

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

For upload in air the current waypoint does not change right? On PX4 you "finish the previously uploaded waypoint" and then the waypoint number increments and you progress to that waypoint in the newly uploaded mission.

This is ground station dependent. I think QGC does that. But if you just upload the whole mission, it will go back to 0.

setting mission current to 0 resets the whole mission? If so, that would be good.

I think so, except things like DO_JUMP counters.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@julianoes

I think so, except things like DO_JUMP counters.

So it will remove the "complete" bit and restart the mission, but with the wrong counters? That's screwed up. Can we make it also reset the counters? (i.e. as part of this protocol) and make not resetting them non-standard.

FYI also @peterbarker my concern here is that we updated MAV_CMD_DO_SET_MISSION_CURRENT to add a reset option because there was not way to reset the counters. Now it seems like setting the mission item to 0 would do this. That's a better approach. So we should standardize.
I.e. I think we'd be best off removing that separate parameter and stating that setting to zero should reset the counters and the complete bit and reset to zero. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

So it will remove the "complete" bit and restart the mission, but with the wrong counters? That's screwed up. Can we make it also reset the counters? (i.e. as part of this protocol) and make not resetting them non-standard.

That's the way I made it in 2013 or so. It might have been fixed since. You could try it out...

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 doubt it. In any case, Peter commented somewhere here he prefers that counters are reset explicitly. So we probably need to implement that second parameter. I looked at it once but couldn't work out the right place to even add the command.

en/services/mission.md Outdated Show resolved Hide resolved
en/services/mission.md Outdated Show resolved Hide resolved
en/services/mission.md Outdated Show resolved Hide resolved
en/services/mission.md Outdated Show resolved Hide resolved
If supported the [MAV_CMD_MISSION_START](../messages/common.md#MAV_CMD_MISSION_START) command will both arm the vehicle (if necessary) and switch to the mission mode.
This command also allows you to specify a particular start and end item in the mission.

### Pausing/Stopping Missions
Copy link
Contributor

Choose a reason for hiding this comment

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

I find it very strange that there's no coverage of MAV_CMD_DO_PAUSE_CONTINUE here! That's the more appropriate malvink-ish way of doing this behaviour, I'd think.

Saying "do-set-mode" won't always stop the vehicle from executing waypoints - for example, ArduPlane when you've got a DO_LAND_START. If you switch modes to RTL it's essentially the same thing as changing waypoints - the Plane will jump to its landing sequence.

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 find it very strange that there's no coverage of MAV_CMD_DO_PAUSE_CONTINUE here! That's the more appropriate malvink-ish way of doing this behaviour, I'd think.

Doh. That's my brain fade. Thanks. Will fix.

Saying "do-set-mode" won't always stop the vehicle from executing waypoints - for example, ArduPlane when you've got a DO_LAND_START. If you switch modes to RTL it's essentially the same thing as changing waypoints - the Plane will jump to its landing sequence.

@peterbarker This is true on PX4 too but there is a nuance that waypoints are being executed but you're still in Return mode, not mission mode. Is it the same on ArduPlane?

The TLDR here is that PX4 RTL has settings to execute a return mode landing following a mission landing pattern. So you are following waypoints, but you're not in a mission.

Copy link
Contributor

Choose a reason for hiding this comment

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

@peterbarker This is true on PX4 too but there is a nuance that waypoints are being executed but you're still in Return mode, not mission mode. Is it the same on ArduPlane?

I believe so. Unless behaviour has changed the vehicle will briefly appear to go into RTL mode but will then appear to go back to AUTO mode.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@peterbarker What if you're not in auto mode to start with - will it go to RTL mode and still then go to AUTO mode to do the landing? That seems odd if the intent was to RTL.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In any case, fixed.

en/services/mission.md Outdated Show resolved Hide resolved
Once a mission has started it will iterate through the mission items, jumping and looping as indicated by jump mission items, until it completes.
While the mission is running you can change the current mission item, but this does not reset the jump counters used for loops, and once the mission is complete, changing the current mission item will not restart it.

The mission will reset after you land and the vehicle disarms.
Copy link
Contributor

Choose a reason for hiding this comment

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

ArduPlane will not reset counters if you land the vehicle in auto. It's a bit more complicated because some missions have the vehicle land and disarm, but then be able to resume the mission from where they are in their sequence when they're armed in auto again.

en/services/mission.md Outdated Show resolved Hide resolved
@hamishwillee
Copy link
Collaborator Author

@peterbarker @julianoes OK, I have overhauled this. I think I've addressed all points.

This does some additional restructure to fully separate mission upload/download from mission execution. I've reduced the initial description of mission execution so most of the detail is in the sub-sections. The caveats are mostly in the resetting section.

@peterbarker
Copy link
Contributor

peterbarker commented Mar 6, 2024 via email

@peterbarker
Copy link
Contributor

peterbarker commented Mar 6, 2024 via email

@peterbarker
Copy link
Contributor

Does it mean you can't reset the loop counters without also possibly changing your waypoint?

...reads documentation. Never mind....

@hamishwillee
Copy link
Collaborator Author

Note that ArduPilot does not currently honour that new parameter.

Neither does PX4. It's on my list. I'd just like consistency.

@hamishwillee
Copy link
Collaborator Author

A value of 2 will send you straight to the landing sequence. You will briefly (one heartbeat!) report as RTL then report as auto.

Thanks. I guess its just a bit different than I am used to. On PX4 the same behaviours exist, but the thinking is that whether or not you're executing a mission landing, if you're RTL due to a failsafe or whatever that is the mode of interest for users.
I think I agree - I'd be surprised to do RTL and suddenly see myself in a mission.

Anway, have a look at the update. Let me know how you go with reseting loop counters.

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.

3 participants