Copter pause+continue mission, switch behavior

333 views
Skip to first unread message

Andrew Chapman

unread,
Apr 24, 2014, 5:59:44 PM4/24/14
to drones-...@googlegroups.com
Hi all,

With AP_Mission we can now pause+continue AUTO missions in copter, which allows you to do things like send it off on a grid search, and if you spot something you can take over to have a closer look, then have it continue again.

As part of this we're also changing the default behavior of AUTO on copter so that if you switch out of AUTO during a mission then re-initiate it later it will continue from the next command rather than always starting from the beginning. This will being copter+plane together in this regard, but now we need a way of explicitly resetting the mission.

I already have it working well as a CH7/CH8 switch, but Randy and I are looking for some group input on how people would prefer the switch to work.

Currently it works like this:
  HIGH: reset mission to the first command (does not change flight mode, so will only fly off toward the first waypoint if already in AUTO mode)
  MID: pause mission, switches to LOITER (even if you're not in AUTO mode)
  LOW: continue mission (will switch to AUTO if in another mode)

Even without the CH7/CH8 switch you'll be able to pause+continue an auto mission, just switch out of AUTO, do your thing, then switch back again and it will pick up where it left off.

So given this last point, maybe it is simpler to just have a 2-position CH7/CH8 toggle to reset the mission, and leave all the flight mode selection to the existing controls?

I'm easy either way: one keeps things simpler, the other allows you to pause+continue+reset from one switch, and can also free up one of the 6-pos flight mode slots for something else because you can use the CH7/CH8 one to initiate AUTO.

AC.

Jason Short

unread,
Apr 24, 2014, 6:19:51 PM4/24/14
to drones-...@googlegroups.com
Most people only have 2 pos switches, so your default would actually reset the mission. In general, stay away from 3 pos switch options since they are not user friendly and overly complex.

How will this be accessed via Mavlink? DP2 has a mission pause button that's been hidden and waiting for this implementation. Or will we just send a loiter command?

Thanks! This is a great feature.
Jason




--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marco Robustini

unread,
Apr 24, 2014, 6:44:24 PM4/24/14
to drones-...@googlegroups.com
Thanks Andrew, thanks for make reality my enhancement request.

Marco

Andrew Chapman

unread,
Apr 24, 2014, 6:50:53 PM4/24/14
to drones-...@googlegroups.com
When you click the existing 'Restart Mission' button in Mission Planner I think it currently just sets the WP# to 1, which mostly works but that will have some weird behaviour in some cases (e.g. if you have ROI set).

So we probably need a mavlink message to explicitly reset the mission (MAV_CMD_DO_MISSIONRESET?), or for the autopilot to interpret "go to the first waypoint" as a mission reset.

Thanks for keeping me grounded in the 2-pos switch world, since getting my Taranis I've no shortage of 3-pos switches ;)

AC.

Randy Mackay

unread,
Apr 24, 2014, 10:47:19 PM4/24/14
to drones-...@googlegroups.com

Input from Marco and others would be good on this point as well.  My opinion is below..

 

I like this idea:

     So given this last point, maybe it is simpler to just have a 2-position CH7/CH8 toggle to reset the mission, and leave all the flight mode selection to the existing controls?

 

I think we need to allow people to keep using the current behavior so maybe we need a parameter which controls whether changing into AUTO mode will restart the mission or resume it.  We could call it AUTO_RESUME and by default it’s “0” (the current behaviour) which means it always restarts the mission.  When set to “1” it will resume instead.  This parameter should probably be in the main Parameter.pde instead of in the mission library.

 

For the ch7/ch8 switches we could do any or all of these:

1.       An option called “Auto Reset” which sets the mission back to the first command but doesn’t switch the vehicle into Auto.

2.       An option called “Auto Resume” which sets the vehicle into Auto from the last active waypoint.

3.       An option called “Auto Restart” which sets the mission back to the first waypoint and starts the mission (i.e. current behaviour).

but to keep it simple I think we should just implement #1 and default the AUTO_RESUME parameter to 1.

 

By the way, there’s an existing ch7/ch8 AUTO option .  When the user puts it high it switches into AUTO.  When the switch is put low it reverts back to the flight mode indicated by the ch5 switch.  I think we just need to be sure that it continues to act just like the Auto invoked when the ch5 flight mode switch is used.

 

-Randy

Andrew Chapman

unread,
Apr 25, 2014, 12:50:41 AM4/25/14
to drones-...@googlegroups.com
On Thursday, April 24, 2014 7:47:19 PM UTC-7, Randy Mackay wrote:

... 

I like this idea:

     So given this last point, maybe it is simpler to just have a 2-position CH7/CH8 toggle to reset the mission, and leave all the flight mode selection to the existing controls?


I actually agree now, so unless anyone else weighs in with a stronger opinion I'll make it work that way.

The way I had it seemed intuitive to me, but the act of writing out the description made me realize it was a bit complicated. I should go back to writing the documentation first then coding to that ;)


 

I think we need to allow people to keep using the current behavior so maybe we need a parameter which controls whether changing into AUTO mode will restart the mission or resume it.  We could call it AUTO_RESUME and by default it’s “0” (the current behaviour) which means it always restarts the mission.  When set to “1” it will resume instead.  This parameter should probably be in the main Parameter.pde instead of in the mission library.


Already in as a separate pull request (https://github.com/diydrones/ardupilot/pull/987) - MIS_AUTORESTART

Though I have it as an AP_Mission parameter and defaulting to 0 (don't automatically reset), as although that's a change from the current behaviour it will match plane.

AC.

Marco Robustini

unread,
Apr 25, 2014, 3:11:13 AM4/25/14
to drones-...@googlegroups.com
Yeah, the problem is this one, some users don't use like me 2+3 switch position on ch5 for the six flight mode, some use a three position switch for 3 flight mode and CH7/8 for the other, this is because many fail to make the six combinations of pwm using two switch, which are always possible with all the current tx.
But I see many people who usually use CH7 / 8 for RTL, so I guess I manage a feature 3-position Auto on CH7 / 8 is the best thing.
I've thought so (for CH7/8 with 3 position):

- low: nothing, respect the CH5 flight mode
- middle: if CH5 is in flight mode different than Auto ignore the command, if is in Auto pause the quad in Loiter
- high:
if CH5 is in flight mode different than Auto reset the mission (like with APM Plane), if is in Auto reset and restart the mission

It's important however to put a little "timer" in the code when switching of about 1/2 or 1/3 second so that if step from "high" to "low" quickly bypass the command "middle" or the quad would stop for a instant.
For users using the CH7/8 for Auto mode is not easy to manage this thing, especially if they use a switch with two positions, but I also believe that if one wants to use these advanced features with APM Copter should also know how to program your radio in a decent way... ;-)
I read with interest your alternative, the one proposal by Randy is not bad but mine skip the creation of new parameters.

Marco

Marco Robustini

unread,
Apr 25, 2014, 3:16:05 AM4/25/14
to drones-...@googlegroups.com
I'm sorry, the "middle" situation i've described above is not complete, here is the correct one:

- middle: if CH5 is in flight mode different than Auto ignore the command, if is in Auto pause the quad in Loiter, to continue the mission switch in "low" position

Marco

Josh Welsh

unread,
Apr 25, 2014, 1:51:15 PM4/25/14
to drones-...@googlegroups.com


I like this idea:

     So given this last point, maybe it is simpler to just have a 2-position CH7/CH8 toggle to reset the mission, and leave all the flight mode selection to the existing controls?

I think what Jason says is valid, but if we can find a way to let users choose between 2 and 3-pos switches I think that might be best.  If they have a 2-pos, they get two options, but if they have 3, they can invoke a 3rd option.  Might be tricky in the interface to work out, but provides the most flexibility. 

 

I think we need to allow people to keep using the current behavior so maybe we need a parameter which controls whether changing into AUTO mode will restart the mission or resume it.  We could call it AUTO_RESUME and by default it’s “0” (the current behaviour) which means it always restarts the mission.  When set to “1” it will resume instead.  This parameter should probably be in the main Parameter.pde instead of in the mission library.


This is the first thing I thought of when reading the thread.  For those who have already consumed their ch7/ch8 switches by other things, this could allow them to still choose between one behavior or the other.  Prioritization would need to be set up so that the switch still overrides this setting but it sounds like that would be pretty simple?

Overall, this is really awesome, thanks AC for the work here!  This will be very helpful in the field!

Andrew Chapman

unread,
Apr 28, 2014, 3:10:46 AM4/28/14
to drones-...@googlegroups.com
It's a little tricky for LOW to mean "switch back to AUTO mode, but only if you're paused"

When you 'pause' an AUTO mission you're switching out to LOITER mode, so to have this switch in LOW position do different things depending on whether it is paused or not would mean keeping track of mode changes over time. Not too hard to implement, but potentially confusing/dangerous for a switch to do different things depending on what has happened earlier. e.g. what if you pause an auto, fly around manually for a while, forget about auto, land, then reset all your switches to default position? It will suddenly take off and head for the next waypoint where it was up to. Tough to blame the user in that case because most of the time that switch in LOW does nothing, only if they've paused an AUTO.

The more I think about it the better I like the simplicity of the switch only being used to reset the mission back to the first command. Regardless of the switch we need a parameter to control the preference for auto missions to automatically reset or continue between invocations.

AC.
Reply all
Reply to author
Forward
0 new messages