Template-based mission generator (fixes #259) #260
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.
Generates missions based on provided template. The template is provided as a
str
which is a list of command templates separated by-
. A command template has the following format:Example:
Which represents two
TAKEOFF
commands with parameteralt
set to 5.2.Providing the parameters are optional. If not provided they will be generated by random.
Providing the number of repeats is optional. If not provided it will be set to 1. If set to
*
it means number of repeats could be determined dynamically and could be between 0 to maximum allowed.If command name is set to
.
the template considers all possible commands.A full template example:
A single
TAKEOFF
command with parameteralt
set to 4.2 is followed by 0 or more commands, followed by a singleLAND
command (with random parameters), followed by a single command (picked randomly from all possible commands), followed by a singleLOITER
command with two fixed parameters, and finally followed by 0 or more random commands.