Main Page
Namespaces
Classes
Files
File List
src
flexbe_states
publisher_bool_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
Bool
7
8
'''
9
Created on 31.01.2017
10
11
@author: Alberto Romay
12
'''
13
14
15
class
PublisherBoolState
(EventState):
16
'''
17
Publishes an empty (std_msgs/Bool) message on a given topic name.
18
19
-- topic string The topic on which should be published.
20
21
>= value Value of bool.
22
23
<= done Done publishing.
24
25
'''
26
27
def
__init__
(self, topic):
28
'''
29
Constructor
30
'''
31
super(PublisherBoolState, self).
__init__
(outcomes=[
'done'
], input_keys=[
'value'
])
32
33
self.
_topic
= topic
34
self.
_pub
= ProxyPublisher({self.
_topic
: Bool})
35
36
def
execute
(self, userdata):
37
return
'done'
38
39
def
on_enter
(self, userdata):
40
val = Bool()
41
val.data = userdata.value
42
self._pub.publish(self.
_topic
, val)
flexbe_states.publisher_bool_state.PublisherBoolState._topic
_topic
Definition:
publisher_bool_state.py:33
flexbe_states.publisher_bool_state.PublisherBoolState
Definition:
publisher_bool_state.py:15
flexbe_states.publisher_bool_state.PublisherBoolState._pub
_pub
Definition:
publisher_bool_state.py:34
flexbe_states.publisher_bool_state.PublisherBoolState.on_enter
def on_enter(self, userdata)
Definition:
publisher_bool_state.py:39
flexbe_states.publisher_bool_state.PublisherBoolState.__init__
def __init__(self, topic)
Definition:
publisher_bool_state.py:27
flexbe_core::proxy
flexbe_states.publisher_bool_state.PublisherBoolState.execute
def execute(self, userdata)
Definition:
publisher_bool_state.py:36
flexbe_states
Author(s): Philipp Schillinger
autogenerated on Wed Jun 5 2019 21:52:08