【解決問題】CMake Error at /opt/ros/melodic/catkin..Could not find a package..by ackermann_msgs

本博客運行環境爲Ubuntu 18.04.

今天在ROS工作區下編譯時遇到如下錯誤:
– Could NOT find ackermann_msgs (missing: ackermann_msgs_DIR)
– Could not find the required component ‘ackermann_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/melodic/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "ackermann_msgs"

with any of the following names:
ackermann_msgsConfig.cmake
ackermann_msgs-config.cmake

Add the installation prefix of “ackermann_msgs” to CMAKE_PREFIX_PATH or set
“ackermann_msgs_DIR” to a directory containing one of the above files. If
“ackermann_msgs” provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
racecar_simulator-master/CMakeLists.txt:43 (find_package)

– Configuring incomplete, errors occurred!
See also “/home/hadoop/catkin_wsild/CMakeFiles/CMakeOutput.log”.
See also “/home/hadoop/catkin_wsild/CMakeFiles/CMakeError.log”.
Invoking “cmake” failed

解決方案

安裝如下內容:
ros-melodic-tf2-geometry-msgs
ros-melodic-ackermann-msgs
ros-melodic-joy
ros-melodic-map-server

使用如下命令:

sudo apt-get install ros-melodic-tf2-geometry-msgs ros-melodic-ackermann-msgs ros-melodic-joy ros-melodic-map-server

安裝完後,再回去編譯就好啦。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章