Sarathi is composed of numerous Orocos Taskcontexts. A full description of an Orocos Taskcontext (henceforth abbreviated to 'TC') can be found in the Orocos documentation. For our purposes, it is enough to think of an Orocos TC as a software 'blob' that executes either periodically or non-periodically. Each TC can emit events and react to events emitted by other TCs. Furthermore, a TC provides functions which can either be executed in the thread of the calling TC (in Orocos terminology, these are called the 'Methods' of a Taskcontext) OR in the thread of the TC which defines the function (in Orocos terminology, these are called the 'Commands' of a Taskcontext). Methods are executed immediately when they are called (in the caller's thread) while Commands are queued up and run when the TC which defines the command is executed. Finally, each TC can have any number of buffered and unbuffered data ports, which can be connected to data ports of other TCs. These data ports can hold any type of data.
TCs can be turned 'ON' or 'OFF' by other TCs.
A distinct piece of functionality (for example, a path planner) can be executed inside a TC, whose periodicity, Methods, Commands and Data ports can be configured as necessary, for that functionality. Further, the TC can load its functionality from a plugin. Consider again, a path planner: Different planning algorithms can be implemented in different plugins and the planning TC can load a user-configured plugin at runtime. This makes it easy to swap out/in plugins without restarting/recompiling the system.
The TCs within the Sarathi system are shown in figure1 below. This architecture is largely inspired by the design patterns described in The real-time motion control core of the Orocos project by Bruyninckx, H. et al
Functions of each TC are described below:
A minimal implementation would contain the following TCs: SOAP server, Command processor, Path planner, Robot Description Plugin.
The typical event flow would be
Update: MPK is now dual licensed and can be obtained under the GNU GPLv3. Thanks to Mitul Saha for making this possible.
This section was inspired by the fact that the MPK library is ”..free for research and non-commercial use only.” This license is incompatible with the GPL, and as such, it is not possible to distribute the MPK library together with the Sarathi code. Also, it is unclear if linking MPK with Sarathi constitutes a violation of the GPL. In such cases, a hack would be to create a lightweight standalone 'server' program which acts as an MPK wrapper and executes as a separate process. The server shouldn't use any GPLed code and is not released under the GPL. The path planning TC then uses this server's services (over sockets, pipes and so on) to do the path planning. Since Sarathi and the server execute as two separate processes, there is no GPL violation.
This is a horrible hack from an architectural viewpoint, but till such a time as non-free software continues to exist (and unfortunately, most academic path-planners as of this writing are not free software (as defined by the free software foundation)) workarounds such as this might be necessary.
Please note that such methods are temporary solutions only and seriously compromise the integrity of the program. Whenever possible, free software alternatives to proprietary code must be used. Growing comfortable with these temporary solutions is effectively letting the “bad guys” win.