ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

ROS on Windows: error loading controller as a plugin.

asked 2022-11-15 05:21:22 -0600

enricovilla gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-01-16 05:23:21 -0600

enricovilla gravatar image

UPDATE: the error above was misleading. In my case, the custom controller used a library as a dependency. The library was compiled as .dll; the only way I found to make the controller work was to copy the .dll locally to the folder devel/bin. This fixes the error.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-11-15 05:21:22 -0600

Seen: 75 times

Last updated: Jan 16