Build catkin packages with colcon
Hello all,
in my ROS2 workspace I want to build two packages which use the catkin build system ( https://github.com/KIT-MRT/mrt_cmake_... and https://github.com/fzi-forschungszent... ). From the colcon documentation I take that it should be able to use catkin as underlying build system. However when I run colcon build
on the workspace it throws the error:
user@user-VirtualBox:~/ros2_ws$ colcon build
Starting >>> mrt_cmake_modules
--- stderr: mrt_cmake_modules
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.
---
Failed <<< mrt_cmake_modules [ Exited with code 1 ]
Summary: 0 packages finished [0.63s]
1 package failed: mrt_cmake_modules
1 package had stderr output: mrt_cmake_modules
10 packages not processed
So cmake is apparently not able to "find" catkin. A colcon info
correctly identifies the package as type: ros.catkin. If I do a catkin build in a separate catkin workspace it works. I am using Ubuntu 18.04 with both ros-melodic and ros-crystal installed from the ROS repositories. As requested, some further version information:
user@user-VirtualBox:~/ros2_ws$ colcon version-check
colcon-argcomplete 0.3.2: up-to-date
colcon-bash 0.3.2: up-to-date
colcon-cmake 0.2.8: up-to-date
colcon-core 0.3.18: newer version available (0.3.19)
colcon-defaults 0.2.1: up-to-date
colcon-devtools 0.2.1: up-to-date
colcon-library-path 0.2.1: up-to-date
colcon-metadata 0.2.1: up-to-date
colcon-notification 0.2.6: newer version available (0.2.7)
colcon-output 0.2.3: up-to-date
colcon-package-information 0.2.2: up-to-date
colcon-package-selection 0.2.3: newer version available (0.2.4)
colcon-parallel-executor 0.2.3: up-to-date
colcon-pkg-config 0.1.0: up-to-date
colcon-powershell 0.3.4: up-to-date
colcon-python-setup-py 0.2.1: up-to-date
colcon-recursive-crawl 0.2.0: up-to-date
colcon-ros 0.3.8: up-to-date
colcon-test-result 0.3.1: up-to-date
colcon-zsh 0.3.2: up-to-date
I would be thankful if you could point me in the right direction here.
Please provide more information, e.g. the full output of the invocation (this posted snippet is unlikely to be all), the output of
colcon version-check
.I added the requested info. For now I do not know how I can upgrade the colcon packages to a newer version independent of the deb package repositories.
The latest versions are available via Debian packages. So the usual
sudo apt update && sudo apt dist-upgrade
should get them.What do the following commands output:
env | grep CMAKE_PREFIX_PATH
(in the terminal where you invokedcolcon build
) andcolcon info mrt_cmake_modules
?Okay, my packages are already up-to-date with the repositories. The CMAKE_PREFIX_PATH variable is not found (this should probably not be the case..). The last command returns: