PCL + ROS Indigo: include not found if I use catkin_package()
Hi,
I have installed ROS Indigo under Ubuntu 14.04. I am trying to create a ROS package that uses the PCL library. I am using QtCreator as IDE.
My main problem is that QtCreator can't find the PCL headers. For example:
#include <pcl/point_types.h>
Therefore it does not autocomplete anything related to PCL. However, it DOES compile if I have PCL code, so I don't know where the error is.
This is my CMakeLists.txt:
cmake_minimum_required(VERSION 2.8.3)
project(data_visualizer)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
visualization_msgs
tf
)
find_package(PCL REQUIRED)
include_directories(
${catkin_INCLUDE_DIRS}
)
include_directories(include ${PCL_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS} )
add_definitions(${PCL_DEFINITIONS})
catkin_package()
file(GLOB_RECURSE SOURCES src/*.cpp src/*.h)
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${PCL_LIBRARIES})
And my package.xml:
<?xml version="1.0"?>
<package>
<name>data_visualizer</name>
<version>0.0.0</version>
<description>The data_visualizer package</description>
<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->
<!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
<maintainer email="work@todo.todo">work</maintainer>
<!-- One license tag required, multiple allowed, one license per tag -->
<!-- Commonly used license strings: -->
<!-- BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
<license>TODO</license>
<!-- Url tags are optional, but mutiple are allowed, one per tag -->
<!-- Optional attribute type can be: website, bugtracker, or repository -->
<!-- Example: -->
<!-- <url type="website">http://wiki.ros.org/data_visualizer</url> -->
<!-- Author tags are optional, mutiple are allowed, one per tag -->
<!-- Authors do not have to be maintianers, but could be -->
<!-- Example: -->
<!-- <author email="jane.doe@example.com">Jane Doe</author> -->
<!-- The *_depend tags are used to specify dependencies -->
<!-- Dependencies can be catkin packages or system dependencies -->
<!-- Examples: -->
<!-- Use build_depend for packages you need at compile time: -->
<!-- <build_depend>message_generation</build_depend> -->
<!-- Use buildtool_depend for build tool packages: -->
<!-- <buildtool_depend>catkin</buildtool_depend> -->
<!-- Use run_depend for packages you need at runtime: -->
<!-- <run_depend>message_runtime</run_depend> -->
<!-- Use test_depend for packages you need only for testing: -->
<!-- <test_depend>gtest</test_depend> -->
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>visualization_msgs</build_depend>
<build_depend>tf</build_depend>
<build_depend>libpcl-all-dev</build_depend>
<run_depend>roscpp</run_depend>
<run_depend>rospy</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>visualization_msgs</run_depend>
<run_depend>tf</run_depend>
<run_depend>libpcl-all</run_depend>
<!-- The export tag contains other, unspecified, tags -->
<export>
<!-- Other tools can request additional information be placed here -->
</export>
</package>
Hint: I notice that if I comment out the line "catkin_package()" from the CMakeLists.txt, then QtCreator is able to locate the PCL headers. Does this sound familiar? Any ideas on how to fix this?
Thanks a lot!
Asked by Tinrik on 2015-11-11 07:56:57 UTC
Comments
did you solve this? it also happens to me and it is quite annoying
Asked by Kailegh on 2017-02-17 04:53:31 UTC