PluginLib declaring template classes
Hi! Using template classes with the PluginLib looks interesting. However I've found several problems when I tried it. Firstly the macro PLUGINLIB_DECLARE_CLASS does not look to work with template classes, even using the typical "parameter pareteses for macros" [See Code 1], it finally worked using typedefs [See Code 2]. I would like to automate this mechanism to easily generate plugin classes.
I would like to declare a plugin for each template class instantiation in the code. For that I though two alternatives: - using the PLUGINLIB_DECLARE_CLASS in the class scope -> it didn't worked. The internal pocolib complains about it. - using metaprograming to generate in the root scope all the possible combinations of template class instantiation. Any Idea?(I think PCL do things like that). Finally I think it would be necesary a macro for stringfy a template classname for the 2nd parameter of the PLUGINLIB_DECLARE_CLASS. Any Idea about how to do this?
CODE 1
#include <pluginlib class_list_macros.h=""> //----- wrong plugin declaration -------- PLUGINLIB_DECLARE_CLASS(rtcus_navigation, default_ds_twist, (DefaultStateEstimation<DynamicState2D,Twist2D>), (StateEstimtion<DynamicState2D,Twist2D>))
CODE 2
//---- working template class plugin declaration -------- typedef StateEstimtion<DynamicState2D,Twist2D> base; typedef DefaultStateEstimation<DynamicState2D,Twist2D> default_ds_twist; PLUGINLIB_DECLARE_CLASS(rtcus_navigation, default_DynamicState2D_Twist2D,default_ds_twist,base)