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


flexbe_states
Author(s): Philipp Schillinger
autogenerated on Sun Dec 13 2020 04:01:46