ArduPilot / ardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source
http://ardupilot.org/
GNU General Public License v3.0
11.02k stars 17.57k forks source link

Copter: resume auto mission at last waypoint even after reboot #1311

Open roque-canales opened 10 years ago

roque-canales commented 10 years ago

pause auto-mission, it works, but there is possible to move current waypoint number variable to eeprom? like this even when copter no finish big mission, and when it rtl, land and we change batteries (reboot), when we restart mission, automatically copter go to waypoint targeted just before rtl?

roque-canales commented 10 years ago

also I noticed that when switch back to auto mission mode after having paused, all the functions such as doset or condition commands are not reactivated, it would be possible to ensure that all (or the last ones) of the doset and conditon_ be before current waypoint be reprocessed when switching back to automission?

rmackay9 commented 10 years ago

My view is that resuming at a particular waypoint even after a reboot is something that a ground station could handle better. For example allowing the operator to start the mission from any waypoint (i.e. one before the last one executed).

roque-canales commented 10 years ago

Okey, so it's enhancement for mission planner.

I will test MP Actions buttons like set waypoint,mission start... and I will feedback it in MP Issues/enhancement.

roque-canales commented 10 years ago

Randy, we can implement this feature directly in pixhawk.... Saving current waypoint to eeprom (alias full parameter tab list) And reloading commands before this waypoint following this: takeoff command last Do-Set-ROI last Do-Change-Speed last Do-Set-Home last Do-Set-Cam-Trigg-Dist last Do-Set-Relay last Do-Repeat-Servo

What do you think ?

samannoy commented 7 years ago

i have been working on my old apm 2.6 for a while with firmware version arducopter 3.2.1 . While testing the AUTO mission, i found that the arducopter does not support resuming to the last waypoint once the AUTO mission is interrupted, and instead restarts from waypoint 1. Is there a way we can do that? like, by changing the source code? or is there already a solution to that in newer firmware verions?

magicrub commented 7 years ago

@samannoy your question was answered in https://github.com/ArduPilot/ardupilot/issues/5550 and is different than this issue which is about continuing after a reboot.

rmackay9 commented 6 years ago

I'd like to change my opinion from what I said way back in Aug 2014.. I think we could add a new parameter to the AP_Mission library to store the last active command and then when the user switches into Auto it resumes from the command number stored in the parameter. We'd need to be careful that it's properly cleared when a new mission is uploaded I think.

babakmtd commented 6 years ago

Randy,this idea is very useful, for example for sprayer drone, if when liquid level sensor declare the tank is empty,active the RTL failsafe, Resume the auto mission and save last Wp for refilling the tank or change the battery if it necessary.

Naterater commented 5 years ago

This would be useful for Plane as well.

peterbarker commented 5 years ago

On Fri, 28 Dec 2018, Nathan E wrote:

This would be useful for Plane as well.

I wonder if we should just store the current waypoint in a parameter....

SuyashMali commented 6 months ago

Hey, I wonder if this functionality has been added to the Ardupilot firmwares yet. If not, I was thinking of a Lua Script based solution, where the script would write the last waypoint index that the vehicle had covered before disarming/rebooting to a file (on the SD Card). And Based on a custom parameter (say RESUME_LASTWP; 0 = Do not Resume, 1 = Resume the Mission), the copter would travel to the last waypoint index that was written to the file before rebooting.

rmackay9 commented 6 months ago

Hi @SuyashMali, yes, that would work I think. Instead of writing to the SD Card the script could store the waypoint number in a custom parameter. In any case, good idea!