publisher_empty_state.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 
4 from flexbe_core import EventState, Logger
5 from flexbe_core.proxy import ProxyPublisher
6 from std_msgs.msg import Empty
7 
8 '''
9 Created on 31.01.2017
10 
11 @author: Alberto Romay
12 '''
13 
14 
15 class PublisherEmptyState(EventState):
16  '''
17  Publishes an empty (std_msgs/Empty) message on a given topic name.
18 
19  -- topic string The topic on which should be published.
20 
21  <= done Done publishing.
22 
23  '''
24 
25  def __init__(self, topic):
26  '''
27  Constructor
28  '''
29  super(PublisherEmptyState, self).__init__(outcomes=['done'])
30 
31  self._topic = topic
32  self._pub = ProxyPublisher({self._topic: Empty})
33 
34  def execute(self, userdata):
35  return 'done'
36 
37  def on_enter(self, userdata):
38  self._pub.publish(self._topic, Empty())


flexbe_states
Author(s): Philipp Schillinger
autogenerated on Wed Jun 5 2019 21:52:08