Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple instances of the same plugin type point to the same single object in memory #13

Open
marip8 opened this issue Sep 16, 2022 · 3 comments

Comments

@marip8
Copy link
Contributor

marip8 commented Sep 16, 2022

I have a use case where I want to create several instances of the same type of plugin but initialize them with different parameters. However, when I load these multiple instances, they all point to the same underlying object in memory. This test case shows the failure.

Per the documentation it seems like boost is designed to load a shared library and have multiple references to it, but I haven't been able to find any documentation or issues with this specific problem

@Levi-Armstrong
Copy link
Contributor

Interesting. Usually I make the plugin a factory which produces a new object each time which is probably why I never ran into this issue.

@marip8
Copy link
Contributor Author

marip8 commented Sep 16, 2022

I think the factories that exist in tesseract suffer from the same problem because they still only hold onto a single PluginLoader object and can theoretically call createInstance multiple times for the same plugin type. We probably haven't run into this issue yet because you usually don't need to create more than one instance of any plugin. You could imagine potentially making multiple instances of the same type of IK solver or collision checking plugin with different parameters though

@Levi-Armstrong
Copy link
Contributor

Levi-Armstrong commented Sep 16, 2022

It does this now but because the plugin is not the IK solver or Collision checker but a object which produces theses it is not an issue if you get the same factory every time and it would produce a unique IK Solver or Collision checker. Now if tesseract was changed such that the plugin was the IK solver or collision checker the issue you found would be an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants