Home | Trees | Indices | Help |
|
---|
|
StateMachine
This is a finite state machine smach container. Note that though this is a state machine, it also implements the smach.State interface, so these can be composed hierarchically, if such a pattern is desired.
States are added to the state machine as 3-tuple specifications:
The label is a string, the state instance is any class that implements the smach.State interface, and transitions is a dictionary mapping strings onto strings which represent the transitions out of this new state. Transitions can take one of three forms:
Instance Methods | |||
|
|||
|
|||
|
|||
dict of string: State |
|
||
smach.State |
|
||
|
|||
list of string |
|
||
list of string |
|
||
list of 3-tuple |
|
||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|||
Inherited from container.Container | |||
---|---|---|---|
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
bool |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from state.State | |||
|
|||
tuple of string |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Static Methods | |||
|
|||
|
Instance Variables | |
Inherited from container.Container | |
---|---|
userdata Userdata to be passed to child states. |
Properties | |
Inherited from |
Method Details |
Constructor for smach StateMachine Container.
|
Add a state to the opened state machine.
|
Add a state to the state machine such that it automatically transitions to the next added state. Each state added will receive an additional transition from it to the state which is added after it. The transition will follow the outcome specified at construction of this container.
|
Run the state machine on entry to this state. This will set the "closed" flag and spin up the execute thread. Once this flag has been set, it will prevent more states from being added to the state machine.
|
Propagate preempt to currently active state. This will attempt to preempt the currently active state.
|
Get the children of this container. This is empty for leaf states.
|
Access child state by key.
|
Set initial active state of a container.
|
Get a description of the current state. Note that this is specific to container implementation.
|
Get the initial state description.
|
Get the internal outcome edges of this container. Get a list of 3-tuples (OUTCOME, LABEL_FROM, LABEL_TO) which coresspond to transitions inside this container.
|
Validate full state specification (label, state, and transitions). This checks to make sure the required variables are in the state spec, as well as verifies that all outcomes referenced in the transitions are registered as valid outcomes in the state object. If a state specification fails validation, a smach.InvalidStateError is thrown. |
Check the entire state machine for consistency. This asserts that all transition targets are states that are in the state machine. If this fails, it raises an InvalidTransitionError with relevant information.
|
Propagate an updated userdata structure into this state machine.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Apr 24 15:33:14 2014 | http://epydoc.sourceforge.net |