Skip to content

Commit

Permalink
[actions] don't cancel if not RUNNING
Browse files Browse the repository at this point in the history
  • Loading branch information
stonier committed May 24, 2019
1 parent 35c8383 commit 50ff82c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog

Forthcoming
-----------
* [actions] bugfix action client, don't cancel if not RUNNING
* [conversions] bugfix msg_to_behaviour for decorators
* [watchers] bugfix tree-watchers dot-graph to string functionality

Expand All @@ -16,7 +17,7 @@ Stripped down and rebuilt for ROS2:
* [blackboard] the exchange, mostly unmodified
* [infra] colcon build environment
* [trees] simpler communications, just one serialised tree snapshot, watchers do the rest
* [watchers] revamped 'blackboard' and new 'tree' watcher
* [watchers] revamped 'blackboard' and new 'tree' watcher

What's missing:

Expand Down
5 changes: 4 additions & 1 deletion py_trees_ros/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ def terminate(self, new_status: py_trees.common.Status):
"{}->{}".format(self.status, new_status) if self.status != new_status else "{}".format(new_status)
)
)
if self.status != new_status and new_status == py_trees.common.Status.INVALID:
if (
self.status == py_trees.common.Status.RUNNING
and new_status == py_trees.common.Status.INVALID
):
self.send_cancel_request()

def shutdown(self):
Expand Down

0 comments on commit 50ff82c

Please sign in to comment.