Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When does the "execute" function of the State class get called? #78

Open
witignite opened this issue Oct 12, 2020 · 1 comment
Open

Comments

@witignite
Copy link

witignite commented Oct 12, 2020

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'
@Tutorgaming
Copy link

maybe in this line of code ?

outcome = self._state.execute(self.userdata)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants