Code Monkey home page Code Monkey logo

rfsm's Introduction

rFSM logo

rFSM Statecharts (v1.0)

What is it?

rFSM is a small and powerful Statechart implementation. It is mainly used for Coordination of complex systems but is not limited to that. rFSM is written in pure Lua and is therefore highly portable and embeddable. As a Lua domain specific language rFSM inherits the extensibility of its host language.

Documentation

See the rFSM documentation

Information about how to use rFSM using the OROCOS RTT Framework can be found here.

Download

The code can be found in this git repository.

A cheatsheet summarizing the DSL is available here.

License

rFSM is licensed under the BSD-3-Clause

Contact

Please direct questions, bugs or improvements to the orocos-users mailing list.

Acknowledgement

  • Funding

    The research leading to these results has received funding from the European Community's Seventh Framework Programme (FP7/2007-2013) under grant agreement no. FP7-ICT-231940-BRICS (Best Practice in Robotics)

  • Scientific background

    This work borrows many ideas from the Statecharts by David Harel and some from UML 2.1 State Machines. The following publications are the most relevant

    David Harel and Amnon Naamad. 1996. The STATEMATE semantics of statecharts. ACM Trans. Softw. Eng. Methodol. 5, 4 (October 1996), 293-333. DOI=10.1145/235321.235322 http://doi.acm.org/10.1145/235321.235322

    The OMG UML Specification: http://www.omg.org/spec/UML/2.3/Superstructure/PDF/

rfsm's People

Contributors

dvanthienen avatar frankvanbever avatar gborghesan avatar kmarkus avatar ledvinap avatar meyerj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rfsm's Issues

invalid escape sequence near '\.'

lua: ...isolated/src/orocos/orocos_toolchain/rFSM/tools/rfsm-viz:72: invalid escape sequence near '.'
when i try to run a lua deployer with rfsm-viz i get above error.

Missing fsmdbg module

I have a problem when running rfsm-dbg ... I seem to be missing the fsmdbg module. Can you help me?

$ head tools/rfsm-dbg 
#!/usr/bin/env lua
-- -*- lua -*-

require("rfsm")
require("fsmdbg")    -- THIS LINE

COPYING file specifices GPL3 is this correct?

The COPYING file specifies GPL3, but the READme.md says "rFSM is dual licensed under LGPL/BSD."

and the headers (at least some of them say GPL-2.

Can we get some clarity on this, and perhaps update the COPYING file.

adding an event to an 'initial' transition causes rFSM to stall, without throwing an error

Adding an event to an 'initial' transition causes rFSM to stall, without throwing an error.
For example rfsm.trans{src="initial", tgt="stateA", events={"e_done"}}.
Especially when this transition is part of a hierachical FSM:
uplevel = rfsm.state{
stateAA=rfsm.state{},
stateBB=rfsm.state{
stateA = rfsm.state{},
rfsm.trans{src="initial", tgt="stateA", events={"e_done"}},
},
rfsm.trans{src="initial", tgt="stateAA"},
rfsm.trans{src="stateAA", tgt="stateBB", events={"e_done"}}
}

rFSM does not make the exit of the previous state (state AA), just stays in this state.
There is no hint whatsoever that it is a transition in a next sub-state that causes the error.
Especially annoying when the sub-states are in different files...

rfsm2dot fail with graph depth>2

I'm a new user of rFSM but it seems to me that rfsm2uml.rfsm2dot() does not handle graph with too much (>2) depth.
I've run the following code :

require "rfsm"
require "rfsm2uml"

fsm = rfsm.init(rfsm.load("test_fsm.lua") )

rfsm2uml.rfsm2dot(fsm, "test-uml.dot")

With test_fsm.lua :

return rfsm.state {
    configured = rfsm.state {},
    operationnal = rfsm.state {  
      idle = rfsm.state {},
      --== Manual states ==-
      joint_pos = rfsm.state {  
        running = rfsm.state {},
        done = rfsm.state {},

        --============================== Joint pos transitions =================================== 
        rfsm.trans {src="initial", tgt="running" },
        rfsm.trans {src="running",tgt="done", events={'joint_pos.done'}},
      },
      --============================== Operational transitions =================================== 
      rfsm.trans {src="initial", tgt="idle" },
      rfsm.trans {src="joint_pos",tgt="idle", events={'idle'}},
      rfsm.trans {src="idle",tgt="joint_pos", events={'joint_pos'}},
    },
  
    --============================== Main transitions =================================== 
    rfsm.trans {src="initial", tgt="configured" },
    rfsm.trans {src="configured", tgt="operationnal", events={'start'}},
    rfsm.trans {src="operationnal", tgt="configured", events={'stop'}},
  }

While everything is running fine when removing states & transitions inside joint_pos state, rfsm2uml.rfsm2dot will fail with those. Even if the underlying FSM seems to be working fine.
It gives the following error while run by rttlua :

Real-time memory: 517888 bytes free of 524288 allocated.
OROCOS RTTLua 1.0-beta5 / Lua 5.1.5 (gnulinux)
INFO: created undeclared connector root.initial
INFO: created undeclared connector root.operationnal.initial
INFO: created undeclared connector root.operationnal.joint_pos.initial
WARNING: no outgoing transitions from node 'root.operationnal.joint_pos.done'
No state 'root.operationnal.joint_pos'
/home/antoineh/orocos/foxy/bin/rttlua-gnulinux: ...integration/src/rtt_ros2_utilities/rFSM/rfsm2uml.lua:136: assertion failed!
stack traceback:
	[C]: in function 'assert'
	...integration/src/rtt_ros2_utilities/rFSM/rfsm2uml.lua:136: in function 'new_sista'
	...integration/src/rtt_ros2_utilities/rFSM/rfsm2uml.lua:250: in function 'proc_node'
	...integration/src/rtt_ros2_utilities/rFSM/rfsm2uml.lua:272: in function 'func'
	...os2-integration/src/rtt_ros2_utilities/rFSM/rfsm.lua:233: in function 'f'
	/home/antoineh/orocos/foxy/share/lua/5.1/utils.lua:246: in function 'map'
	...os2-integration/src/rtt_ros2_utilities/rFSM/rfsm.lua:229: in function '__mapfsm'
	...os2-integration/src/rtt_ros2_utilities/rFSM/rfsm.lua:236: in function 'f'
	/home/antoineh/orocos/foxy/share/lua/5.1/utils.lua:246: in function 'map'
	...os2-integration/src/rtt_ros2_utilities/rFSM/rfsm.lua:229: in function '__mapfsm'
	...os2-integration/src/rtt_ros2_utilities/rFSM/rfsm.lua:236: in function 'f'
	/home/antoineh/orocos/foxy/share/lua/5.1/utils.lua:246: in function 'map'
	...os2-integration/src/rtt_ros2_utilities/rFSM/rfsm.lua:229: in function '__mapfsm'
	...os2-integration/src/rtt_ros2_utilities/rFSM/rfsm.lua:244: in function 'mapfsm'
	...integration/src/rtt_ros2_utilities/rFSM/rfsm2uml.lua:270: in function 'fsm2gh'
	...integration/src/rtt_ros2_utilities/rFSM/rfsm2uml.lua:298: in function 'rfsm2dot'
	test.lua:6: in main chunk
	[C]: ?
TLSF bytes allocated=524288 overhead=6400 max-used=6400 currently-used=6400 still-allocated=0

rfsm-viz save location syntax error

/opt/ros/indigo/lib/rfsm/rfsm-viz all -f /home/me/test.lua
returns
lua: /opt/ros/indigo/lib/rfsm/rfsm-viz:72: invalid escape sequence near '\.'

queued events are dropped in step()?

If there are several events in the queue, only the one(s) triggering the first (highest prio) transition will be considered. All other events will be dropped silently. What is the rationale behind this?

If events arrive faster than you can process them, i.e. there will be a queue with more than one element,
you will loose some of these events.

Is this intended behavior?

Using an auxiliary state machine twice in another state machine, but load and run it once.

I am wondering if there is any modification that can be done, such that I can have two load statements in the same file but still have one instance. The design of the code is such that I need to have this same auxiliary state under two composite states.
I tried to make another implementation of rfsm.load which uses require, but it fails. I have made a post here that describes my problem. Any ideas and/or pointers?
https://stackoverflow.com/questions/72721508/avoid-loading-the-same-script-twice-with-rfsm-library-in-lua

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.