Skip to content
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

Parallel should invalidate when priority interrupted #285

Merged
merged 3 commits into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Release Notes

Forthcoming
-----------
* ...
* [composites] paralell bugfix to invalidate correctly, `#285 <https://github.com/splintered-reality/py_trees/pull/285>`_

2.0.12 (2020-03-10)
-------------------
Expand Down
6 changes: 5 additions & 1 deletion py_trees/composites.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,14 @@ def stop(self, new_status: common.Status=Status.INVALID):
Args:
new_status : the composite is transitioning to this new status
"""
# clean up dangling (running) children
for child in self.children:
if child.status == common.Status.RUNNING:
# interrupt it (exactly as if it was interrupted by a higher priority)
# interrupt it exactly as if it was interrupted by a higher priority
child.stop(common.Status.INVALID)
# only nec. thing here is to make sure the status gets set to INVALID if
# it was a higher priority interrupt (new_status == INVALID)
Composite.stop(self, new_status)

@property
def current_child(self):
Expand Down