-
Notifications
You must be signed in to change notification settings - Fork 101
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
Inheritance chains #19
Comments
@danepowell Ah, this is an interesting question! It's likely that rviz when loading plugins is looking for classes that have the interface rviz::Tool. Even though rviz::InteractionTool is an rviz::Tool, the plugin system does not know that unless you tell it explicitly through the PLUGINLIB_EXPORT_CLASS macro. I'm betting the problem isn't you deriving from rviz::InteractionTool as it is with your PLUGINLIB_EXPORT_CLASS macro. So...
Hopefully that was your issue and this resolves it. If not, just leave a comment. Also note that if you want to register plugins that can be used through any interface in the hierarchy, you can use the PLUGINLIB_EXPORT_CLASS multiple times, each time for a different base. e.g.:
Oh also note that rospack plugin querying just looks at the plugin xml files that packages export. That's what the package promises, but it may not actually contain the plugins it promises at runtime. |
Awesome! That did the trick. Maybe it's worth mentioning the multiple-PLUGINLIB_EXPORT_CLASS trick on the wiki page? |
Good idea, will do that now. |
Should inheritance 'chains' be possible with plugins? i.e., Base Class > Derived Class 1 > Derived Class 2.
My problem: I want to build a plugin (rviz::OmniTool) that uses rviz::InteractionTool as a base. But rviz::InteractionTool is already derived from rviz::Tool. So the desired inheritance is rviz::Tool > rviz::InteractionTool > rviz::OmniTool.
The problem is that rviz::OmniTool doesn't show up in rviz, although it does get returned by rospack plugins, so pluginlib knows it exists. However, if I change it to be derived directly from rviz::Tool, it shows up just fine.
Does this sound like a problem with pluginlib or rviz?
The text was updated successfully, but these errors were encountered: