今天跑代码的时候发现之前能跑得代码忽然不能跑了。
github:https://github.com/daobilige-su/loam_velodyne
报错:
/home/syq/catkin_ws/src/loam_velodyne-master2/src/laserOdometry.cpp:838:41: error: ‘isnan’ was not declared in this scope
if (isnan(matX.at<float>(0, 0)) || isnan(matX.at<float>(1, 0)) || isnan(matX.at<float>(2, 0)) || isnan(matX.at<float>(3, 0)) || isnan(matX.at<float>(4, 0)) || isnan(matX.at<float>(5, 0)))
^
loam_velodyne-master2/CMakeFiles/laserOdometry.dir/build.make:62: recipe for target 'loam_velodyne-master2/CMakeFiles/laserOdometry.dir/src/laserOdometry.cpp.o' failed
make[2]: *** [loam_velodyne-master2/CMakeFiles/laserOdometry.dir/src/laserOdometry.cpp.o] Error 1
CMakeFiles/Makefile2:835: recipe for target 'loam_velodyne-master2/CMakeFiles/laserOdometry.dir/all' failed
make[1]: *** [loam_velodyne-master2/CMakeFiles/laserOdometry.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j6 -l6" failed
才发现是isnan的错误,开始的时候搜索问题只看
make[1]: *** [loam_velodyne-master2/CMakeFiles/laserOdometry.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j6 -l6" failed
一直没有搜到有效的解决方法,所以看报错要看全啊
修改方法:isnan编成std::isnan