Package dependencies with .srv
Hi all,
I all, I have 2 packages with the following hierarchy:
<catkin_ws>
---meta-package
------lc_control
------lc_toolkitLink
lc_control adds service files via add_service_files(FILES BaseVel.srv), which should be used by lc_toolkitLink.
In order to let lc_toolkitLink know about the services added by lc_control, I add lc_control as a dependency to lc_toolkitLink, using find_package, catkin_package and add_dependencies(<mylibrary> ${catkin_EXPORTED_TARGETS}). package.xml includes <depend>lc_control</depend>.
Though when I compile I get:
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "package1" with
any of the following names:
lc_controlConfig.cmake
lc_control-config.cmake
Add the installation prefix of "lc_control" to CMAKE_PREFIX_PATH or set
"lc_control_DIR" to a directory containing one of the above files. If
"lc_control" provides a separate development package or SDK, be sure it has
been installed.
I believe I have followed these guidelines and these.
Also what I understand CMake is saying is that the package does not exist, and this is because it is not compiled yet. Though I thought that add_dependencies would actually solve the problem but it does not.
Then I have set lc_control_DIR as stated in the message, but in this case I get error message:
CMake Error at /home/arennuit/DevRoot/src/catkin_ws/build/le_painters_companion/lc_control/catkin_generated/installspace/lc_controlConfig.cmake:103 (message):
Project 'lc_control' specifies 'include' as an include dir, which is not
found. It does not exist in
'/home/arennuit/DevRoot/src/catkin_ws/build/le_painters_companion/include'.
This does not make sense to me.
Any idea of what is going on in my case?
Thanks,
Antoine.
-------------UPDATE------------
Here is the packaging code for both my packages:
CMakeLists.txt for lc_control
cmake_minimum_required(VERSION 2.8.3)
project(lc_control)
################################################################################
# Find packages.
# Eigen.
# NOTE: for reasons we do not understand it is not possible to set
# CMAKE_MODULE_PATH as a relative path (although we do it in the toolkit)
# hence we use function get_filename_component() to transform the relative
# path to an absolute path.
get_filename_component(LC_CMAKE_FOLDER_PATH "../../../../CMake" ABSOLUTE)
set(CMAKE_MODULE_PATH ${LC_CMAKE_FOLDER_PATH})
set(CMAKE_PREFIX_PATH ../../../../../Dependencies/Eigen/v3.2.0)
find_package(Eigen3 REQUIRED)
# Catkin.
find_package(catkin REQUIRED COMPONENTS rtt_ros message_generation std_msgs)
# Custom messages and services.
add_service_files(
FILES
BasePos.srv
BaseVel.srv
)
generate_messages(DEPENDENCIES std_msgs)
################################################################################
# Catkin package build info.
catkin_package(
CATKIN_DEPENDS rtt_ros message_runtime std_msgs
)
add_definitions(-DRTT_COMPONENT)
################################################################################
# Headers.
include_directories(
"${EIGEN3_INCLUDE_DIR}"
"../../../../../Dependencies"
"../../../../"
"src/vrep_ik/externalIk"
"src/vrep_ik/include")
################################################################################
# Dependencies.
# NOTE: this compiles Core and System specifically for the ROS package (and is
# redundant with the compilation of Core and System for the toolkit).
add_subdirectory(../../../../Core ../../Core)
add_subdirectory(../../../../System ../../System)
################################################################################
# Create orocos components.
orocos_use_package(ocl-taskbrowser)
orocos_component(Orchestrator
src/Orchestrator.h
src/Orchestrator.cpp
src/StateMachine.h
src/StateMachine.cpp
../../../../../Dependencies/pugixml/v1.7/pugixml.cpp)
add_dependencies(Orchestrator ${${PROJECT_NAME}_EXPORTED_TARGETS}) # Make sure the services are created before they are used.
target_link_libraries(Orchestrator
${catkin_LIBRARIES}
${OROCOS-RTT_RTT-MARSHALLING_LIBRARY}
Core)
################################################################################
# Make this an installable package usable by other packages.
orocos_generate_package()
package.xml for lc_control
<package format="2">
<name>lc_control</name>
<version>0.1.0</version>
<description>T</description>
<maintainer email="bob@bob.net">Bob</maintainer>
<buildtool_depend>catkin</buildtool_depend>
<depend>std_msgs ...