pcl_ros can't find package
When I am running the CMAKE of my project, this error appear. I am working on the lunar distribution and I have installed the ros-lunar-pcl* my pcl version is 1.8. I have look on the web, but nothing worked. I have no idea what can be happening, so if someone has an idea on where to look that be great :)
Here is the error:
> Running "/usr/bin/cmake /home/components/ROS/src/landmark_calibration '-GCodeBlocks - Unix Makefiles' -DCMAKE_CXX_COMPILER:STRING=/usr/bin/x86_64-linux-gnu-g++ -DCMAKE_C_COMPILER:STRING=/usr/bin/x86_64-linux-gnu-gcc -DCMAKE_PREFIX_PATH:STRING=/usr -DQT_QMAKE_EXECUTABLE:STRING=/usr/lib/x86_64-linux-gnu/qt5/bin/qmake" in /home/components/ROS/src/landmark_calibration-build.
-- Using CATKIN_DEVEL_PREFIX: /home/components/ROS/src/landmark_calibration-build/devel
-- Using CMAKE_PREFIX_PATH: /usr
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/components/ROS/src/landmark_calibration-build/test_results
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.14
CMake Warning at /opt/ros/lunar/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
Could not find a package configuration file provided by "pcl_ros" with any
of the following names:
pcl_rosConfig.cmake
pcl_ros-config.cmake
Add the installation prefix of "pcl_ros" to CMAKE_PREFIX_PATH or set
"pcl_ros_DIR" to a directory containing one of the above files. If
"pcl_ros" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:28 (find_package)
-- Could not find the required component 'pcl_ros'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
-- Configuring incomplete, errors occurred!
See also "/home/components/ROS/src/landmark_calibration-build/CMakeFiles/CMakeOutput.log".
See also "/home/components/ROS/src/landmark_calibration-build/CMakeFiles/CMakeError.log".
CMake Error at /opt/ros/lunar/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "pcl_ros" with any
of the following names:
pcl_rosConfig.cmake
pcl_ros-config.cmake
Add the installation prefix of "pcl_ros" to CMAKE_PREFIX_PATH or set
"pcl_ros_DIR" to a directory containing one of the above files. If
"pcl_ros" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:28 (find_package)
*** cmake process exited with exit code 1.
And here is my CMakeList.txt:
`cmake_minimum_required(VERSION 2.8.0)
project(landmark_calibration)
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
set(CMAKE_BUILD_TYPE Debug)
##############################################################################
# Catkin
##############################################################################
set(catkin_package_DEPENDENCIES
roscpp
pcl_ros
pcl_conversions
# qt_build provides the qt cmake glue, roscpp the comms for a default talker
)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(OpenCV REQUIRED )
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system $(catkin_package_DEPENDENCIES))
find_package(catkin REQUIRED COMPONENTS ${catkin_package_DEPENDENCIES} )
# Use this to define what the package will export (e.g. libs, headers).
# Since the default here is to produce only a binary, we don't worry about
# exporting anything.
catkin_package(
INCLUDE_DIRS include
)
INCLUDE_DIRECTORIES ( ${EIGEN3_INCLUDE_DIR} )
INCLUDE_DIRECTORIES ( ${PCL_INCLUDE_DIRS})
include_directories(${catkin_INCLUDE_DIRS})
##############################################################################
# Qt Environment
##############################################################################
# this comes from qt_build's qt-ros.cmake which is automatically
# included via the dependency call in package.xml
# rosbuild_prepare_qt4(QtCore QtGui) # Add the appropriate components to the component list here
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5Widgets REQUIRED)
#add_definitions(${Qt5Widgets_DEFINITIONS})
#include_directories("${Qt5Widgets_INCLUDE_DIRS}")
#set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
##############################################################################
# Sections
##############################################################################
file(GLOB QT_FORMS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ui/*.ui)
file(GLOB QT_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} resources/*.qrc)
file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS include/landmark_calibration/*.hpp)
##############################################################################
# Sources
##############################################################################
file(GLOB_RECURSE QT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS src/*.cpp)
#aux_source_directory(${PROJECT_SOURCE_DIR}/src SOURCES)
##############################################################################
# Binaries
##############################################################################
## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
add_executable(${PROJECT_NAME}_node
${QT_SOURCES}
${QT_RESOURCES}
${QT_FORMS}
${QT_MOC}
)
## Rename C++ executable without
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
## Specify libraries to link a library or executable target against
target_link_libraries(${PROJECT_NAME}_node
${Qt5Widgets_LIBRARIES}
${catkin_LIBRARIES}
yaml-cpp
${roslib_LIBRARIES}
${PCL_LIBRARIES}
${OpenCV_LIBS}
)
install(TARGETS ${PROJECT_NAME}_node
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
)
install(DIRECTORY data/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/data
)
Sorry for the long post..
Asked by antoineniotna on 2018-12-27 08:54:04 UTC
Answers
Can look at this example: https://github.com/ros-perception/perception_pcl/blob/hydro-devel/pcl_ros/CMakeLists.txt
Asked by hh10 on 2020-05-26 09:14:35 UTC
Comments
Despite the error message being printed by cmake
, this error message can still occur when the dependency on the package in question is properly configured in CMakeLists.txt
, when the depended pkg itself is missing. So check if pcl_ros
package is available on your host.
FYI I just had it occurred (on ROS Foxy) and installing it (apt install ros-foxy-pcl-ros
) resolved that.
Asked by 130s on 2023-04-12 12:39:00 UTC
Comments