CMake Error at /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake:113 (message):
Project 'cv_bridge' specifies '/usr/include/opencv' as an include dir,
which is not found. It does neither exist as an absolute directory nor in
'${{prefix}}//usr/include/opencv'.
参考:https://blog.csdn.net/qq_53627591/article/details/126116822
原因是:NVIDIA xaiver的镜像image自带的是opencv4版本,下面把opencv命名成了opencv4
sudo gedit /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake
修改前
if(NOT "include;/usr/include;/usr/include/opencv " STREQUAL " ")
set(cv_bridge_INCLUDE_DIRS "")
set(_include_dirs "include;/usr/include;/usr/include/opencv")
修改后
if(NOT "include;/usr/include;/usr/include/opencv4 " STREQUAL " ")
set(cv_bridge_INCLUDE_DIRS "")
set(_include_dirs "include;/usr/include;/usr/include/opencv4")
下面这个报错在其他程序里面出现,在编译速腾聚创激光雷达驱动没有出现,此处作为参考
CMake Error at /opt/ros/melodic/share/grid_map_cv/cmake/grid_map_cvConfig.cmake:113 (message):
Project 'grid_map_cv' specifies '/usr/include/opencv' as an include dir,
which is not found. It does neither exist as an absolute directory nor in
'${{prefix}}//usr/include/opencv'. Check the issue tracker
'http://github.com/anybotics/grid_map/issues' and consider creating a
ticket if the problem has not been reported yet.
修改上面报错的第一行中的文件的94行和96行,将opencv替换为opencv4:
修改前
if(NOT "include;/usr/include;/usr/include/opencv " STREQUAL " ")
set(grid_map_cv_INCLUDE_DIRS "")
set(_include_dirs "include;/usr/include;/usr/include/opencv")
修改后
if(NOT "include;/usr/include;/usr/include/opencv4 " STREQUAL " ")
set(grid_map_cv_INCLUDE_DIRS "")
set(_include_dirs "include;/usr/include;/usr/include/opencv4")
xx/src/A-LOAM/src/draw_boxes.cpp:7:10: fatal error: opencv/cv.h: 没有那个文件或目录
#include
修改 #include
为 #include
error: ‘CV_LOAD_IMAGE_GRAYSCALE’ was not declared in this scope
cv::Mat left_image = cv::imread(left_image_path.str(), CV_LOAD_IMAGE_GRAYSCALE);
参考:https://blog.csdn.net/weixin_41560777/article/details/124138138
找到对应的kittiHelper.cpp文件,将91行与93行的CV_LOAD_IMAGE_GRAYSCALE改为cv::IMREAD_GRAYSCALE
先启动速腾雷达驱动roslaunch rslidar_sdk start.launch
,后启动a-loamroslaunch aloam_velodyne aloam_velodyne_VLP_16_c2.launch
[FATAL] [1668787250.688458461]: BREAKPOINT HIT
file = /home/aaeon/hxz/c2_aloam/src/A-LOAM/src/laserOdometry.cpp
line=240
[alaserOdometry-2] process has died [pid 8867, exit code -6, cmd /home/aaeon/hxz/c2_aloam/devel/lib/aloam_velodyne/alaserOdometry __name:=alaserOdometry __log:=/home/aaeon/.ros/log/2653080a-675a-11ed-a57f-48b02d185503/alaserOdometry-2.log].
log file: /home/aaeon/.ros/log/2653080a-675a-11ed-a57f-48b02d185503/alaserOdometry-2*.log
根据报错查看/home/aaeon/hxz/c2_aloam/src/A-LOAM/src/laserOdometry.cpp
240行左右内容,怀疑是时间戳问题
if (timeCornerPointsSharp != timeLaserCloudFullRes ||
timeCornerPointsLessSharp != timeLaserCloudFullRes ||
timeSurfPointsFlat != timeLaserCloudFullRes ||
timeSurfPointsLessFlat != timeLaserCloudFullRes)
{
printf("unsync messeage!");
ROS_BREAK();
}
先启动启动a-loamroslaunch aloam_velodyne aloam_velodyne_VLP_16_my.launch
,后启动速腾雷达驱动roslaunch rslidar_sdk start.launch
则不会报错,且会正常运行