Invoking "cmake" failed

11.2k Views Asked by At

I am trying to build a ROS package 'moveit_kinematics' but getting the following error:

enter image description here

I ran find_package(ur3_moveit_plugin REQUIRED) but getting syntax error.

CmakeLists.txt:

find_package(trac_ik_kinematics_plugin QUIET)
find_package(ur_kinematics QUIET)

find_package(Boost COMPONENTS filesystem program_options REQUIRED)

set(MOVEIT_LIB_NAME moveit_cached_ik_kinematics_base)
add_library(${MOVEIT_LIB_NAME} src/ik_cache.cpp)
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
target_link_libraries(${MOVEIT_LIB_NAME}
    ${Boost_FILESYSTEM_LIBRARY}
    ${catkin_LIBRARIES})
install(TARGETS ${MOVEIT_LIB_NAME} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})

if(trac_ik_kinematics_plugin_FOUND)
    include_directories(${trac_ik_kinematics_plugin_INCLUDE_DIRS})
endif(trac_ik_kinematics_plugin_FOUND)

set(MOVEIT_LIB_NAME moveit_cached_ik_kinematics_plugin)
add_library(${MOVEIT_LIB_NAME} src/cached_ik_kinematics_plugin.cpp)
set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
target_link_libraries(${MOVEIT_LIB_NAME}
    moveit_cached_ik_kinematics_base
    moveit_kdl_kinematics_plugin
    moveit_srv_kinematics_plugin
    ${catkin_LIBRARIES})
if(trac_ik_kinematics_plugin_FOUND)
    target_link_libraries(${MOVEIT_LIB_NAME} ${trac_ik_kinematics_plugin_LIBRARIES})
    set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES COMPILE_DEFINITIONS "CACHED_IK_KINEMATICS_TRAC_IK")
endif()
install(TARGETS ${MOVEIT_LIB_NAME} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})

# This is just for testing purposes; the arms from Universal Robots have
# analytic solvers, so caching just adds extra overhead.
if(ur_kinematics_FOUND)
    include_directories(${ur_kinematics_INCLUDE_DIRS})
    foreach(UR 3 5 10)
        set(MOVEIT_LIB_NAME moveit_cached_ur${UR}_kinematics_plugin)
        add_library(${MOVEIT_LIB_NAME} src/cached_ur_kinematics_plugin.cpp)
        set_target_properties(${MOVEIT_LIB_NAME} PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
        find_library(ur${UR}_pluginlib ur${UR}_moveit_plugin PATHS ${ur_kinematics_LIBRARY_DIRS})
        target_link_libraries(${MOVEIT_LIB_NAME}
            moveit_cached_ik_kinematics_base
            ${ur${UR}_pluginlib}
            ${catkin_LIBRARIES})
        install(TARGETS ${MOVEIT_LIB_NAME} LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
    endforeach()
endif()

add_executable(measure_ik_call_cost src/measure_ik_call_cost.cpp)
target_link_libraries(measure_ik_call_cost
    ${catkin_LIBRARIES}
    ${Boost_PROGRAM_OPTIONS_LIBRARY})
install(TARGETS measure_ik_call_cost DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

install(DIRECTORY include/ DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION})
install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

Could someone help me locating the package or pointing out the error? Your help/advice would be highly appreciated.

Thank you.

3

There are 3 best solutions below

0
On

The error says it quiet clearly, it cannot find ur_moveit_plugin. Add it in the find_package() section of CMakeLists.txt. Make sure the package is installed or cloned in your catkin workspace. You added find_package(wr3_moveit_plugin REQUIRED), but the error is about ur, it might be a typo though.

1
On

All packages that include MoveIt headers have to be compiled using the C++11 standard. Therefore you need to add the line

#Enable C++11
add_compile_options(-std=c++11)

at the beginning of your CMakeLists.txt.

1
On

I had this Invoking "cmake" failed error when I installed catkin_make -j8 and I had my virtual environment activated at that moment. Then you should try installing it in the Python base environment. If that does not help, follow the ideas at Installing OpenCV fails because it cannot find “skbuild” like:

  • re-install catkin,
  • or sudo apt install python-pip,
  • or for Python 3 (thanks for the comment): sudo apt install python3-pip.