3 from rospy.exceptions
import ROSInterruptException
4 from flexbe_core
import EventState
7 from std_msgs.msg
import String, UInt8
12 This state will display its possible outcomes as buttons in the GUI 13 and is designed in a way to be created dynamically. 16 def __init__(self, target_name, target_path, given_outcomes, outcome_autonomy):
17 super(MirrorState, self).
__init__(outcomes=given_outcomes)
24 self.
_pub = ProxyPublisher()
30 if msg.data < len(self.outcomes):
31 rospy.loginfo(
"State update: %s > %s", self.
_target_name, self.outcomes[msg.data])
32 return self.outcomes[msg.data]
35 except ROSInterruptException:
36 print(
'Interrupted mirror sleep.')
39 self._pub.publish(
'flexbe/behavior_update', String(
"/" +
"/".join(self._target_path.split(
"/")[1:])))
def __init__(self, target_name, target_path, given_outcomes, outcome_autonomy)
def on_enter(self, userdata)
def execute(self, userdata)