Skip to content

Commit

Permalink
[blackboard] bugfix activity stream registration logic (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
stonier committed Dec 26, 2019
1 parent 4b59d41 commit ac61cfe
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions py_trees_ros/blackboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,12 @@ def _close_service(self, request, response):
response.result = False
for view in self.views:
if view.topic_name == request.topic_name:
if view.with_activity_stream:
self.unregister_activity_stream_client()
view.shutdown() # that node.destroy_publisher call makes havoc
response.result = True
break
self.views[:] = [view for view in self.views if view.topic_name != request.topic_name]
self.unregister_activity_stream_client()
return response

def _get_variables_service(self, unused_request, response):
Expand All @@ -382,10 +383,6 @@ def _open_service(self, request, response):
with_activity_stream=request.with_activity_stream
)
self.views.append(view)
if any([view.with_activity_stream for view in self.views]):
py_trees.blackboard.Blackboard.enable_activity_stream()
else:
py_trees.blackboard.Blackboard.disable_activity_stream()
return response

##############################################################################
Expand Down

0 comments on commit ac61cfe

Please sign in to comment.