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.publisher_empty_state.PublisherEmptyState._pub
_pub
Definition: publisher_empty_state.py:19
flexbe_states.publisher_empty_state.PublisherEmptyState.execute
def execute(self, userdata)
Definition: publisher_empty_state.py:21
flexbe_states.publisher_empty_state.PublisherEmptyState._topic
_topic
Definition: publisher_empty_state.py:18
flexbe_states.publisher_empty_state.PublisherEmptyState.on_enter
def on_enter(self, userdata)
Definition: publisher_empty_state.py:24
flexbe_states.publisher_empty_state.PublisherEmptyState.__init__
def __init__(self, topic)
Definition: publisher_empty_state.py:16
flexbe_core::proxy
flexbe_states.publisher_empty_state.PublisherEmptyState
Definition: publisher_empty_state.py:7


flexbe_states
Author(s): Philipp Schillinger
autogenerated on Fri Jul 21 2023 02:26:17