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
AP_Scripting: added applet SM_SwitchMission #22348
Conversation
What an absolutely brilliant idea! |
local SCRIPT_NAME = 'SM' -- abbreviation of scriptname for messages on GCS | ||
local SUB_DIR_APM = '/APM/scripts'-- path to scripts on SD-card | ||
local SUB_DIR_SITL = './scripts' -- path to scripts when using SITL | ||
local SUB_DIR_MISSIONS = 'missions' -- subdirectory below scripts-directory where the mission-files are stored |
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.
Perhaps "missions" should be at the APM root, rather than buried under "scripts"?
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 would prefer to have the missions near scripts - but let's see what the developers strategy is.
Thank you Tim :o) |
If it works and someone else can give it a try I'm happy to approve. |
I tested a pre-version in real plane-flight and the latest version of course in SITL. The version without script-specific parameters is still commented by some users: But I will ask for test-comments of the current version. |
I improved it and tested the lua in SITL - all is working fine. |
735dbce
to
f796a1e
Compare
@IamPete1 Hi Pete, now all should be done. |
After rebase, it seems the lua-bug of receiving a correct handle when opening a not existing file for reading is fixed. |
https://discuss.ardupilot.org/t/switch-missions-on-the-fly/92106/58 @IamPete1 What else is necessary to merge (disregarding of a rebase)? |
Co-authored-by: Peter Hall <33176108+IamPete1@users.noreply.github.com>
9d79cb3
to
912d4d1
Compare
I have rebased, we now have a scripting check in CI which this will hopefully pass. If that passes and someone else has given it a go then I'm happy (I can give it a try here too at some point). |
Thank you for rebase @IamPete1 |
I'm using that feature in nearly every flight with my gliders, especially with relocation+rotation, but it seems to me, nobody is really interested in it. I really wonder why. |
Script for switching of missions that are saved on SD-card 'on the fly'.
Selection and loading can be done by one of two different methods (multi-position-switch or push-button).
The amount of missions is theoretically unlimited.
Convenient preparation of environment like searching sufficient table_key, finding correct sub-directory for SITL or SD-card and counting available and checking sufficient number of missions.