executive_smach
executive_smach copied to clipboard
When does the "execute" function of the State class get called?
I'm reading the documents of the generic State class and trying to use it with ROS system. I'm just curious when does the execute
function of the State class get called?
class Foo(smach.State):
def __init__(self, outcomes=['outcome1', 'outcome2']):
# Your state initialization goes here
# When does this function get called? <---------------
def execute(self, userdata):
# Your state execution goes here
if xxxx:
return 'outcome1'
else:
return 'outcome2'
maybe in this line of code ? https://github.com/ros/executive_smach/blob/31cc55743431f48e37ee71d26acd5833ebd3753e/smach/src/smach/iterator.py#L164