Here's a simple, fast C++ component that permits scheduling "function
blocks" implemented as RTT TaskContexts in a well defined order using
the SlaveActivity. This is to minimize scheduling overhead by
serializing everything in one thread.
The function block components must be configured using SlaveActivities
and will be triggered by the FBSched component when itself is
triggered. This can be either achieved by sending events to a
"trigger" port or by configuring it with a periodic activity.
Similar scheduling could be implemented by a scripting component,
however this simple (yet common) case of just triggering a set of
function blocks in a certain order justifies a dedicated bare-metal
c++ one for ultimate efficiency :-)
Code is here:
This is a small contribution with the goal to illustrate how to do
composition of computations differs from the composition of systems
(the latter is better done using FSMs!).
Credits go to Herman for suggesting this distinction.
In a next version I plan to extend this component to measure
min/avg/max duration of each function block and of the composite to
Comments/Feedback welcome as usual!