publisher_empty_state.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 
00004 from flexbe_core import EventState, Logger
00005 from flexbe_core.proxy import ProxyPublisher
00006 from std_msgs.msg import Empty
00007 
00008 '''
00009 Created on 31.01.2017
00010 
00011 @author: Alberto Romay
00012 '''
00013 
00014 
00015 class PublisherEmptyState(EventState):
00016     '''
00017         Publishes an empty (std_msgs/Empty) message on a given topic name.
00018 
00019         -- topic        string          The topic on which should be published.
00020 
00021         <= done                                         Done publishing.
00022 
00023         '''
00024 
00025     def __init__(self, topic):
00026         '''
00027                 Constructor
00028                 '''
00029         super(PublisherEmptyState, self).__init__(outcomes=['done'])
00030 
00031         self._topic = topic
00032         self._pub = ProxyPublisher({self._topic: Empty})
00033 
00034     def execute(self, userdata):
00035         return 'done'
00036 
00037     def on_enter(self, userdata):
00038         self._pub.publish(self._topic, Empty())


flexbe_states
Author(s): Philipp Schillinger
autogenerated on Thu Jun 6 2019 19:32:33