moveit_calibration icon indicating copy to clipboard operation
moveit_calibration copied to clipboard

Plugin library is not found after building

Open felixvd opened this issue 4 years ago • 32 comments

I just added and built this package, but get this error when I try to add the panel in Rviz:

The class required for this panel, 'moveit_rviz_plugin/HandEyeCalibration', could not be loaded.
Error:
Failed to load library /root/underlay_ws/devel/lib/libmoveit_handeye_calibration_rviz_plugin.so. 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 = libmoveit_planning_scene_monitor.so.1.0.4: cannot open shared object file: No such file or directory)

In the terminal, almost the same text is displayed, except the first sentence is PluginlibFactory: The plugin for class 'moveit_rviz_plugin/HandEyeCalibration' failed to load.

Has anyone else encountered this? I did not find anything upon cursory googling. Maybe it is a simple setup issue one of you has run into before.

felixvd avatar Jun 21 '20 18:06 felixvd

I'll be annoying and ping @JStech and @RoboticsYY just in case

felixvd avatar Jun 22 '20 05:06 felixvd

Heh--thanks. I'll see what I can figure out, although I've not run into this myself.

JStech avatar Jun 22 '20 15:06 JStech

It looks like PLUGINLIB_EXPORT_CLASS just calls (er, expands to) CLASS_LOADER_REGISTER_CLASS (defined here), which is in moveit_calibration_gui/handeye_calibration_rviz_plugin/src/plugin_init.cpp.

Maybe try replacing that CLASS_LOADER_REGISTER_CLASS call with PLUGINLIB_EXPORT_CLASS and see if it's happy? I made this change and it built, but I don't know if it fixes this issue, since it didn't happen to me in the first place.

JStech avatar Jun 22 '20 18:06 JStech

Another idea. What, exactly, are you building? The GUI plugin isn't merged into master yet. You should check out charuco-with-rviz from my fork

JStech avatar Jun 22 '20 20:06 JStech

Another idea. What, exactly, are you building? The GUI plugin isn't merged into master yet. You should check out charuco-with-rviz from my fork

Hi @JStech, Since the parameter loading has been changed in PR #7, PR #4 is not working with the current target plugin any more. Could you please file a PR from your branch charuco-with-rviz to PR #4?

RoboticsYY avatar Jun 23 '20 02:06 RoboticsYY

Hi @RoboticsYY , I did file this PR: RoboticsYY/moveit_calibration#2, although maybe I filed it in the wrong place (still kinda new to GitHub). I also see now that it has merge conflicts. I'll try to figure it out.

JStech avatar Jun 23 '20 03:06 JStech

Hi @RoboticsYY , I did file this PR: RoboticsYY#2, although maybe I filed it in the wrong place (still kinda new to GitHub). I also see now that it has merge conflicts. I'll try to figure it out.

Sorry, I missed it. I will rebase PR #4 to master branch, I think this can resolve most of the conflicts.

RoboticsYY avatar Jun 23 '20 03:06 RoboticsYY

Thanks for trying to fix the issue. I appreciate other people taking care of the dark arts.

Maybe try replacing that CLASS_LOADER_REGISTER_CLASS call with PLUGINLIB_EXPORT_CLASS and see if it's happy?

That gives me error: expected constructor, destructor, or type conversion at the end of input for that line. Do I need to add anything?

What, exactly, are you building?

I just merged the two open PRs of the RoboticsYY repo into the master of this one locally and tried to build it :0

felixvd avatar Jun 23 '20 05:06 felixvd

@JStech I have rebased PR #4 to the master branch. This resolved some conflicts. For the rest conflicts, could you please rebase the branch charuco-with-rviz to the branch pr-add_handeye_calibration_rviz_plugin? When the conflicts are resolved, I will test with a camera and merge it into PR #4.

RoboticsYY avatar Jun 24 '20 04:06 RoboticsYY

@felixvd I think it also needs #include <pluginlib/class_list_macros.h>, which can replace the class_loader include.

JStech avatar Jun 25 '20 14:06 JStech

Sadly that didn't solve it. I wonder what my problem is. It thought it might be something to do with my workspace setup, but moving it into another one did not change anything.

felixvd avatar Jun 29 '20 08:06 felixvd

I have the same issue, I merged PR4 into master, also used info from PR5 to install opencv 3.4 packages. gui failed to build, which lead to the same error being thrown when I try to add the panel.

ros-gy avatar Jun 29 '20 13:06 ros-gy

That sounds like you should try to get your build to succeed first. What is the error?

For the record, I have no build errors, and when the PR was still on the main moveit repo I had built and added the plugin successfully, so maybe something has changed since.

felixvd avatar Jun 29 '20 13:06 felixvd

The error is below. I had built and successfully run the plugin previously, but needed to rebuild it as I was working with some other moveit packages.

Starting >>> moveit_calibration_gui
--- EDIT --- remove unnecessary info. Failed << moveit_calibration_gui:make [ Exited with code 2 ]
Failed <<< moveit_calibration_gui [ 25.2 seconds ]

ros-gy avatar Jun 29 '20 13:06 ros-gy

@felixvd I have made a fresh build with @JStech 's branch, I didn't come into the error that you met when loading the Rviz plugin. I noticed that in your error message Rviz tried to load the plugin from /devel. Recently seems catkin always create /install as default. Can you also try source the setup.bash from /install?

@ros-gy There are some changes that haven't been merged into PR #4. I believe the build errors can be resolved by using @JStech 's branch instead of PR #4 for now.

RoboticsYY avatar Jun 29 '20 14:06 RoboticsYY

Thanks, that branch built and loaded the plugin successfully.

ros-gy avatar Jun 29 '20 15:06 ros-gy

My workspace isn't set up to install, so there's no install directory after building. I managed to build and load the plugin on another machine with the branch you linked though, so it is definitely something to do with the workspace.

edit: Still getting the same error, but the binary ..._ws/devel/lib/libmoveit_handeye_calibration_rviz_plugin.so exists. The error mentions this: Could not load library (Poco exception = libmoveit_planning_scene_monitor.so.1.0.4: cannot open shared object file: No such file or directory), but I have libmoveit_planning_scene_monitor.so.1.1.0 in my workspace's devel/lib. Why is the plugin looking for an older version? I wonder where this number is coming from, considering that the moveit binaries in opt/ros/melodic/lib are 1.0.3 and the master branch I am compiling from source is 1.1.0. The number 1.0.4 does not appear anywhere in my workspace or even in /opt/ros/melodic! Tempted to ping @tylerjw for ideas.

PS: Naturally I clean the workspace before building.

felixvd avatar Jun 30 '20 11:06 felixvd

I'm curious if you were able to figure this out, @felixvd

JStech avatar Aug 05 '20 05:08 JStech

No, I have been calibrating with an internal package :(

felixvd avatar Aug 05 '20 07:08 felixvd

My new theory is that planning_scene_monitor is in the moveit_ros_planning package, but the CMakeLists.txt and package.xml for moveit_calibration_gui don't list that as a dependency (they do have moveit_ros_planning_interface, which of course is not the same thing), so it's just the wild west when your compiler goes looking for a library to link against. Maybe try this branch? https://github.com/JStech/moveit_calibration/tree/cmake-deps

JStech avatar Aug 05 '20 15:08 JStech

For the record, I tried this again with master, and now it just crashes on load. Hm.

felixvd avatar Sep 10 '20 00:09 felixvd

Hm indeed. Is it still giving an error about the libmoveit_planning_scene_monitor.so version? I should update that branch and open a PR for it.

JStech avatar Sep 10 '20 19:09 JStech

I think that this (#61) might fix it. Could you give it a try?

ValerioMagnago avatar Jan 28 '21 22:01 ValerioMagnago

I am having this same issue. Any ideas on how to solve it yet?

Thanks!

Sofiap91 avatar Mar 24 '21 21:03 Sofiap91

@Sofiap91 you've pulled master recently? (as in, since 1 February)

Unfortunately, I've not been able to reproduce this, so I can't figure out what's going wrong. I was hoping that #61 had fixed it . . .

JStech avatar Mar 25 '21 04:03 JStech

@JStech yes, yesterday actually.

Sofiap91 avatar Mar 25 '21 15:03 Sofiap91

Well, shoot. Could you please share the error message that's being reported?

JStech avatar Mar 25 '21 18:03 JStech

@JStech The error on Rviz is the following: The class required for this panel, 'moveit_rviz_plugin/HandEyeCalibration', could not be loaded. Error: Could not find library corresponding to plugin moveit_rviz_plugin/HandEyeCalibration. Make sure the plugin description XML file has the correct name of the library and that the library actually exists.

Sofiap91 avatar Mar 26 '21 14:03 Sofiap91

That looks like a slightly different error--it's not finding the library, whereas Felix's issue was that the library was found but was not loading (because it couldn't find yet another library). But I still don't know what to do about it--sorry

JStech avatar Mar 29 '21 20:03 JStech

Trying building the rviz_visual_tools package from source.

worked for me.

SnehalDikhale avatar Feb 03 '23 02:02 SnehalDikhale