ROS on Windows: error loading controller as a plugin.
Hi all,
I developed custom controllers as plugins of ros_control package. Everything works smoothly on ROS Noetic in Ubuntu. Currently, I'm trying to port the same packages in Windows. All the packages compile in Windows, and I can generate the controller as a .dll library in the right folder. The problem arises when I try to load the controller; I always get the same error:
[ERROR] [1668438174.709061300]: Could not load class 'position_controllers/NameOfTheController': Failed to load library C:/path_to_controller/name_of_the_controller.dll. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = C:/path_to_controller/name_of_the_controller.dll)
[ERROR] [1668438174.709787900]: Could not load controller 'name_of_the_controller' because controller type 'position_controllers/NameOfTheController' does not exist.
The controller is present as .dll in the directory where ROS is looking for. PLUGINLIB_EXPORT_CLASS is properly called, and all the names are consistent otherwise, the plugin should not work in Ubuntu. Does anyone have a similar problem?
Looking forward to any reply! Thanks!
Enrico