MissionRotation LUA - Load one of up to 10 mission files #28789
Closed
+138
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This LUA script is an evolution on the MissionSelector.LUA.
Allows you to select up to 10 missions, either while arming or in the unarmed state.
Requires that an RCx_OPTION be set to 24 (Mission Reset).
The scripts should be installed in the SCRIPTS folder on the MicroSD, and the mission files in the root.
The mission file called mission0.txt (the default mission) must exist and is loaded at boot, if the script does not find it it stops working.
To load to the next mission file just bring AUX switch from low to high for no more than three seconds, each switch loads the next mission file in numerical order.
If the next mission file numerically does not exist load the next one, at the end of the rotation it returns to load mission0.txt.
If AUX is held at high state for more than three seconds the script will restart by loading mission0.txt.
If a mission switch is attempted in AUTO flight mode, a warning “Could not clear current mission” will be shown and no operation will be performed
Provides for sending messages under any condition, load or error.
Classic example of use, i.e. how do i use this rotation:
In my case if any failsafe intervenes the chosen mission is then executed.
In this way by pre scheduling the appropriate missions for the location where I fly I can afford to handle any emergencies without using GCS, simply choosing with the script the most appropriate mission, and in case changing it on the fly.