I am attempting to use a custom set of ros_control headers (specifically for the controller_manager class) in a package that depends on nearly a dozen other packages, some of which I cannot modify. I am building the ROS ros_control package from source and I expected this to supersede the Debian version of ros_control, however, it is still using the Debian headers.
The problem appears to stem from the include path used by catkin_make. With verbosity turned on, catkin_make shows /opt/ros/indigo/include/
as the first include path. Ideally, this should be one of the last include paths. I'm guessing that one of my dependencies is messing up the include path, but I don't know find which one or if I can even modify the package.
How do I ensure that /opt/ros/indigo/include
gets put at the end of the include path list? I would preferably like to only modify my current package's CMakeList.txt
.
Edit 1: Additional Information:
I'm getting the following error. The getRunningControllersListRealTime(std::vector<std::string>& v)
is a custom function that I know works in other parts of the system, so I know that the wrong set of headers are being used for some reason.
/home/USERNAME/flor_repo/catkin_ws/src/thor_control/valor_ros_control/valor_escher_controller/src/ValorEscherController.cpp:314:13: error: ‘class controller_manager::ControllerManager’ has no member named ‘getRunningControllersListRealTime’
mode_cm_->getRunningControllersListRealTime(running_controllers_list); // get list of all controllers currently loaded in this manager
^
With Catkin's verbose flag turned on, I get the following output indicating that the Indigo headers are first in the include list. I don't know how those headers got put first, but I need a way of moving them to the end of my include list using my package's CMakeList.txt
.
[ 80%] Building CXX object thor_control/valor_ros_control/valor_escher_controller/CMakeFiles/valor_escher_controller.dir/src/ValorEscherController.cpp.o
cd /home/james/flor_repo/catkin_ws/build/thor_control/valor_ros_control/valor_escher_controller && /usr/bin/c++ -DROSCONSOLE_BACKEND_LOG4CXX -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME=\"valor_escher_controller\" -Dvalor_escher_controller_EXPORTS -std=gnu++0x -O3 -DNDEBUG -fPIC **-I/opt/ros/indigo/include** -I/usr/include/eigen3 -I/home/james/flor_repo/catkin_ws/src/ros_control/hardware_interface/include -I/home/james/flor_repo/catkin_ws/src/ros_control/controller_manager/include -I/home/james/flor_repo/catkin_ws/src/ros_control/controller_interface/include ... [Additional paths] -o CMakeFiles/valor_escher_controller.dir/src/ValorEscherController.cpp.o -c /home/james/flor_repo/catkin_ws/src/thor_control/valor_ros_control/valor_escher_controller/src/ValorEscherController.cpp
Edit 2: Added CMakeLists.txt file for package.
Here is my CMakeLists for the current package. I've stripped out the comments and boiler plate language, as well as the project specific packages that I know work in other locations.
cmake_minimum_required(VERSION 2.8.3)
project(valor_escher_controller)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
find_package(Boost REQUIRED COMPONENTS system)
find_package(catkin REQUIRED COMPONENTS cmake_modules)
find_package(Eigen REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
eigen_stl_containers
eigen_conversions
hardware_interface
controller_manager
... [Additional project specific packages])
include_directories(include ${Boost_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
SET(HEADERS
[List of 12 in-package headers]
)
SET(SOURCE
[List of 3 in-package source files]
)
SET(ASGARD_HEADER_PATHS
[List of Non-ROS header locations]
)
SET(ASGARD_LIB_PATHS
[Non-ROS library path]
)
catkin_package(
INCLUDE_DIRS
include
${ASGARD_HEADER_PATHS}
LIBRARIES valor_escher_controller
CATKIN_DEPENDS
roscpp
std_msgs
hardware_interface
controller_manager
... [Project specific packages]
DEPENDS
Eigen
... [Non-ROS dependencies]
CFG-EXTRAS
valor_escher_controllers-extras.cmake)
include_directories(
include
${ASGARD_HEADER_PATHS}
${Boost_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
link_directories(
${ASGARD_LIB_PATHS}
)
add_library(${PROJECT_NAME} ${SOURCE} ${HEADERS} )
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
... [Non-ROS libraries]
)
install( TARGETS ${PROJECT_NAME} #${PROJECT_NAME}_node ${PROJECT_NAME}_sim
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
install(DIRECTORY launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
FILES_MATCHING PATTERN "*.launch")
install(DIRECTORY config
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
FILES_MATCHING PATTERN "*.yaml")
Originally posted by James Burton on ROS Answers with karma: 11 on 2015-03-03
Post score: 1