在使用源码编译安装的Ros环境后,把原来机器上的代码拷贝过来,重新编译。
报错
具体编译报错如下:
~/hellolinux/slam/src/robotChassis/include/RosBase.h:13:10: fatal error: move_base_msgs/MoveBaseAction.h: 没有那个文件或目录
#include <move_base_msgs/MoveBaseAction.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ~/hellolinux/slam/src/robotChassis/include/RosMsg.h:4:0,
解决办法
原因分析: 通过搜索发现实际上头文件是存在的,只不过在系统的换中没有索引到
解决办法如下操作:
sudo cp /opt/ros/melodic/include/* -rf /usr/local/include/
重新编译OK