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
from
flexbe_core
import
EventState
3
from
flexbe_core.proxy
import
ProxyPublisher
4
from
std_msgs.msg
import
Bool
5
6
7
class
PublisherBoolState
(EventState):
8
'''
9
Publishes an empty (std_msgs/Bool) message on a given topic name.
10
11
-- topic string The topic on which should be published.
12
13
>= value Value of bool.
14
15
<= done Done publishing.
16
'''
17
18
def
__init__
(self, topic):
19
super(PublisherBoolState, self).
__init__
(outcomes=[
'done'
], input_keys=[
'value'
])
20
self.
_topic
= topic
21
self.
_pub
= ProxyPublisher({self.
_topic
: Bool})
22
23
def
execute
(self, userdata):
24
return
'done'
25
26
def
on_enter
(self, userdata):
27
val = Bool()
28
val.data = userdata.value
29
self._pub.publish(self.
_topic
, val)
flexbe_states.publisher_bool_state.PublisherBoolState._topic
_topic
Definition:
publisher_bool_state.py:20
flexbe_states.publisher_bool_state.PublisherBoolState
Definition:
publisher_bool_state.py:7
flexbe_states.publisher_bool_state.PublisherBoolState._pub
_pub
Definition:
publisher_bool_state.py:21
flexbe_states.publisher_bool_state.PublisherBoolState.on_enter
def on_enter(self, userdata)
Definition:
publisher_bool_state.py:26
flexbe_states.publisher_bool_state.PublisherBoolState.__init__
def __init__(self, topic)
Definition:
publisher_bool_state.py:18
flexbe_core::proxy
flexbe_states.publisher_bool_state.PublisherBoolState.execute
def execute(self, userdata)
Definition:
publisher_bool_state.py:23
flexbe_states
Author(s): Philipp Schillinger
autogenerated on Sun Dec 13 2020 04:01:46