5 from flexbe_msgs.msg
import OutcomeRequest
6 from std_msgs.msg
import UInt8, String
11 @StateLogger.log_outcomes(
'flexbe.outcomes')
14 A state that supports autonomy levels and silent mode. 15 Also, it allows being tracked by a GUI or anything else 16 as it reports each transition and its initial structure. 17 An additional method is provided to report custom status messages to the widget. 21 super(OperatableState, self).
__init__(*args, **kwargs)
44 self._pub.publish(self.
_request_topic, OutcomeRequest(outcome=self.outcomes.index(outcome),
46 Logger.localinfo(
"<-- Want result: %s > %s" % (self.
name, outcome))
47 StateLogger.log(
'flexbe.operator', self, type=
'request', request=outcome,
48 autonomy=self.parent.autonomy_level,
49 required=self.parent.get_required_autonomy(outcome))
54 elif outcome
is not None and outcome
in self.
outcomes:
55 Logger.localinfo(
"State result: %s > %s" % (self.
name, outcome))
56 self._pub.publish(self.
_outcome_topic, UInt8(self.outcomes.index(outcome)))
57 self._pub.publish(self.
_debug_topic, String(
"%s > %s" % (self.
path, outcome)))
59 StateLogger.log(
'flexbe.operator', self, type=
'forced', forced=outcome,
def _operatable_execute(self, args, kwargs)
def __init__(self, args, kwargs)
def _enable_ros_control(self)