7 from flexbe_msgs.msg
import CommandFeedback
8 from std_msgs.msg
import Bool, Empty
13 @StateLogger.log_events(
'flexbe.events',
14 start=
'on_start', stop=
'on_stop',
15 pause=
'on_pause', resume=
'on_resume',
16 enter=
'on_enter', exit=
'on_exit')
17 @StateLogger.log_userdata(
'flexbe.userdata')
20 A state that allows implementing certain events. 24 super(EventState, self).
__init__(*args, **kwargs)
42 Logger.localinfo(
"--> Pausing in state %s", self.
name)
43 self._pub.publish(self.
_feedback_topic, CommandFeedback(command=
"pause"))
46 PriorityContainer.active_container = self.
path 49 Logger.localinfo(
"--> Resuming in state %s", self.
name)
50 self._pub.publish(self.
_feedback_topic, CommandFeedback(command=
"resume"))
55 if self.
_paused and not PreemptableState.preempt:
62 if self.
_skipped and not PreemptableState.preempt:
70 Logger.localinfo(
"--> Repeating state %s", self.
name)
72 self._pub.publish(self.
_feedback_topic, CommandFeedback(command=
"repeat"))
75 if repeat
or outcome
is not None and not PreemptableState.preempt:
98 PriorityContainer.active_container =
None 105 Will be executed once when the behavior starts. 111 Will be executed once when the behavior stops or is preempted. 117 Will be executed each time this state is paused. 123 Will be executed each time this state is resumed. 129 Will be executed each time the state is entered from any other state (but not from itself). 135 Will be executed each time the state will be left to any other state (but not to itself). def _notify_skipped(self)
def on_enter(self, userdata)
def _enable_ros_control(self)
def _event_execute(self, args, kwargs)
def __init__(self, args, kwargs)
def on_resume(self, userdata)
def on_exit(self, userdata)
def _disable_ros_control(self)