9 from flexbe_msgs.msg
import CommandFeedback
10 from std_msgs.msg
import Bool, Empty
15 A state that allows implementing certain events. 19 super(EventState, self).
__init__(*args, **kwargs)
33 self.
_pub = ProxyPublisher()
34 self.
_sub = ProxySubscriberCached()
42 rospy.loginfo(
"--> Pausing in state %s", self.
name)
43 self._pub.publish(self.
_feedback_topic, CommandFeedback(command=
"pause"))
45 PriorityContainer.active_container =
'' 48 if self.
_paused and not PreemptableState.preempt:
59 execute_outcome = self.
__execute(*args, **kwargs)
63 rospy.loginfo(
"--> Repeating state %s", self.
name)
65 self._pub.publish(self.
_feedback_topic, CommandFeedback(command=
"repeat"))
68 if execute_outcome != self.
_loopback_name and not PreemptableState.switching \
73 return execute_outcome
83 rospy.loginfo(
"--> Resuming in state %s", self.
name)
84 self._pub.publish(self.
_feedback_topic, CommandFeedback(command=
"resume"))
103 PriorityContainer.active_container =
None 111 Will be executed once when the behavior starts. 117 Will be executed once when the behavior stops or is preempted. 123 Will be executed each time this state is paused. 129 Will be executed each time this state is resumed. 135 Will be executed each time the state is entered from any other state (but not from itself). 141 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)