-
Notifications
You must be signed in to change notification settings - Fork 142
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
base: master
Are you sure you want to change the base?
Conversation
en/services/mission.md
Outdated
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. |
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.
Are you sure?
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.
I thought so. What did you think - only on reboot?
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.
On reboot for sure.
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.
And on re-upload, or manual reset to 0.
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.
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.
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.
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.
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.
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.
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.
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?
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.
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...
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.
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
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 |
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.
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.
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.
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.
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.
@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.
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.
@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.
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.
In any case, fixed.
en/services/mission.md
Outdated
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. |
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.
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 @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. |
On Tue, 5 Mar 2024, Hamish Willee wrote:
@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.
Yeah. Coincidentally I'm playing with this at the moment.
We have a parameter "RTL_AUTOLAND" which determines the behaviour. 0
disables the autoland behaviour, it just goes to home or a rally point.
A value of 1 send you home (you will report as RTL), and then send you to
the landing sequence (will then report as auto).
A value of 2 will send you straight to the landing sequence. You will
*briefly* (one heartbeat!) report as RTL then report as auto.
|
On Tue, 5 Mar 2024, Hamish Willee wrote:
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.
No! I don't think that will work for PX4 because that's a *realy
waypoint* for PX4, not the home position like it is in ArduPilot!
i.e. you might have a legitimate reason in PX4 to set the waypoint to zero
while preserving your loop counters.
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?
I think we should stop relying on the
magic-waypoint-0-resets-loop-counters behaviour in the ground control
stations, and use that new parameter or some other mechanism. I don't
think I'm all that keen on that new parameter, honestly. Does it mean you
can't reset the loop counters without also possibly changing your
waypoint?
Note that ArduPilot does not currently honour that new parameter.
|
...reads documentation. Never mind.... |
Neither does PX4. It's on my list. I'd just like consistency. |
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. Anway, have a look at the update. Let me know how you go with reseting loop counters. |
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.