moveit / moveit2

:robot: MoveIt for ROS 2
https://moveit.ai/
BSD 3-Clause "New" or "Revised" License
1.09k stars 527 forks source link

IKFastKinematicPlugin cannot be loaded #2144

Closed RobinHeitz closed 1 year ago

RobinHeitz commented 1 year ago

Description

Following the official tutorial, I generated an IKFastPlugin-Package. I used the version which utilizes the docker image. It even updates my kinematics.yaml - file within the moveit-config-pkg. On load, it yields that it cannot be loaded. Back in the Setup Assistant it also is not part of the dropdown-menu.

Your environment

Steps to reproduce

Here are the packages, load them into ros2 workspace, build them. Install Moveit2 (I've from source). description, ikfast and moveit config Then launch rv7fm_moveit_config demo.launch.py

Error message: [move_group-2] [WARN] [1682524762.381391728] [moveit_robot_model.robot_model]: Could not identify parent group for end-effector 'ee' [move_group-2] [ERROR] [1682524762.384365374] [kinematics_plugin_loader]: The kinematics plugin (rv7fm_arm) failed to load. Error: According to the loaded plugin descriptions the class rv7fm_rv7fm_arm/IKFastKinematicsPlugin with base class type kinematics::KinematicsBase does not exist. Declared types are cached_ik_kinematics_plugin/CachedKDLKinematicsPlugin cached_ik_kinematics_plugin/CachedSrvKinematicsPlugin kdl_kinematics_plugin/KDLKinematicsPlugin lma_kinematics_plugin/LMAKinematicsPlugin prbt_manipulator/IKFastKinematicsPlugin srv_kinematics_plugin/SrvKinematicsPlugin

Expected behaviour

The kinematic plugin should be loaded. If I re-launch the moveit setup-assistant, in the planning group tap, I should be able to select the created plugin from the list. I'm not.

Actual behaviour

Its not loaded and cannot be selected in the setup assistant.

Backtrace or Console output

Error message: [move_group-2] [WARN] [1682524762.381391728] [moveit_robot_model.robot_model]: Could not identify parent group for end-effector 'ee' [move_group-2] [ERROR] [1682524762.384365374] [kinematics_plugin_loader]: The kinematics plugin (rv7fm_arm) failed to load. Error: According to the loaded plugin descriptions the class rv7fm_rv7fm_arm/IKFastKinematicsPlugin with base class type kinematics::KinematicsBase does not exist. Declared types are cached_ik_kinematics_plugin/CachedKDLKinematicsPlugin cached_ik_kinematics_plugin/CachedSrvKinematicsPlugin kdl_kinematics_plugin/KDLKinematicsPlugin lma_kinematics_plugin/LMAKinematicsPlugin prbt_manipulator/IKFastKinematicsPlugin srv_kinematics_plugin/SrvKinematicsPlugin

Yadunund commented 1 year ago

I was able to successfully integrate and load an ikfast plugin. I did have to add LAPACK to the ament_target_dependencies() call in CMakeLists.txt without which a undefined symbol: dgetrf_ error is thrown by the move_group node.

According to the loaded plugin descriptions the class rv7fm_rv7fm_arm/IKFastKinematicsPlugin with base class type kinematics::KinematicsBase does not exist.

Did you source the workspace where you built the ikfast plugin package before launching?

RobinHeitz commented 1 year ago

Yes, definitively sourced WS. A colleague got it running but he also had to go some additional steps (additional to the tutorial). But, like you said @Yadunund, it has something to do with CMake, probably something very easy for ones that know c++/ the build system. Might try to create the IK plugin again and compare the results with the current one.

Yadunund commented 1 year ago

If it helps here's the addition to my CMakeLists.txt after the add_library() call. I think I also modified the ament_export_libraries(${IKFAST_LIBRARY_NAME}) and ament_export_targets(export_${IKFAST_LIBRARY_NAME}) calls

ament_target_dependencies(${IKFAST_LIBRARY_NAME}
  rclcpp
  moveit_core
  pluginlib
  tf2_kdl
  orocos_kdl
  tf2_eigen
  LAPACK
)
# suppress warnings about unused variables in OpenRave's solver code
target_compile_options(${IKFAST_LIBRARY_NAME} PRIVATE -Wno-unused-variable -Wno-unused-parameter)

target_link_libraries(${IKFAST_LIBRARY_NAME}
  ikfast_kinematics_parameters
)
pluginlib_export_plugin_description_file(moveit_core ikfast_plugins.xml)
ament_export_libraries(${IKFAST_LIBRARY_NAME})
ament_export_targets(export_${IKFAST_LIBRARY_NAME})
ament_export_dependencies(moveit_core)
ament_export_dependencies(pluginlib)
ament_export_dependencies(rclcpp)
ament_export_dependencies(tf2_kdl)
ament_export_dependencies(tf2_eigen)
ament_export_dependencies(generate_parameter_library)

install(TARGETS ${IKFAST_LIBRARY_NAME} ikfast_kinematics_parameters
  EXPORT export_${IKFAST_LIBRARY_NAME}
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
  RUNTIME DESTINATION bin
)

Also added a build_type export to package.xml

  <export>
    <build_type>ament_cmake</build_type>
    <moveit_core plugin="${prefix}/ikfast_plugins.xml"/>
  </export>
RobinHeitz commented 1 year ago

Thanks.

RobinHeitz commented 1 year ago

Thanks.

SuperDiodo commented 1 year ago

Were you able to load the plugin without errors?

Yadunund commented 1 year ago

Yep. What were the errors you encountered?

SuperDiodo commented 1 year ago

The same error: "The kinematics plugin __ failed to load". Could you please provide the full CMakeLists.txt?

Edit: after playing with the CMakeLists.txt I succeded in loading the plugin. The interactive marker shows up in RViz and I am able to move the robot goal.

However, the controller manager is producing the following error:

[ros2_control_node-4] [INFO] [1684756145.338024478] [controller_manager]: Loading controller 'arm_controller'
[ros2_control_node-4] terminate called after throwing an instance of 'rclcpp::exceptions::InvalidParameterValueException'
[ros2_control_node-4]   what():  No parameter value set
Yadunund commented 1 year ago

The ros2_controls controller manager error should not have anything to do with this IK plugin since IK is only used for motion planning and not trajectory execution. You might want to check your ros2_control.xacro to make sure you're setting all the parameters for your hardware interface.

Tommaso2025 commented 4 months ago

Hello @Yadunund I see that you were able to solve the issue with the plugin failed to load error. I am developing an IK solver too but I am using ROS1, I do encounter the same error and in order to compare my work with something else I used the kdl_kinematics_plugin and still encounter this error. Maybe you can help me? My idea is to have the IK solver developed in one workspace completed with shared library and have a ROS node in another workspace to test its functionality. Here the link for the github with the plugin and the node. catkin_ws_10 is the Ik solver and catkin_ws_11 has the node. https://github.com/Tommaso2025/Plugin

Yadunund commented 3 months ago

@Tommaso2025 if I had to guess- you're not exporting this target. The codebase here could also be very different from the ROS 1 version of moveit that you're using so you might want to ask in the moveit repository or on robotics stack exchange.