ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

LOITER_UNLIM next command

Open pavloblindnology opened this issue 3 years ago • 7 comments

Bug report

Issue details I'm having troubles with the next mission

  1. TAKEOFF
  2. LOITER_UNLIM
  3. WAYPOINT

Once copter reaches LOITER_UNLIM waypoint I cannot proceed to the next waypoint by toggling the flight mode between Auto and Stabilize/AltHold/Loiter/Guided, as it should according to manual:

The mission will not proceed past this command while in AUTO mode. In order to break out of this command you need to change the mode (i.e. to MANUAL). If there are subsequent commands then you can continue the mission at the next command, if the Copter MIS_RESTART parameter is set to resume, by switching back to AUTO mode (otherwise the mission will restart).

The issue was discussed with no answer: https://discuss.ardupilot.org/t/loiter-unlimited-next-command/8719/2

Version Copter_4.2.2

Platform [ ] All [ ] AntennaTracker [*] Copter [ ] Plane [ ] Rover [ ] Submarine

Airframe type octa

Hardware type SITL

pavloblindnology avatar Jul 28 '22 16:07 pavloblindnology

I suspect this is a case were we just need to update the documentation. What behavior are you trying to achieve?

Using scripting you could add a RC switch to advance past a loiter unlimited. If you have a GCS you can just advance the mission index directly.

IamPete1 avatar Jul 28 '22 20:07 IamPete1

The current behavior is correct, it's the doc that is wrong. Switching out of AUTO and back will not skip over a mission waypoint. It will either resume where it left off or reset to beginning depending on the MIS_RESTART param.

magicrub avatar Jul 28 '22 20:07 magicrub

I suspect this is a case were we just need to update the documentation. What behavior are you trying to achieve?

Using scripting you could add a RC switch to advance past a loiter unlimited. If you have a GCS you can just advance the mission index directly.

Understood. The idea is to do some manual/guided piloting at some of the waypoints, then continue with the mission. Switching back to Auto is the simplest way, not requiring any scripting or GSC. Is there any reason behind not proceeding to the next waypoint after LOITER_UNLIM? I understand, that 2 cases are possible here: wp is reached - then we should not proceed to the next wp; wp is not reached - then we should proceed. If this seems reasonable I could contribute this feature.

pavloblindnology avatar Jul 29 '22 09:07 pavloblindnology

If you fancy doing a PR that would be great, no guarantees we will accept it tho.

You could do it based on the mode change from scripting too.

IamPete1 avatar Jul 29 '22 11:07 IamPete1

@pavloblindnology How about a new AUX switch input to skip to next waypoint? I thought we already had that but I don't see it listed on the wiki. That is a fairly simple thing to implement. Would that work for your application? https://ardupilot.org/copter/docs/common-auxiliary-functions.html

Another option, as @IamPete1 mentioned, is a simple LUA script that you write and drop onto the SD card to do the equivalent of reading an RC input switch to move the waypoint index forward or back. Lots of examples here showing RC in and changing the mission. https://github.com/ArduPilot/ardupilot/tree/master/libraries/AP_Scripting/examples

magicrub avatar Jul 29 '22 17:07 magicrub

@magicrub @IamPete1 Sure, could do this with scripting. Just thought it'd be more convenient for an operator to proceed with 1 switch instead of 2.

pavloblindnology avatar Jul 31 '22 17:07 pavloblindnology

No reason you can do it based on mode change in the script as well.

IamPete1 avatar Jul 31 '22 17:07 IamPete1