[ 3%] Generating dynamic reconfigure files from cfg/Params_PID.cfg: /home/ubuntu/new_workspace/devel/include/simple_follower/Params_PIDConfig.h /home/ubuntu/new_workspace/devel/lib/python2.7/dist-packages/simple_follower/cfg/Params_PIDConfig.py Generating reconfiguration files for Params_PID in simple_follower Wrote header file in /home/ubuntu/new_workspace/devel/include/simple_follower/Params_PIDConfig.h In file included from /home/ubuntu/new_workspace/src/lsx10/lslidar_x10_driver/src/input.cc:18:0: /home/ubuntu/new_workspace/src/lsx10/lslidar_x10_driver/include/lslidar_x10_driver/input.h:35:10: fatal error: lslidar_x10_msgs/LslidarX10Packet.h: No such file or directory #include <lslidar_x10_msgs/LslidarX10Packet.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. lsx10/lslidar_x10_driver/CMakeFiles/lslidar_input_x10.dir/build.make:62: recipe for target 'lsx10/lslidar_x10_driver/CMakeFiles/lslidar_input_x10.dir/src/input.cc.o' failed make[2]: *** [lsx10/lslidar_x10_driver/CMakeFiles/lslidar_input_x10.dir/src/input.cc.o] Error 1 CMakeFiles/Makefile2:10548: recipe for target 'lsx10/lslidar_x10_driver/CMakeFiles/lslidar_input_x10.dir/all' failed make[1]: *** [lsx10/lslidar_x10_driver/CMakeFiles/lslidar_input_x10.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... Generating reconfiguration files for params in rplidar_ros Wrote header file in /home/ubuntu/new_workspace/devel/include/rplidar_ros/paramsConfig.h [ 3%] Built target simple_follower_gencfg [ 3%] Built target rplidar_ros_gencfg [ 3%] Linking CXX executable /home/ubuntu/new_workspace/devel/lib/rplidar_ros/rplidarNodeClient [ 3%] Built target rplidarNodeClient Makefile:140: recipe for target 'all' failed make: *** [all] Error 2 Invoking "make -j4 -l4" failed
时间: 2023-07-29 17:11:25 浏览: 215
这段编译日志也出现了编译错误,错误提示为 "fatal error: lslidar_x10_msgs/LslidarX10Packet.h: No such file or directory"。这个错误提示表明编译器找不到 LslidarX10Packet.h 头文件。这有可能是因为 LslidarX10Packet.h 头文件没有正确包含进来或者路径设置有误导致的。
要解决这个问题,需要检查代码中是否正确包含了 LslidarX10Packet.h 头文件,并且路径是否正确。如果 LslidarX10Packet.h 头文件确实没有包含进来,可以在代码中添加包含语句,例如:
```
#include "lslidar_x10_msgs/LslidarX10Packet.h"
```
另外,也需要确保 LslidarX10Packet.h 头文件所在的路径已经正确设置。可以在 CMakeLists.txt 文件中添加如下的语句:
```
include_directories(${catkin_INCLUDE_DIRS})
```
其中 ${catkin_INCLUDE_DIRS} 是 ROS 中自动设置的包含路径,可以确保头文件能够被正确找到。如果还是编译失败,可以尝试在命令行中使用 "roscd lslidar_x10_msgs" 命令进入到 lslidar_x10_msgs 包所在的路径,然后使用 "pwd" 命令获取当前路径,并将其添加到 CMakeLists.txt 文件中的 include_directories() 函数中。这样,重新编译代码应该就能够成功了。
阅读全文