Skip to content

Shared parameters between skills

Pontus Rosqvist requested to merge parameter_sharing into master

Using the blackboard is one of the worst things I can imagine. To mitigate this I have added the option of storing shared parameters which can exists as is or be linked to some existing object in the world model. In the worst case this turns into a system of global variables where one doesn't know where variables come from, where they're set or if a name overlaps with anything else. This is not the case for this system :)

To enable sharing parameters there are four new types of parameters options which can be used just like the existing types.

SharedInput
LinkedInput
SharedOutput
LinkedOutput

When specifying an output one has to decide its name, type and if it is linked or shared. When an output is added to a skill it is added to the world model (and the world model keeps track of if it has been set or not) but it also keeps track of which skill it comes from.

When specifying an input one therefore needs to specify both which skill the parameter comes from (has been set by) as well as its name. In forcing the user to specify which skill the parameter comes from they are forced to document so that when anyone looks at the code again they can immediately know where to look if they want to know what skill has set that parameter and how.

A shared output and input cannot have any relations, it is only a thing which can hold a set of properties. A linked output or input is a link to some existing element in the world model, no copy is made.

Merge request reports