![]() |
Generic State
Description: This tutorial show how to implement a generic SMACH StateTutorial Level: BEGINNER
Next Tutorial: CB State
1 from smach import State
The most general (but often least efficient) way to create a state is to derive from the 'State' base class. You can pretty much do anything you want in the execute method of a state. Know that SMACH comes with a library of useful states that you can use, without having to write a whole custom state.
Some good code practices:
- Do not block in your constructor. If your state needs to wait for another component to come up, do this in a separate thread