在fase_ws中编译源码,遇如下报错:
/home/gordon/fase_ws/src/fsae/ground_car/plugins/gazebo_ros_block_laser.cpp:27:45: fatal error: gazebo_plugins/gazebo_ros_utils.h: No such file or directory compilation terminated
在同工作空间的路径下找到ros包——gazabo_plugins,在其中找到gazebo_ros_utils.h。
尝试解决方法一:
先单独编译gazebo_plugins包,再编译ground_car包,遇相同报错。
尝试解决方法二:
检查CMakeLists.txt,将gazebo_ros_block_laser.cpp编译成库的指令如下
add_library(gazebo_ros_block_laser SHARED plugins/gazebo_ros_block_laser.cpp) target_link_libraries(gazebo_ros_block_laser ${GAZEBO_LIBRARIES} ${IGNITION-MSGS_LIBRARIES} )
添加 ${catkin_LIBRARIES}
add_library(gazebo_ros_block_laser SHARED plugins/gazebo_ros_block_laser.cpp) target_link_libraries(gazebo_ros_block_laser ${GAZEBO_LIBRARIES} ${IGNITION-MSGS_LIBRARIES} ${catkin_LIBRARIES})
解决问题!