ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Solved, the docs for catkin helped me do this properly. First in the CMakeLists.txt catkin_package

catkin_package(
  # Other pkgs can use ikfast.h
  INCLUDE_DIRS
    include
)

Now other packages can use ikfast.h but a good number of definitions and functions have been excluded by #ifdef. So you must

#define IKFAST_HAS_LIBRARY

in ikfast.h. And then a a link to the definition of computerIK() must be created to <myrobot>_<group>_ikfast_solver.cpp by making the additional changes to the CMakeLists.txt

catkin_package(
  # Other pkgs can use ikfast.h
  INCLUDE_DIRS
    include
  LIBRARIES
    ik_solver_lib
)

add_library(ik_solver_lib src/kuka_arm_ikfast_solver.cpp)
target_link_libraries(ik_solver_lib ${catkin_LIBRARIES})

# And include in installs
install(TARGETS ${IKFAST_LIBRARY_NAME} ik_solver_lib LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})

Now all that's needed is to add to the package that you would like to use IKFast's functionality by adding

find_package(catkin REQUIRED COMPONENTS 
    ...
    kuka_ikfast_plugin
)

Simply #include <ikfast.h> in any cpp in your package.