Re: RFSM guards

Markus Klotzbuecher <[email protected]>
Newsgroups gmane.science.robotics.orocos.devel
Message-ID <20130918151502.GA29530@PMA-10-048>
On Mi, Sep 18, 2013 at 02:58:46 +0200, Ruben Smits wrote:
> Hi (Markus),
> I just installed guard functions on some of my transitions of a RFSM state
> machine. I expected that the guard function would only be executed when the
> transition was triggered by the installed event.  But apparently the guards are
> executed at each run of the fsm even when the event that triggers the transition
> was not raised. Is this the desired behavior or a bug?

It's desired, the guard is checked before the 'events' table
specification. As the guard is merely allowed to be a side-effect free
predicate function, the order does not matter, hence you should not
(have to) rely on it. If you need to do sth. during a transition, you
should use the 'effect' instead.

Markus


PS: Note that the 'events' table is merely a syntactic convenience,
the guard by itself would suffice to express the same behaviour. I
have a trigger module in my queue that allows to specify more complex
conditions, including AND, negation, XOR, over multiple
steps. Internally these are translated to an extended guard function.
-- 
Orocos-Dev mailing list
[email protected]
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.