Robotics StackExchange | Archived questions

How to include moveit headerfile in other ROS library?

Hi,

I am trying to include a moveit headerfile robot_trajectory.h in the library created by myself.

However, I got the following error:

/home/pr2/catkin_ws/src/rml_time_param/src/rml_time_param.cpp:9:42: fatal error: moveit_core/robot_trajectory.h: No such file or directory
compilation terminated.
make[2]: *** [rml_time_param/CMakeFiles/rml_time_param.dir/src/rml_time_param.cpp.o] Error 1
make[1]: *** [rml_time_param/CMakeFiles/rml_time_param.dir/all] Error 2
make: *** [all] Error 2

This is package.xml of my library:

<package>
  <name>rml_time_param</name>
  <version>0.0.0</version>
  <description>The rml_time_param package</description>
  <maintainer email="pr2@todo.todo">pr2</maintainer>
  <license>TODO</license>
  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>boost</build_depend>
  <build_depend>moveit_msgs</build_depend>
  <build_depend>moveit_core</build_depend>
  <build_depend>moveit_robot_trajectory</build_depend>
  <run_depend>boost</run_depend>
  <run_depend>moveit_msgs</run_depend>
  <run_depend>moveit_core</run_depend>
  <run_depend>moveit_robot_trajectory</run_depend>
  <export>
  </export>
</package>  

This is CMakeList of my library.

cmake_minimum_required(VERSION 2.8.3)
project(rml_time_param)
find_package(catkin REQUIRED)
include_directories(${catkin_INCLUDE_DIRS})
catkin_package(
  LIBRARIES rml_time_param
)
add_library(rml_time_param
  src/rml_time_param.cpp
)
add_dependencies(rml_time_param moveit_msgs_gencpp)
target_link_libraries(rml_time_param moveit_robot_state moveit_robot_trajectory ${catkin_LIBRARIES} ${Boost_LIBRARIES})

This is CMakeList of robot_trajectory:

set(MOVEIT_LIB_NAME moveit_robot_trajectory)
add_library(${MOVEIT_LIB_NAME}
  src/robot_trajectory.cpp
)
add_dependencies(${MOVEIT_LIB_NAME} moveit_msgs_gencpp)
target_link_libraries(${MOVEIT_LIB_NAME} moveit_robot_model moveit_robot_state ${catkin_LIBRARIES} ${Boost_LIBRARIES})
install(TARGETS ${MOVEIT_LIB_NAME}
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION})
install(DIRECTORY include/ DESTINATION include)

Thanks for any help in advance!

Asked by AdrianPeng on 2013-06-24 06:08:50 UTC

Comments

Answers