问题一、
glfw error 65544: X11: RandR gamma ramp support seems broken
error : failed to compile shader /home/ros_proj/catkin_ws/src/interactive_slam/data/shader/rainbow.vert
0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES
error : failed to compile shader /home/ros_proj/catkin_ws/src/interactive_slam/data/shader/rainbow.frag
0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES
error : failed to link program
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader
# Using CHOLMOD poseDim -1 landMarkDim -1 blockordering 1
error : failed to compile shader /home/ros_proj/catkin_ws/src/interactive_slam/data/shader/rainbow.vert
0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES
error : failed to compile shader /home/ros_proj/catkin_ws/src/interactive_slam/data/shader/rainbow.frag
0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.40, 1.00 ES, and 3.00 ES
error : failed to link program
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader
解决:上述绿色报错部分解决方案如下:
1 I fixed this , I change some code in /src/imgui_application.cpp : 2 // glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); 3 // glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); 4 glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); 5 glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); 6 glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
经过实践,第六行注释掉也可以;修改之后,可以正常运行了,但是加载点云之后,帧率很低,集成显卡没工作。
参考:(项目issue)https://github.com/SMRT-AIST/interactive_slam/issues/15https://github.com/SMRT-AIST/interactive_slam/issues/15
Note:上面红色部分错误,依据调查,原因是glfw3.2以及老版本才有这个潜在问题,3.3以后就没了,但是你看上面代码,已经改为3.3;我查看了下设置->详细信息->图像->llvmpipe (LLVM 10.0.0, 256 bits),显然intel 11代cpu Xe显卡驱动没有正常安装,后续依据调查,intel对ubuntu驱动支持到17.04就没更新了,为此,我需要升级linux内核,或者使用ubuntu20.04以上版本,参考下图,我现在内核版本是5.2,具体怎么操作,强烈建议看看:https://zhuanlan.zhihu.com/p/133323571
参考:https://askubuntu.com/questions/1319758/ubuntu-18-04-with-intel-iris-xe
问题二、有关项目的环境额外配置
1、 建议使用clang编译器
如何在clion中设置clang编译器?
To provide CMake compiler paths, go to Settings | Build, Execution, Deployment | CMake and pass as CMake options:-D CMAKE_C_COMPILER= -D CMAKE_CXX_COMPILER= In case CMake fails to find some path to clang libs, etc. you can also set there environment variables:CC=/usr/bin/clang CXX=/usr/bin/clang++
在clion -> 设置 -> 工具链中,点击加号,新建工具链, 命名为clang,
其中c编译器:/usr/bin/clang-6.0
C++编译器:/usr/bin/clang++-6.0
然后返回clion中设置CMake,切换到刚刚创建的工具链,即:clang
(设置clang为默认编译器,下次打开其他项目记得切换gcc or g++为默认编译器)
2、安装gtsam
常规编译安装就OK,的修改CMakeLists,关闭TBB功能,参考:问题12。
问题3:编译报错:fatal error: self_msgs/wheel_speed.h: 没有那个文件或目录
没有build/devel/include/self_msgs目录下面的头,缺少四个头文件,咱们直接去之前vscode目录下生成的
头文件,直接拷贝到clion工程中。
问题4:Errors << lidar_align:make /home/vinz/catkin_ws/logs/lidar_align/build.make.001.log In file included from /usr/include/flann/util/serialization.h:9:0, from /usr/include/flann/util/matrix.h:35, from /usr/include/flann/flann.hpp:41, from /usr/include/pcl-1.8/pcl/kdtree/flann.h:50, from /usr/include/pcl-1.8/pcl/kdtree/kdtree_flann.h:45, from /home/vinz/catkin_ws/src/lidar_align/include/lidar_align/sensors.h:8, from /home/vinz/catkin_ws/src/lidar_align/include/lidar_align/loader.h:7, from /home/vinz/catkin_ws/src/lidar_align/src/loader.cpp:5: /usr/include/flann/ext/lz4.h:196:57: error: conflicting declaration ‘typedef struct LZ4_stream_t LZ4_stream_t’ typedef struct { long long table[LZ4_STREAMSIZE_U64]; } LZ4_stream_t; ^~~~~~~~~~~~ In file included from /opt/ros/melodic/include/roslz4/lz4s.h:38:0, from /opt/ros/melodic/include/rosbag/stream.h:46, from /opt/ros/melodic/include/rosbag/chunked_file.h:46, from /opt/ros/melodic/include/rosbag/bag.h:41, from /home/vinz/catkin_ws/src/lidar_align/src/loader.cpp:2: /usr/include/lz4.h:196:57: note: previous declaration as ‘typedef struct LZ4_stream_t LZ4_stream_t’ typedef struct { long long table[LZ4_STREAMSIZE_U64]; } LZ4_stream_t; ^~~~~~~~~~~~ In file included from /usr/include/flann/util/serialization.h:9:0, from /usr/include/flann/util/matrix.h:35, from /usr/include/flann/flann.hpp:41, from /usr/include/pcl-1.8/pcl/kdtree/flann.h:50, from /usr/include/pcl-1.8/pcl/kdtree/kdtree_flann.h:45, from /home/vinz/catkin_ws/src/lidar_align/include/lidar_align/sensors.h:8, from /home/vinz/catkin_ws/src/lidar_align/include/lidar_align/loader.h:7, from /home/vinz/catkin_ws/src/lidar_align/src/loader.cpp:5: /usr/include/flann/ext/lz4.h:249:72: error: conflicting declaration ‘typedef struct LZ4_streamDecode_t LZ4_streamDecode_t’ typedef struct { unsigned long long table[LZ4_STREAMDECODESIZE_U64]; } LZ4_streamDecode_t; ^~~~~~~~~~~~~~~~~~ In file included from /opt/ros/melodic/include/roslz4/lz4s.h:38:0, from /opt/ros/melodic/include/rosbag/stream.h:46, from /opt/ros/melodic/include/rosbag/chunked_file.h:46, from /opt/ros/melodic/include/rosbag/bag.h:41, from /home/vinz/catkin_ws/src/lidar_align/src/loader.cpp:2: /usr/include/lz4.h:249:72: note: previous declaration as ‘typedef struct LZ4_streamDecode_t LZ4_streamDecode_t’ typedef struct { unsigned long long table[LZ4_STREAMDECODESIZE_U64]; } LZ4_streamDecode_t; ^~~~~~~~~~~~~~~~~~ make[2]: *** [CMakeFiles/lidar_align.dir/src/loader.cpp.o] Error 1 make[1]: *** [CMakeFiles/lidar_align.dir/all] Error 2 make: *** [all] Error 2 cd /home/vinz/catkin_ws/build/lidar_align; catkin build --get-env lidar_align | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd
这个错误,咱们还没实践过,不过也要记录下,解决方案:
System: Ubuntu 18.04 ROS: melodic Reason: /usr/include/lz4.h conflict with /usr/include/flann/ext/lz4.hI thing this will be fixed in next release version of system or ROS. But you could try these commands to fix this problem.sudo mv /usr/include/flann/ext/lz4.h /usr/include/flann/ext/lz4.h.bak sudo mv /usr/include/flann/ext/lz4hc.h /usr/include/flann/ext/lz4.h.baksudo ln -s /usr/include/lz4.h /usr/include/flann/ext/lz4.h sudo ln -s /usr/include/lz4hc.h /usr/include/flann/ext/lz4hc.h
参考:https://github.com/ethz-asl/lidar_align/issues/16
问题5:编译inGui时,/usr/bin/ld: 找不到 -lglfw3
网上解答总结为:/usr/bin/ld: 找不到 -l****,大概思路就是先找到 ****.so,然后手动 ln 指令去链接,我这里搜索不到glfw3.so。
imgui官方解决:https://github.com/ocornut/imgui/issues/1032
我的解决:先查找已经安装的glfw3版本,如下,是:3.2.1-1
sudo apt-get install libglfw3-dev 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 libglfw3-dev 已经是最新版 (3.2.1-1)。 升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 3 个软件包未被升级。
去官网:https://github.com/glfw/glfw/tree/3.2.1
点击tag选版本,下载之后:
mkdir build cmake .. make sudo make install
解决!
问题六:
/usr/include/flann/ext/lz4.h:196:57: error: conflicting declaration ‘typedef struct LZ4_stream_t LZ4_stream_t’
typedef struct { long long table[LZ4_STREAMSIZE_U64]; } LZ4_stream_t;
sudo mv /usr/include/flann/ext/lz4.h /usr/include/flann/ext/lz4.h.bak sudo mv /usr/include/flann/ext/lz4hc.h /usr/include/flann/ext/lz4.h.baksudo ln -s /usr/include/lz4.h /usr/include/flann/ext/lz4.h sudo ln -s /usr/include/lz4hc.h /usr/include/flann/ext/lz4hc.h
问题七:fatal error: self_msgs/wheel_speed.h: 没有那个文件或目录#include <self_msgs/wheel_speed.h>
cmake生成的文件夹self_msgs,手动拷贝到slamtool_3d-master/include
问题八:
有时候make编译出错;需要重新cmake后,然后再make,错误居然消失了。
问题九:IDE设置、编译器设置
9.0 首先在一个解锁的路径copy项目源码
9.1、所有命令都不要sudo su,记得source后启动ide
9.3、
问题10:
error: failed to open ./data/shader/rainbow.vert
error: failed to open ./data/shader/rainbow.frag
error : failed to link program
解决:clion中设置为:编辑配置 - 工作目录:/home/temp/slamtool_3d-master
问题11:
对于G2O冲突问题,卸载ROS自带版本G2O
sudo apt-get purge ros-melodic-libg2o
问题12:
/usr/local/include/gtsam/linear/VectorValues.h:200:22: error: no member named 'emplace' in 'gtsam::ConcurrentMap<unsigned long, Eigen::Matrix<double, -1, 1, 0, -1, 1> >'
return values_.emplace(j, value);
解决:注意,此时此刻,我用的是clang编译器;我们重新编译安装gtsam库,将gtsam源码目录下的CMakeLists作如下修改(关闭TBB加速,将ON改为OFF):
#option(GTSAM_WITH_TBB "Use Intel Threaded Building Blocks (TBB) if available" ON) option(GTSAM_WITH_TBB "Use Intel Threaded Building Blocks (TBB) if available" OFF)
然后重新 cmake..,sudo make install安装库就行了。
reference:https://zhuanlan.zhihu.com/p/85413855
问题13:运行时闪退,打印:double free or corruption (out)