Skip to content

Allow overriding already registered plugins #2727

@DavidPL1

Description

@DavidPL1

The feature, motivation and pitch

I have locally modified the SDF plugin by adding more configuration options for a specific project.
When using the python bindings, the plugin can not be loaded because a call to mujoco.mj_loadPluginLibrary with the modified plugin library will error due to the plugins of libsdf_plugin.so already being registered.

Using the modified plugin library actually requires removing libsdf_plugin.so from the python package's install path. (Or building and installing the python package from source, which is obviously overkill).

I'd like the option to intentionally override an already registered plugin, maybe by using an override_existing bool as second argument to the mj_loadPluginLibrary call. WARN or INFO prints of overridden plugins could be helpful and defaulting the bool to false would retain the current behavior of exiting with an error in case an override is not intentional.

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions