-
Notifications
You must be signed in to change notification settings - Fork 78
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
tutorial #271
Comments
It might be a misconception. The definition you are biased to is probably from eletronics. The most recurrent state machine on eletronics are those created by Mealy and Moore. These requires input, memory and output. The ideas given here are rather permissive than reactive. The developer mindset was not focused on developing an automatic connected net, although it might be implemented with such. |
So can you easily add some condition to change state? For example states: start, fill, wash, drain |
I seem to be equally biased, could you please elaborate a bit on
The syntactic sugar supplied by the package is tempting, but even looking at the tests in the package I can't see how to use it in a real-world application. Is anyone using this in a relatively simple context. Any pointers would be greatly appreciated. |
I too am struggling with figuring out how to use the python-statemachine package to implement a load conscious, event driven FSM architecture. I have figured out to put transition tests in "on_entry_stateA()" and transition actions in "on_transitionA2B()" and a "cycle transition" which is a null event (transition to itself) for every state. This design allows yielding the processor when no event is present, and testing for events when given the processor, BUT the processing is not limited when events are actually present - the states "run away" - continuing to transition until a state cannot transition. Fragments from my current design: drive.py which simulates an FSM to drive a robot until an obstacle appears.
If there are no events to be processed, the loop executes only the null transition and the event check of the current state.
(In one try, I had two states transition to each other until the stack overflowed.) |
I may be completely wrong, but It will serve to hold back expectations until the specialist @fgmacedo Is here to clear architecture design out. From my perspective, this library inspires itself in the concept of a static state-machine, which means it is driven by intended interface transition trigger actions. My understanding about your interpretation regards a dynamic interaction between output entries and inner states, which classifies as a finite automata (nomination is sensitive at this point, I got myself confusing it while discussing with this library's author). You might reach this complexity type with this library, but it will require some creativity at transitions activation. |
@slowrunner It has been a while since you gave a thumbs-up on this issue. Have you accomplished any progress on your demands, with or without these library features? |
I was able to determine the strengths of the package and what adaptations would be needed to form the basis for autonomous mobile robot control, but my focus moved to ROS2 and intend to learn behavior trees as a control structure. Many folks are suggesting behavior trees are more expressive for the complex resource constrained decisions needed in mobile robots. |
I am glad you solved your curiosity issues. ROS is popular. I am not familiar with ROS2. Decision-making is environment dependent on robotics. However, it is off-topic here. |
Took a while, but for now, some of your questions are better documented:
Please let me know if you have any other issues. |
This Looks like an interesting package!!
I can see that you can set up states (say MONITOR, FIRE, FLOOD, PUMPING, NOTIFY)
I also see you can name transitions (say: see_smoke=monitor.to(fire)
However, the package traffic light example only shows transitions being manually activated (typed in), not reacting to various inputs (triggers?)
Programmatically, how/where do you do this checking of inputs or conditions (such as change state when time=12:45?) What triggers this transition? Say a GPIO pin was going high to show smoke detected, where is that placed in the code? (if smoke detected, in monitor state, transition to fire state)
Are the transitions automatically checked & actions taken for the particular current state? Can actions be added when entering or leaving states? Say I had the typical vending machine example & had some switches to read coins, hit the dispense button, etc...are there any more examples?
The text was updated successfully, but these errors were encountered: