Add ability to preempt the task when a stage fails (preempt_on_failure) #723
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.
In our tasks, we make extensive use of the
PredicateFilterstage to perform certain checks in the scene before other stages are executed. This stage is expected to always succeed for the task to proceed. However, the task currently continues planning and looks for alternative solutions in earlier stages, which unnecessarily prolongs planning time—even though we already know that if this stage fails, the task is not feasible and there is no reason to continue.With this in mind, we propose adding a
preempt_on_failureproperty. If set to true, the stage must always succeed; if the stage fails even once, the task is immediately preempted and planning aborts.We can currently do something similar using
addSolutionCallbackand throwing an exception when any solution fails, but this does not update introspection correctly.Thoughts, @rhaschke?