As with other composites, it checks if the child is running and stops it if that is the case. Args: new_status (:class:`~py_trees.common.Status`): the behaviour is transitioning to this new status
(self, new_status=py_trees.common.Status.INVALID)
| 72 | yield self |
| 73 | |
| 74 | def stop(self, new_status=py_trees.common.Status.INVALID): |
| 75 | """ |
| 76 | As with other composites, it checks if the child is running |
| 77 | and stops it if that is the case. |
| 78 | Args: |
| 79 | new_status (:class:`~py_trees.common.Status`): the behaviour is transitioning to this new status |
| 80 | """ |
| 81 | self.logger.debug("%s.stop(%s)" % (self.__class__.__name__, new_status)) |
| 82 | self.terminate(new_status) |
| 83 | # priority interrupt handling |
| 84 | if new_status == py_trees.common.Status.INVALID: |
| 85 | self.decorated.stop(new_status) |
| 86 | # if the decorator returns SUCCESS/FAILURE and should stop the child |
| 87 | if self.decorated.status == py_trees.common.Status.RUNNING: |
| 88 | self.decorated.stop(py_trees.common.Status.INVALID) |
| 89 | self.status = new_status |
| 90 | |
| 91 | def tip(self): |
| 92 | """ |