Ubuntu 14.04, ROS Indigo.
I've been following along with the tutorial at:
http://wiki.ros.org/ROS/Tutorials/CreatingMsgAndSrv and when I get to the portion where it instructs me to run catkin_make install I get:
Base path: /home/umdearborn/catkin_ws
Source space: /home/umdearborn/catkin_ws/src
Build space: /home/umdearborn/catkin_ws/build
Devel space: /home/umdearborn/catkin_ws/devel
Install space: /home/umdearborn/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/umdearborn/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/umdearborn/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/umdearborn/catkin_ws/devel;/opt/ros/indigo
-- This workspace overlays: /home/umdearborn/catkin_ws/devel;/opt/ros/indigo
-- 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/umdearborn/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.18
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 1 packages in topological order:
-- ~~ - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;geneus;genlisp;genpy
CMake Error at beginner_tutorials/CMakeLists.txt:61 (add_action_files):
Unknown CMake command "add_action_files".
-- Configuring incomplete, errors occurred!
See also "/home/umdearborn/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/umdearborn/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
I'm fairly new to ROS and CMake so I'm completely stumped. I've made sure to source both /opt/ros/indigo/setup.bash and ~/catkin_ws/devel/setup.bash.
Any ideas what could be causing this?
↧
Unknown CMake command "add_action_files"
↧
Launch python extension build with catkin_make
Hello guys,
trying to solve this problem slowly drives me crazy.
ros_pkg/
| CMakeLists.txt ------+ should run that setup.py in setup.py`s directory as working dir
| package.xml |
| ... |
| python_pkg/ |
| | __init__.py v
| | setup.py <--------- builds extensions using cython, distutils and sources below
| | sub_pkg_1/
| | ...
| | sub_pkg_N/
As the picture shows, i am trying to include the python script that builds some python extensions into some shared libs.
However, no matter how i play around using catkin_python_setup() or the install command, it won't work.
I have also tried to use CMake's execute_process but it does nothing.
Has anyone an idea how to do that right?
best regards
↧
↧
opencv2 and opencv3 wrong inclusion with cv_bridge
Hi all,
I'm trying to compile a node which uses internally the `applyColorMap` function, which is defined inside contrib in OpenCV2 and it is defined in core in OpenCV3.
I have both installed, OpenCV2 with the ros package in /usr/include, and OpenCV3 manually installed in /usr/local/include.
To force the use of OpenCV2 set the following CMakeList.txt:
cmake_minimum_required(VERSION 2.8.3)
project(height_publisher)
find_package(catkin REQUIRED COMPONENTS roscpp nav_msgs cv_bridge
image_transport pcl_conversions
sensor_msgs tf tf_conversions)
include_directories(${catkin_INCLUDE_DIRS})
set(CMAKE_BUILD_TYPE "Release")
find_package(OpenCV 2.4 REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
message("-- OpenCV version: ${OpenCV_VERSION}")
message("-- OpenCV include dirs: ${OpenCV_INCLUDE_DIRS}")
message("-- catkin include dirs: ${catkin_INCLUDE_DIRS}")
find_package(PCL REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
catkin_package()
include_directories(include ${catkin_INCLUDE_DIRS})
add_executable(height_publisher_node src/HeightPublisher.cpp)
target_link_libraries(height_publisher_node ${OpenCV_LIBS} ${PCL_LIBRARIES}
${catkin_LIBRARIES})
The message correctly says that we look for OpenCV in `/usr/include` and there is no reference to `/usr/local/include` anywhere
The only include that has something to do with OpenCV is the following:
#include
If I have installed OpenCV2 only, the compiler complains a missing definition of `applyColorMap`.
I can solve that by adding in the code the following include:
#include
But if I install OpenCV3, it complains about a redefinition of classes and redeclaration of constants.
When I remove the line, the project compiles normally.
But when I deploy the code on a machine without OpenCV3, it complains about the missing include.
Adding the following:
#if CV_MAJOR_VERSION == 2
#include
#endif
does not help, because the detected major version is 2, although somewhere in cv_bridge I guess, is using the OpenCV3, as indicated by the following error line:
In file included from /usr/local/include/opencv2/core/core.hpp:48:0,
from /usr/include/opencv2/contrib/contrib.hpp:46,
from /home/mcamurri/git/dls-perception/height_publisher/src/HeightPublisher.h:3,
from /home/mcamurri/git/dls-perception/height_publisher/src/HeightPublisher.cpp:1:
/usr/local/include/opencv2/core.hpp:2422:18: error: previous definition of ‘class cv::LDA’
class CV_EXPORTS LDA
↧
How to force my ros package not using some ROS-provided libs?
Let say I created ros package `my_package` that depends on library (or package)`ext_package` version 1. I already installed `ext_package` as stand-alone on my machine and everything worked fine so far...
Now, I created another `new_package` but needs to use `ext_package` provided by ros to read data from topic; need to use bridge. However ROS only provides `ext_package` V2, which is not compatible with V1. Am getting compilation issues.
So I would have to rewrite completely `my_package` to accomodate V2.... which would be amazingly tedious.
Thus the question: how to edit `CMake` file such that `my_package` uses standalone `ext_package` locate at `~/PathToLib/ext_package/build`?
I already tried something like,
unset(EXT_PACKAGE_CONFIG_PATH CACHE)
unset(EXT_PACKAGE_DIR CACHE)
message(STATUS "...initial CMAKE_PREFIX_PATH:")
message(STATUS ${CMAKE_PREFIX_PATH})
set(TMP_PREFIX_PATH ${CMAKE_PREFIX_PATH})
set(CMAKE_PREFIX_PATH "/home/${usrname}/soft/lib/ext_package/build/installed")
message(STATUS "... corrected CMAKE_PREFIX_PATH")
message(STATUS ${CMAKE_PREFIX_PATH})
SET (EXT_PACKAGE_ROOT "/home/${usrname}/soft/lib/ext_package/build/installed")
SET (EXT_PACKAGE_INCLUDE_DIRS "/home/${usrname}/soft/lib/ext_package/build/installed/include")
SET (EXT_PACKAGE_LIBRARY_DIR "/home/${usrname}/soft/lib/ext_package/build/installed/lib")
find_package(ext_package REQUIRED)
... but without success. Any idea please?
P.S. In my case `exta_package` is ViSP. I installed version 2.10 as standalone on my machine. Also, am using ROS Kinetic.
↧
CMake Error: CMAKE_MODULE_PATH does not contain Findcatkin.cmake
I'm trying to install rviz from source. It seems a lot of packages are missing from my installation of ROS from source. So, I worked my way through the github repository, cloned the corresponding folders, copied them into /opt/ros/..., and ran cmake to build the packages from source. This worked fine until the package "genpy" where cmake gives the following error:
CMake Error at CMakeLists.txt:4 (find_package):
By not providing "Findcatkin.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "catkin", but
CMake did not find one.
Could not find a package configuration file provided by "catkin" with any
of the following names:
catkinConfig.cmake
catkin-config.cmake
Add the installation prefix of "catkin" to CMAKE_PREFIX_PATH or set
"catkin_DIR" to a directory containing one of the above files. If "catkin"
provides a separate development package or SDK, be sure it has been
installed.
↧
↧
ResourceNotFound: sbpl on roslaunch
From : https://github.com/sbpl/sbpl
Installed SBPL at /usr/local
tried :
mudit@mudit:$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
`Then:
$ roslaunch sbpl_lattice_planner move_base_sbpl_fake_localization_2.5cm.launch
Shows the following error :
ResourceNotFound: sbpl
ROS path [0]=/opt/ros/kinetic/share/ros
ROS path [1]=/home/mudit/catkin_ws/src
ROS path [2]=/opt/ros/kinetic/share
ROS path [3]=/opt/ros/kinetic/stacks
↧
DSO missing from command line
I was trying to build a node that uses opencv2.4 , when i make it shows me the following error
/home/mahtab/localnix/cv2/lib/libopencv_highgui.so.2.4: error adding symbols: DSO missing from command line
the .so is present there the given directory . i have both opencv3 and opencv2 in my system. opencv2 is installed locally
↧
Error installing using_markers pkg
Hi guys, I am having installing packages around. Now I am following the tutorial *Markers: Sending Basic Shapes (C++)*. I have the *kinetic* version of ROS which I have installed using `apt-get` on Ubuntu 16.04.
The problem comes when I execute the command `catkin_make` in order to build my new code. I get the following error:
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
Could not find a package configuration file provided by
"visualisation_msgs" with any of the following names:
visualisation_msgsConfig.cmake
visualisation_msgs-config.cmake
Add the installation prefix of "visualisation_msgs" to CMAKE_PREFIX_PATH or
set "visualisation_msgs_DIR" to a directory containing one of the above
files. If "visualisation_msgs" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
using_markers/CMakeLists.txt:7 (find_package)
-- Could not find the required component 'visualisation_msgs'. 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.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by
"visualisation_msgs" with any of the following names:
visualisation_msgsConfig.cmake
visualisation_msgs-config.cmake
Add the installation prefix of "visualisation_msgs" to CMAKE_PREFIX_PATH or
set "visualisation_msgs_DIR" to a directory containing one of the above
files. If "visualisation_msgs" provides a separate development package or
SDK, be sure it has been installed.
Call Stack (most recent call first):
using_markers/CMakeLists.txt:7 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/lucadg/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/lucadg/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
----------------
Then I've tried to install the package **visualisation_msgs** as it is always available for kinetic and I still get the same error.
Thank you in advance for your help
↧
Packages dependency and includes
Hi all,
I have a **package1** which generates services via a Type1.srv file. These generated services are located in **/devel/include/package1/Type1.h**. This all works fine.
Now when I want a **package2** to also use the services generated in **package1** I follow the steps described [in here](http://docs.ros.org/indigo/api/catkin/html/howto/format2/cpp_msg_dependencies.html).
Note that in my code I do not actually add *package1* to *find_package*, because *package1* is not compiled yet when *find_package* is called in *package2*.
Now when building I get the following error:
/src/package2/src/MyFile.cpp:2:32: fatal error: package1/Type1.h: No such file or directory
When I manually add include path **/devel/include** to **include_directories**, it compiles and links fine, but it is obviously very dirty...
Anyone knows what I am missing here? How can I let my system know about the include path to **devel**?
**-------------------EDIT 1---------------**
Note that when I add **package1** to **find_package(catkin REQUIRED COMPONENTS ... package1)** I get the following error:
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:
package1Config.cmake
package1-config.cmake
Add the installation prefix of "package1" to CMAKE_PREFIX_PATH or set "package1_DIR" to a directory containing one of the above files. If "package1" provides a separate development package or SDK, be sure it has been installed.
**-------------------EDIT 2---------------**
File **package1/package.xml** does exist and has the following name
package1 0.1.0
**package1/CMakeLists.txt** contains
project(package1)
...
catkin_package(
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS rtt_ros message_runtime std_msgs
)
and **package2/CMakeLists.txt** contains
find_package(catkin REQUIRED COMPONENTS roscpp std_msgs package1)
This causes the error described above.
Kind regards,
Antoine.
↧
↧
Package dependencies and include dirs
Hi all,
I have a **package1** which generates services via a Type1.srv file. These generated services are located in **/devel/include/package1/Type1.h**. This all works fine.
Now when I want a **package2** to also use the services generated in **package1** I follow the steps described [in here](http://docs.ros.org/indigo/api/catkin/html/howto/format2/cpp_msg_dependencies.html).
Now when building I get the following error:
... fatal error: package1/Type1.h: No such file or directory
#include "package1/Type1.h"
^
compilation terminated.
Now it turns out **package1/Type1.h** is well generated and does lie in **devel/include/package1/Type1.h**.
So I output the content of **package1_FOUND, package1_INCLUDE_DIRS** and **catkin_INCLUDE_DIRS** from **package2**'s **CMakeLists.txt** and it reads:
package1_FOUND : 1
package1_INCLUDE_DIRS : /opt/ros/indigo/include/usr/include
catkin_INCLUDE_DIRS : /opt/ros/indigo/include/usr/include
I would expect to get **../devel/include** for these values, no?
Anyone knows what I am missing here? How can I let my system know about the include path to **devel/include**? I guess I do not have to set these includes by hand, do I?
Kind regards,
Antoine.
↧
CMake error while executing catkin_make on Ubuntu 14.04 with ROS Jade
I am new to ROS and just getting it installed and configured using the method here: http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment
I am a beginner and have minimal knowledge of these things, so it would be helpful if someone could present a simplified solution that would solve my problem.
I can run everything correctly till I encounter the command `catkin_make` which produces the following error: Base path: /home/tejas/catkin_ws Source space: /home/tejas/catkin_ws/src Build space: /home/tejas/catkin_ws/build Devel space: /home/tejas/catkin_ws/devel Install space: /home/tejas/catkin_ws/install #### #### Running command: "cmake /home/tejas/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/tejas/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/tejas/catkin_ws/install -G Unix Makefiles" in "/home/tejas/catkin_ws/build" #### -- Using CATKIN_DEVEL_PREFIX: /home/tejas/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/jade -- This workspace overlays: /opt/ros/jade -- Using PYTHON_EXECUTABLE: /home/tejas/anaconda/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/tejas/catkin_ws/build/test_results -- Found gtest sources under '/usr/src/gtest': gtests will be built -- Using Python nosetests: /usr/bin/nosetests-2.7 Traceback (most recent call last): File "/opt/ros/jade/share/catkin/cmake/parse_package_xml.py", line 98, in
main() File "/opt/ros/jade/share/catkin/cmake/parse_package_xml.py",
line 90, in main
package = parse_package(args.package_xml) File
"/home/tejas/anaconda/lib/python2.7/site-packages/catkin_pkg/package.py",
line 317, in parse_package
return parse_package_string(f.read(),
filename) File
"/home/tejas/anaconda/lib/python2.7/site-packages/catkin_pkg/package.py",
line 450, in parse_package_string
raise InvalidPackage('Error(s) in %s:%s' % (filename, ''.join(['\n- %s'
% e for e in errors])))
catkin_pkg.package.InvalidPackage:
Invalid package manifest
"/opt/ros/jade/share/catkin/cmake/../package.xml":
Error(s) in
/opt/ros/jade/share/catkin/cmake/../package.xml:
- The manifest must not contain the following tags: depend,
build_export_depend,
buildtool_export_depend CMake Error at
/opt/ros/jade/share/catkin/cmake/safe_execute_process.cmake:11
(message):
execute_process(/home/tejas/anaconda/bin/python
"/opt/ros/jade/share/catkin/cmake/parse_package_xml.py"
"/opt/ros/jade/share/catkin/cmake/../package.xml"
"/home/tejas/catkin_ws/build/catkin/catkin_generated/version/package.cmake")
returned error code 1 Call Stack (most
recent call first):
/opt/ros/jade/share/catkin/cmake/catkin_package_xml.cmake:63
(safe_execute_process)
/opt/ros/jade/share/catkin/cmake/all.cmake:151
(_catkin_package_xml)
/opt/ros/jade/share/catkin/cmake/catkinConfig.cmake:20
(include) CMakeLists.txt:52
(find_package)
-- Configuring incomplete, errors occurred! See also
"/home/tejas/catkin_ws/build/CMakeFiles/CMakeOutput.log". See also
"/home/tejas/catkin_ws/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
I can run everything correctly till I encounter the command `catkin_make` which produces the following error: Base path: /home/tejas/catkin_ws Source space: /home/tejas/catkin_ws/src Build space: /home/tejas/catkin_ws/build Devel space: /home/tejas/catkin_ws/devel Install space: /home/tejas/catkin_ws/install #### #### Running command: "cmake /home/tejas/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/tejas/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/tejas/catkin_ws/install -G Unix Makefiles" in "/home/tejas/catkin_ws/build" #### -- Using CATKIN_DEVEL_PREFIX: /home/tejas/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/jade -- This workspace overlays: /opt/ros/jade -- Using PYTHON_EXECUTABLE: /home/tejas/anaconda/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/tejas/catkin_ws/build/test_results -- Found gtest sources under '/usr/src/gtest': gtests will be built -- Using Python nosetests: /usr/bin/nosetests-2.7 Traceback (most recent call last): File "/opt/ros/jade/share/catkin/cmake/parse_package_xml.py", line 98, in
↧
problem creating directory: /opt/ros/kinetic
Hi, I am trying install ROS kinetic in my Raspberry Pi 3 and have this error when I execute this command
./src/catkin/bin/catkin_make_isolated --install - DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic
I want say that is my first time that I working with RaspberryPi
-- catkin 0.7.4
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/ros_catkin_ws/build_isolated/catkin
Install the project...
-- Install configuration: "Release"
CMake Error at cmake_install.cmake:38 (file):
file problem creating directory: /opt/ros/kinetic
Makefile:66: recipe for target 'install' failed
make: *** [install] Error 1
<== Failed to process package 'catkin':
Command '['make', 'install']' returned non-zero exit status 2
Reproduce this error by running:
==> cd /home/pi/ros_catkin_ws/build_isolated/catkin && make install
Command failed, exiting.
Anyody can help me? please
↧
Cmake cannot find package for dji onboard sdk file
Hi
I was using dji onboard SDK for develop and meet problems about include sdk file into my project.
I put several project in one workspace,

After i 'catkin_make' it, it shows error,
CMake Warning at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
Could not find a package configuration file provided by "dji_sdk" with any
of the following names:
dji_sdkConfig.cmake
dji_sdk-config.cmake
Add the installation prefix of "dji_sdk" to CMAKE_PREFIX_PATH or set
"dji_sdk_DIR" to a directory containing one of the above files. If
"dji_sdk" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
meteorOnboard/fcu/CMakeLists.txt:8 (find_package)
-- Could not find the required component 'dji_sdk'. 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.
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "dji_sdk" with any
of the following names:
dji_sdkConfig.cmake
dji_sdk-config.cmake
Add the installation prefix of "dji_sdk" to CMAKE_PREFIX_PATH or set
"dji_sdk_DIR" to a directory containing one of the above files. If
"dji_sdk" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
meteorOnboard/fcu/CMakeLists.txt:8 (find_package)
Any advice appreciated.
Glen
↧
↧
The Good (C++11/14), the Bad (CMAKE_CXX_FLAGS) and the Ugly (cmake)
I have tried to find an updated answer with the best practices when dealing with ROS and C++11/14, but everything is messy or out of date...
### 0 - Setting the C++ standard directly [DEPRECATED]
I know that the quicker way to enable C++11/14 is to add in the `CMakeLists.txt` one of the following macros
cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
...
set(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_CXX_FLAGS "-std=c++14")
even with all the possible checks (see the many answers on SO or [this one](http://answers.ros.org/question/152276/is-there-a-way-to-enable-c11-support-for-catkin-packages/)).
Nonetheless it is written everywhere - apparently not enough though - **NOT to set** `CMAKE_CXX_FLAGS` (e.g. [catkin docs](http://docs.ros.org/kinetic/api/catkin/html/user_guide/standards.html)).
---
So I have searched a bit more to find some updated guidelines for cmake and C++11/14 like the followings: [[1]](http://stackoverflow.com/questions/10851247/how-to-activate-c-11-in-cmake), [[2]](http://stackoverflow.com/questions/10984442/how-to-detect-c11-support-of-a-compiler-with-cmake), [[3]](https://crascit.com/2015/03/28/enabling-cxx11-in-cmake/), [[4]](http://www.slideshare.net/DanielPfeifer1/cmake-48475415). It comes out that since `cmake v3.1/3.2` there are two main methods which overcome the `CMAKE_CXX_FLAGS` manual setup.
### 1 - Setting the C++ standard directly
The standard C++11/14 can be specified directly and the `*_REQUIRED` protects the building from potential compiler errors if the standard is not supported.
cmake_minimum_required(VERSION 3.2.0 FATAL_ERROR)
...
set_property(TARGET target1 target2 ... PROPERTY CXX_STANDARD 11) # 98, 11 or 14
set_property(TARGET target1 target2 ... PROPERTY CXX_STANDARD_REQUIRED ON)
References: [[5]](https://cmake.org/cmake/help/v3.2/command/set_property.html), [[6]](https://cmake.org/cmake/help/v3.2/prop_tgt/CXX_STANDARD.html), [[7]](https://cmake.org/cmake/help/v3.2/prop_tgt/CXX_STANDARD_REQUIRED.html).
Otherwise the `CMAKE_*` variables specify the properties for all the targets in the `CMakeLists.txt` ([[8]](https://cmake.org/cmake/help/v3.2/variable/CMAKE_CXX_STANDARD.html), [[9]](https://cmake.org/cmake/help/v3.2/variable/CMAKE_CXX_STANDARD_REQUIRED.html)).
### 2 - Setting the C++ standard based on features
If a finer tuning or a higher control is required, the right C++ standard can be set from the features which are really used in the code. This is surely more accurate, but it requires time to be properly set (lots of features) and can be fragile if not supported correctly over time.
cmake_minimum_required(VERSION 3.2.0 FATAL_ERROR)
...
target_compile_features(myTarget
PUBLIC
cxx_variadic_templates
cxx_nullptr
...
PRIVATE
cxx_lambdas
...
)
References: [[10]](https://cmake.org/cmake/help/v3.2/command/target_compile_features.html), [[11]](https://cmake.org/cmake/help/v3.2/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html).
---
### Note
In every docs regarding ROS you **always** find `cmake_minimum_required(VERSION 2.8.3)` which is fine to guarantee that our code could be compiled even with older cmake version, and everybody seems happy.
The current version of cmake shipped with Ubuntu 16.04 and ROS Kinetic (both LTS, and hoping the new standard for at least a couple of years) is the `3.5.1`. The drawback of allowing such an old cmake compatibility is the unkown behaviour in not tested old systems (which is the case of almost every small project). Indeed another best practice for cmake usage is to set the minimum required version to the lower testable one.
The question is: what is ROS waiting for to increase the minimum requirements to at least `cmake v3.2` and to improve docs with updated best practices?
↧
How to set the cached CMAKE_PREFIX_PATH as current
I get the message
WARNING: Your current environment's CMAKE_PREFIX_PATH is different from
the cached CMAKE_PREFIX_PATH used the last time this workspace was built.
whenever I build and then it proceeds to use the wrong path to build.
But I cannot figure out how or why it is resetting this variable.
↧
catkin cmake error with ros (error code 1)
Hello everyone, I am following the tutorial here to create a workspace with catkin: http://wiki.ros.org/catkin/Tutorials/create_a_workspace
When I invoke catkin_make, I get this output:
ertugrul@Ertugrul-Laptop:~/ros/workspace/tutorial$ catkin_make
Base path: /home/ertugrul/ros/workspace/tutorial
Source space: /home/ertugrul/ros/workspace/tutorial/src
Build space: /home/ertugrul/ros/workspace/tutorial/build
Devel space: /home/ertugrul/ros/workspace/tutorial/devel
Install space: /home/ertugrul/ros/workspace/tutorial/install
####
#### Running command: "cmake /home/ertugrul/ros/workspace/tutorial/src -DCATKIN_DEVEL_PREFIX=/home/ertugrul/ros/workspace/tutorial/devel -DCMAKE_INSTALL_PREFIX=/home/ertugrul/ros/workspace/tutorial/install -G Unix Makefiles" in "/home/ertugrul/ros/workspace/tutorial/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/ertugrul/ros/workspace/tutorial/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/kinetic
-- This workspace overlays: /opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /home/ertugrul/anaconda2/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/ertugrul/ros/workspace/tutorial/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
Traceback (most recent call last):
File "/opt/ros/kinetic/share/catkin/cmake/parse_package_xml.py", line 107, in
main()
File "/opt/ros/kinetic/share/catkin/cmake/parse_package_xml.py", line 99, in main
package = parse_package(args.package_xml)
File "/home/ertugrul/anaconda2/lib/python2.7/site-packages/catkin_pkg/package.py", line 317, in parse_package
return parse_package_string(f.read(), filename)
File "/home/ertugrul/anaconda2/lib/python2.7/site-packages/catkin_pkg/package.py", line 450, in parse_package_string
raise InvalidPackage('Error(s) in %s:%s' % (filename, ''.join(['\n- %s' % e for e in errors])))
catkin_pkg.package.InvalidPackage: Invalid package manifest "/opt/ros/kinetic/share/catkin/cmake/../package.xml": Error(s) in /opt/ros/kinetic/share/catkin/cmake/../package.xml:
- The manifest must not contain the following tags: depend, build_export_depend, buildtool_export_depend
CMake Error at /opt/ros/kinetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(/home/ertugrul/anaconda2/bin/python
"/opt/ros/kinetic/share/catkin/cmake/parse_package_xml.py"
"/opt/ros/kinetic/share/catkin/cmake/../package.xml"
"/home/ertugrul/ros/workspace/tutorial/build/catkin/catkin_generated/version/package.cmake")
returned error code 1
Call Stack (most recent call first):
/opt/ros/kinetic/share/catkin/cmake/catkin_package_xml.cmake:63 (safe_execute_process)
/opt/ros/kinetic/share/catkin/cmake/all.cmake:151 (_catkin_package_xml)
/opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:20 (include)
CMakeLists.txt:52 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/ertugrul/ros/workspace/tutorial/build/CMakeFiles/CMakeOutput.log".
See also "/home/ertugrul/ros/workspace/tutorial/build/CMakeFiles/CMakeError.log".
Invoking "cmake" failed
I have tried anything I could find online, but I'm now clueless. Thank you for any help!
↧
Annoying cmake warning
Anyone else get a message like this when compiling with Kinetic?
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:166 (message): catkin_package() DEPENDS on '/usr/lib/x86_64-linux-gnu/libSDLmain.a' but neither '/usr/lib/x86_64-linux-gnu/libSDLmain.a_INCLUDE_DIRS' nor '/usr/lib/x86_64-linux-gnu/libSDLmain.a_LIBRARIES' is defined.
Call Stack (most recent call first): /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:102 (_catkin_package) ros-keyboard/CMakeLists.txt:26 (catkin_package)
↧
↧
CUDA Version to use with ROS Indigo
Folks,
Any recommended version of CUDA to utilize with ROS Indigo? You know, ROS Indigo (and me) uses OpenCV2.4, etc.
Any CUDA version, such as the latest work? Or is CUDA 7.5 the recommended version?
↧
Modifying roscpp scripts (msg_gen.py)
I would like to make local modifications to msg_gen.py for my packages. I've successfully modified C++ libraries in roscpp by using a copy of roscpp in my workspace, and these changes are picked up by other C++ packages/nodes which depend on the roscpp library.
However, when I modify `roscpp/rosbuild/scripts/msg_gen.py`, the changes don't actually take effect — it seems like the `generate_messages()` cmake function in my other packages somehow knows to use the system version (`/opt/ros/indigo/share/roscpp/rosbuild/scripts/msg_gen.py`).
What do I need to do so that `generate_messages()` can use the local, modified version of the message generator?
↧
My own library wont include
I have made my own library, and i want to include it in an other package, but i keep running in to this problem:
CMake Warning at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
Could not find a package configuration file provided by "lib_polygon" with
any of the following names:
lib_polygonConfig.cmake
lib_polygon-config.cmake
Add the installation prefix of "lib_polygon" to CMAKE_PREFIX_PATH or set
"lib_polygon_DIR" to a directory containing one of the above files. If
"lib_polygon" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
ci-rss-golfpicker/ci-ros-common/ci_executors/path_recorder/CMakeLists.txt:7 (find_package)
-- Could not find the required component 'lib_polygon'. 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.
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "lib_polygon" with
any of the following names:
lib_polygonConfig.cmake
lib_polygon-config.cmake
Add the installation prefix of "lib_polygon" to CMAKE_PREFIX_PATH or set
"lib_polygon_DIR" to a directory containing one of the above files. If
"lib_polygon" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
ci-rss-golfpicker/ci-ros-common/ci_executors/path_recorder/CMakeLists.txt:7 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/bonde/catkin_ws/golfpicker/build/CMakeFiles/CMakeOutput.log".
See also "/home/bonde/catkin_ws/golfpicker/build/CMakeFiles/CMakeError.log".
make: *** [cmake_check_build_system] Error 1
My library cmake file:
cmake_minimum_required(VERSION 2.8.3)
project(lib_polygon)
## 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 COMPONENTS
roscpp
ci_msgs
msgs
)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
################################################
## Declare ROS messages, services and actions ##
################################################
## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
## * add a build_depend tag for "message_generation"
## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
## but can be declared for certainty nonetheless:
## * add a run_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
## * add "message_generation" and every package in MSG_DEP_SET to
## find_package(catkin REQUIRED COMPONENTS ...)
## * add "message_runtime" and every package in MSG_DEP_SET to
## catkin_package(CATKIN_DEPENDS ...)
## * uncomment the add_*_files sections below as needed
## and list every .msg/.srv/.action file to be processed
## * uncomment the generate_messages entry below
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
## Generate messages in the 'msg' folder
# add_message_files(
# FILES
# Message1.msg
# Message2.msg
# )
## Generate services in the 'srv' folder
# add_service_files(
# FILES
# Service1.srv
# Service2.srv
# )
## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )
## Generate added messages and services with any dependencies listed here
# generate_messages(
# DEPENDENCIES
# std_msgs # Or other packages containing msgs
# )
################################################
## Declare ROS dynamic reconfigure parameters ##
################################################
## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
## * add a build_depend and a run_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
## * add "dynamic_reconfigure" to
## find_package(catkin REQUIRED COMPONENTS ...)
## * uncomment the "generate_dynamic_reconfigure_options" section below
## and list every .cfg file to be processed
## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
# cfg/DynReconf1.cfg
# cfg/DynReconf2.cfg
# )
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
INCLUDE_DIRS include
LIBRARIES ci_can_lib
CATKIN_DEPENDS roscpp ci_msgs
# DEPENDS system_lib
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(include
${catkin_INCLUDE_DIRS}
)
add_library(ci_can_lib
src/simple_Polygon.cpp
)
## Declare a C++ library
# add_library(ci_can_lib
# src/${PROJECT_NAME}/ci_can_lib.cpp
# )
## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
add_dependencies(lib_polygon
${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS}
ci_msgs_gencpp
msgs_gencpp
)
## Declare a C++ executable
# add_executable(ci_can_lib_node src/ci_can_lib_node.cpp)
## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(ci_can_lib_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Specify libraries to link a library or executable target against
# target_link_libraries(ci_can_lib_node
# ${catkin_LIBRARIES}
# )
#############
## Install ##
#############
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
## Mark executables and/or libraries for installation
install(TARGETS lib_polygon
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
## Mark cpp header files for installation
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
# PATTERN ".svn" EXCLUDE
)
## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_ci_can_lib.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
and my package cmake:
cmake_minimum_required(VERSION 2.8.3)
project(path_recorder)
## 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 COMPONENTS
std_msgs
roscpp
message_generation
nodegen
nav_msgs
geometry_msgs
lib_polygon
msgs
)
## node generation
generate_nodemodel(model/path_recorder.rnd)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
################################################
## Declare ROS messages, services and actions ##
################################################
## Generate messages in the 'msg' folder
add_message_files(
FILES
Polygon64.msg
)
## Generate services in the 'srv' folder
add_service_files(
FILES
RecordPolygon.srv
EndPolygon.srv
)
## Generate actions in the 'action' folder
# add_action_files(
# FILES
# Action1.action
# Action2.action
# )
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_msgs
geometry_msgs
nav_msgs
)
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
##INCLUDE_DIRS: uncomment this if you package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES path_recorder
CATKIN_DEPENDS message_runtime std_msgs nav_msgs geometry_msgs lib_polygon
# DEPENDS system_lib
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
${NODEGEN_INC}
${catkin_INCLUDE_DIRS}
)
## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(path_recorder ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Declare a C++ executable
add_executable(path_recorder_node
src/path_recorder_node.cpp
src/Recorder.cpp
#src/simple_Polygon.cpp
${NODEGEN_SRC}
)
## Add dependencies to the executable
add_dependencies(path_recorder_node
${PROJECT_NAME}
${PROJECT_NAME}_genmodel
lib_simple_polygon
msgs_gencpp
${PROJECT_NAME}_generate_msgs
${PROJECT_NAME}_gencpp
)
## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(ci_bq27000_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
## Specify libraries to link a library or executable target against
target_link_libraries(path_recorder_node
${catkin_LIBRARIES}
)
#############
## Install ##
#############
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
# scripts/my_python_script
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
# path_recorder path_recorder_node
## Mark executables and/or libraries for installation
install(TARGETS path_recorder_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
## Mark cpp header files for installation
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.hpp"
# PATTERN ".svn" EXCLUDE
)
## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
# # myfile1
# # myfile2
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_path_recorder.cpp)
# if(TARGET ${PROJECT_NAME}-test)
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
## Add folders to be run by python nosetests
# catkin_add_nosetests(test)
Hope you can help me figure out what i am doing wrong
Edit: I pasted the wrong cmake file for the library, it has been updated
↧