如何修复 ROS 错误:missing rostimeConfig.cmake

问题

尝试使用 colcon build 构建某些 ROS 包时,你看到如下错误消息

cmake_error_rostime.txt
CMake Error at /home/uli/dev/Versatile/catkin/install/catkin/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "rostime" with any
  of the following names:

    rostimeConfig.cmake
    rostime-config.cmake

  Add the installation prefix of "rostime" to CMAKE_PREFIX_PATH or set
  "rostime_DIR" to a directory containing one of the above files.  If
  "rostime" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:8 (find_package)

解决方案

rostime 目前没有作为 ROS jazzy 的 apt 包提供。

因此,克隆仓库,使用 colcon 构建它,然后在构建你的包之前 source install/setup.bash

build_rostime.sh
git clone https://github.com/ros/roscpp_core.git
cd roscpp_core/rostime
colcon build
source install/setup.bash

之后(在同一个 shell 中),再次使用 colcon build 构建你的其他包。


Check out similar posts by category: ROS