Robotics StackExchange | Archived questions

ROS package building using Snapcraft giving error for finding system libraries like PCL and OpenCV

System: OS: Ubuntu 16.04 ROS version: kinetic.

Hello All, I am beginner into ROS and have been following ROS tutorial. I have created "beginner_tutorials" and further trying to create SNAP package using below link. http://wiki.ros.org/ROS/Tutorials/Packaging%20your%20ROS%20project%20as%20a%20snap

As per tutorial it will create snap but when I adds some more libraries dependency into beginner_tutorials's CMakeList.txt file, then running "snapcarft" is giving error and snapcraft is not finding system installed PCL and OpenCV libraries.

Below is the Error:

""" .... .... -- Boost version: 1.58.0 -- Found the following Boost libraries: -- system CMake Warning at CMakeLists.txt:11 (findpackage): By not providing "FindPCL.cmake" in CMAKEMODULE_PATH this project has asked CMake to find a package configuration file provided by "PCL", but CMake did not find one.

Could not find a package configuration file provided by "PCL" with any of the following names:

PCLConfig.cmake
pcl-config.cmake

Add the installation prefix of "PCL" to CMAKEPREFIXPATH or set "PCL_DIR" to a directory containing one of the above files. If "PCL" provides a separate development package or SDK, be sure it has been installed.

CMake Error at CMakeLists.txt:12 (findpackage): By not providing "FindOpenCV.cmake" in CMAKEMODULE_PATH this project has asked CMake to find a package configuration file provided by "OpenCV", but CMake did not find one.

Could not find a package configuration file provided by "OpenCV" with any of the following names:

OpenCVConfig.cmake
opencv-config.cmake

Add the installation prefix of "OpenCV" to CMAKEPREFIXPATH or set "OpenCV_DIR" to a directory containing one of the above files. If "OpenCV" provides a separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred! See also "/root/parts/workspace/build/buildisolated/beginnertutorials/CMakeFiles/CMakeOutput.log". Makefile:742: recipe for target 'cmakecheckbuildsystem' failed make: *** [cmakecheckbuildsystem] Error 1

"""

Similar project will compile fine when I run using "catkinmake" here it is able to find PCL and OpenCV without any problem, but snapcraft is not. I have installed PCL 1.9 version in my machine from git compiled from source and deployed. cmake findpackage() is able to find PCL for any other projects only snapcraft is giving error.

Let me know what am I missing ? or how to fix this. My goal is create ROS packages using SNAP that will have dependency to system libraries like PCL and OpenCV.

Below is my modified CMakeLists.txt:

""

%Tag(FULLTEXT)%

cmakeminimumrequired(VERSION 2.8.3) project(beginner_tutorials)

Find catkin and any catkin packages

findpackage(catkin REQUIRED COMPONENTS roscpp rospy stdmsgs genmsg)

set(PCL_DIR "/usr/local/share/pcl-1.9/")

findpackage(Boost REQUIRED COMPONENTS system) findpackage(PCL 1.9 REQUIRED) find_package(OpenCV REQUIRED)

Declare ROS messages and services

addmessagefiles(FILES Num.msg) addservicefiles(FILES AddTwoInts.srv)

Generate added messages and services

generatemessages(DEPENDENCIES stdmsgs)

Declare a catkin package

catkin_package()

Build talker and listener

includedirectories(include ${catkinINCLUDE_DIRS})

addexecutable(talker src/talker.cpp) targetlinklibraries(talker ${catkinLIBRARIES}) adddependencies(talker beginnertutorialsgeneratemessages_cpp)

addexecutable(listener src/listener.cpp) targetlinklibraries(listener ${catkinLIBRARIES}) adddependencies(listener beginnertutorialsgeneratemessages_cpp)

Install talker and listener

install(TARGETS talker listener RUNTIME DESTINATION ${CATKINPACKAGEBIN_DESTINATION} )

%EndTag(FULLTEXT)%

"""

Asked by Ashish18 on 2020-05-05 15:14:06 UTC

Comments

Answers