【解决问题】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

安装完后,再回去编译就好啦。

你可能感兴趣的:(嵌入式)