笨办法
按照报错提示安装对应的软件包。例如报错为:
Could not find a package configuration file provided by "industrial_msgs"
就应该安装industrial_msgs
这个包。具体操作为:
sudo apt-get install ros-kinetic-industrial-msgs
缺失其他包同理。
高级方法
使用rosdep
管理依赖。只要CMakeList里面没写错,rosdep
将自动安装缺失的软件包。具体操作为:
cd ws_example/src
rosdep install -y --from-paths . --ignore-src --rosdistro melodic