如果slam package依赖robot_msg package,此时需要先编译robot_msg.
一、在slam/package.xml中
<depend>robot_msg</depend>
二、在slam/CMakeList.txt中
catkin_package(
CATKIN_DEPENDS roscpp robot_msg
)
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
如果是slam工程内部的自定义消息
在CMakeList.txt中添加:
add_dependencies(${PROJECT_NAME}__generate_messages_cpp )
add_executable(back_end_node src/apps/back_end_node.cpp)
add_dependencies(back_end_node lidar_localization_generate_messages_cpp ${catkin_EXPORTED_TARGETS})
target_link_libraries(back_end_node ${catkin_LIBRARIES} ${ALL_TARGET_LIBRARIES})
网友评论