遇到报错:
--- stderr: integrated_viewer
CMakeFiles/integrated_viewer.dir/node/traffic_light_plugin/traffic_light_plugin.cpp.o: In function `integrated_viewer::TrafficLightPlugin::SetStateInfo(integrated_viewer::TrafficLightPlugin::StateInfo)':
traffic_light_plugin.cpp:(.text+0x31b): undefined reference to `cv::Mat::Mat(int, int, int, cv::Scalar_<double> const&)'
CMakeFiles/integrated_viewer.dir/node/image_viewer_plugin/image_viewer_plugin.cpp.o: In function `integrated_viewer::ImageViewerPlugin::UpdateTopicList()':
image_viewer_plugin.cpp:(.text+0x1879): undefined reference to `cv::Mat::clone() const'
解决问题:
在calibration_publisher功能包中找到对应Cmakelists.txt文件:
//15行指定opencv版本,需要注意你自己安装的版本
find_package(OpenCV 3.4 REQUIRED)
59行target_link_libraries加入${OpenCV_LIBS}:
target_link_libraries(calibration_publisher
${catkin_LIBRARIES}
${OpenCV_LIBS}
)
105行target_link_libraries加入${OpenCV_LIBS}:
target_link_libraries(${PROJECT_NAME}
${QT_LIBRARIES}
${catkin_LIBRARIES}
${OpenCV_LIBS}
)
问题解决,再次编译通过。