Package Visibility
If you are going to build in separate catkin_workspace in your user account, and then use them at the same time, you need to make the package(s) available by executing cmd source devel/setup.bash
in the correct order.
So the steps for your scenario look like:
- source /opt/ros/noetic/setup.bash
- build the catkin_ws_10 workspace
- source devel/setup.bash # for catkin_ws_10
- build the catkin_ws_11 workspace
- source devel/setup.bash # for catkin_ws_11
- execute the app in catkin_ws_11
That said, my opinion is that this approach is more complicated than necessary, because you can simply put the code for both ik_load and kdl_kinematics_plugin side-by-side in the same catkin_ws/src/
directory during development.
Other Fixes
- You have the wrong filename in
kdl_kinematic_plugin/CMakeLists.txt
:
# Install the plugin description file to a custom directory
install(FILES
- plugin_description.xml
+ kdl_kinematics_plugin_description.xml
)
- In
ik_load/CMakeFiles.txt
, your catkin_package()
statement should contain no statements:
catkin_package(
- INCLUDE_DIRS include
- LIBRARIES ik_load
- CATKIN_DEPENDS roscpp pluginlib geometry_msgs moveit_core moveit_kinematics kdl_kinematic_plugin
)
- Your xml file has errors. You have:
<library path="lib/libmoveit_kdl_kinematics_plugin">
<class name="kdl_kinematics_plugin/KDLKinematicsPlugin"
type="kdl_kinematics_plugin::KDLKinematicsPlugin"
base_class_type="kinematics::KinematicsBase">
The "path" property should not have the "lib/" prefix, and the value should be the name of the .so file in catkin_ws/devel/lib/, so "libkdl_kinematics_plugin" for your package.
The "name" property should be removed completely (it's now an optional attribute.)
- In your
load_ik.cpp
, you are specifying the wrong class name to the ClassLoader. The second argument is the name of the base class, not the derived class.
pluginlib::ClassLoader<kinematics::KinematicsBase> load_ik("kdl_kinematics_plugin", "kdl_kinematics_plugin::KDLKinematicsPlugin");
Have you enabled Debug logging for your load_ik
ros node? I see some useful messages being logged by pluginlib.
Even with these 4 fixes, your node still doesn't work, but it looks to me like the plugin portion is being successfully loaded and executed.