Switch Missions 'on the fly'

I don’t think so, if you read the introduction in the WIKI ( Lua Scripts — Plane documentation ) and regarding this script the thread here. Willy Zehnder @Quaxwilly has written a detailed script guide: Switch Missions 'on the fly' - #44 by Quaxwilly

LUA scripts run with Arduplane on the flight controller. Not every controller has enough memory capacity to run LUA scripting. It works very well e.g. with the Mateksys F765 and H743 boards.

Rolf

1 Like

Thanks for the reply, I cant wait to try it. Ardupilot is completely addictive and exciting, but can be very frustrating aswell.

Thank you @Rolf for the really quick response :smile:
@Scott_Nunan It would be great if you would post a feedback here after your try, because the developers are waiting for positive feedback of testers before they will merge that PR in the example-code.

No problem Willy, I’m not far off being able to test, i have installed flight controller and done the first drives in manual and acro a few days ago so hopefully will be soon.

Is nobody interested in testing that script?
Or too lazy to write some lines? :wink:

Hi Willie I’ve tested the multi position switch method and it worked perfectly, i will also set a larger number of missions and try the button method for cycling through the missions.
I should be able to test this over the weekend.
Thanks again for your work, it achieves my objectives very well and this was one of my major concerns of how i was going to choose different way points without a gcs. Now we can

1 Like

Other than a post here in support is there something that you’d like to get it over the line like commissioning document testing the functions and failure modes or something?

No, only a user-test and a short notice what you tested is sufficient. We don’t need a CMM Level 5 test :wink:
Your previous post is perfect - thanks!

@Scott_Nunan did you have you a chance to test it?

Life got in the way last weekend for the mission toggle testing on the water.
I could test it here at home but I’d be just relying on the status messages to indicate that the mission had loaded rather than checking the auto mode like I did with the switch

Hello Quaxwilly!

(I am from Austria, but will stick to english for all the others :slight_smile: )

=> have you thought about the “special” function for the small boat for fishing? Sending it to one of 6 waypoints that are stored in the mission on the boat?

I studied the manual for LUA-scripting, but I haven’t found the command for that.

My vision: press one of the 6 buttons on the TX16 (normally used for flight mode), then move a switch and the boat goes to waypoint X. Maybe with a 3way-switch “manual” - “goto waypoint” - “RTL”.

Or anybody else: could you point me to a direction?

Using different missions while fishing requires too much hardware => I could manage waypoints within a mission with apps on my phone, but it is too much to transfer files and so on.

The switch mission script can do six missions with the toggle function no problem just using one button and display will tell you if you’re on mission #1 or #2 etc.
The problem will be setting the waypoints in the first place, the fact is you will need to create the missions in the first place. Im not sure about how to save a waypoint using a switch because in my application i dont need to do that.

@HaBa Some months before I have created a script exactly for that purpose @Scott_Nunan mentioned. By pressing a button a Mission with just one waypoint will be created.
Pls give me some time to post it - Im very busy in the moment.

Edit:
Because currently there is a change in LUA-Interpreter from “stable” to “latest/dev” at opening a file correctly, I have to check and maybe improve the code for not to create an error in one of that interpreter-versions.

https://discuss.ardupilot.org/t/switch-missions-on-the-fly-store-waypoint-as-new-mission/94467?u=mckey

This is the script that @Quaxwilly talks about.
If this great person (@Quaxwilly in the future, if he has time, can make a script for assigning a new RTH position, it will be very cool in general.(the tx16x has an internal GPS, and I would like to take its position as a point for returning home)

Thank you!

That sounds promising, but is also not what is needed for my purpose (and I guess others :slight_smile: )
=> I need 6 (ore more) waypoints in ONE mission, so I could also use the existing apps :slight_smile:

Alls the current apps for that purpose of “bait boats” act like this = they load the mission from the AP (in this case mostly pixhawk), they show you the points as overlay to some ?google?-map, then you can do something like “go to” and press on the position marker on the screen.

In these apps you can “organize” your current waypoints and missions with a “mission editor”, you can store them on your phone (as a textfile) and so on.

It is a completly different approach, I know, I thought it may be easy for you to code a simple “get waypoint according to button position and goto there” :slight_smile:

The point for RTH in these apps is calculated at “where was the first GPS-lock in this powerup”

For that purpose you have the “Guided Mode” implemented in ArduPilot:
https://ardupilot.org/rover/docs/guided-mode.html
On cellphone you can use e.g. QGC

If you have no connected GCS you have to create a mission for each waypoint and switch by the Switch-Mission script. If you use the one-button method, that’s not restricted to only six waypoints.

That script is for easy use with NO GCS! Just prepare your missions at home and select it via one button on the lake.

1 Like

You are not the 1st to ask about this. Here is another discussion:
Select Waypoint
There are other inquiries.

@McKey Sorry, but no. I don’t have the necessary hardware (e.g. tx16x) to do that. Setting a new Home in FC is straightforward, but you have to send that position from TX to FC.

Thank you for the fast response.

I cannot prepare anything at home, that is the whole point :slight_smile: => come to the lake, ZERO WP or missions stored, find some places to fish, store them as waypoints, then select in the apps like “carp pilot” “goto” an “klick” on the stored WP on the map.

https://www.carppilotpro.org/

My phon is connected via BT to my TX16s (or the SIYI FR30 in it), telemetry to the pixhawk is working over that.

So I have tools by hand to reorganize WP in a mission.

And I would like to select on WP in this mission by button and let the boat drive to it without fiddling around with my phone or a tablet.

Sorry to disturb your thread, the link to the other threa (thank you @dkemxr shows me that nobody is interested in things like that if such core functionality (in my eyes) is not provided in ardupilot or lua-scripts).

Fiddling around with the boat before (making missions and copy them to somewhere) is exactly something that I would like to avoid with my “push a button out of 6 an boat drives there” :slight_smile:
Thank you everybody for your patience.

@HaBa that core functionality that you are looking for has been implemented by @Quaxwilly in his script. Have you tested it?