Skip to content

TreeExecutionServer plugin loading order mismatch docstring vs implementation #130

@thettasch-samxl

Description

@thettasch-samxl

In the TreeExecutionServer, plugins are loaded in the following order: user plugins, then parameter based plugins. See the snippet below:

// user defined method
registerNodesIntoFactory(p_->factory);
// load plugins from multiple directories
RegisterPlugins(p_->params, p_->factory, node_);

The docstring for registerNodesIntoFactory, on the other hand, claims that it is called only after the other plugins were registered:

/**
* @brief registerNodesIntoFactory is a callback invoked after the
* plugins were registered into the BT::BehaviorTreeFactory.
* It can be used to register additional custom nodes manually.
*
* @param factory The factory to use to register nodes
*/
virtual void registerNodesIntoFactory(BT::BehaviorTreeFactory& factory)
{}

So either the docstring or the implementation is wrong.

Personally, I would prefer if the order was switched in the implementation, so that registerNodesIntoFactory runs last. Then I could use it as a hook to do other things (e.g. export an XSD schema) right after all the plugins are loaded.

I don't mind contributing to fix the issue, I'd just need an indication as to which should be fixed, the implementation or the docstring,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions