ch4-Sophus編譯報(bào)錯(cuò)
- 報(bào)錯(cuò)信息:
error: lvalue required as left operand of assignment
unit_complex_.real() = 1.;
^~
error: lvalue required as left operand of assignment
unit_complex_.imag() = 0.;
^~
CMakeFiles/Sophus.dir/build.make:65: recipe for target 'CMakeFiles/Sophus.dir/sophus/so2.cpp.o' failed
- 解決方法:修改Sophus下的so2.cpp文件
-
將下面這個(gè)修改一下:
unit_complex_.real() = 1.; unit_complex_.imag() = 0.;
-
修改為:
unit_complex_.real(1.); unit_complex_.imag(0.);
-
ch5/imageBasics安裝opencv4.x報(bào)錯(cuò)
- 環(huán)境:Unbuntu22.04,安裝opencv4.x
- 報(bào)錯(cuò)信息:
libgtk2.0-dev : 依賴: libgdk-pixbuf-2.0-dev (>= 2.21.0) 但無(wú)法安裝它 或 libgdk-pixbuf2.0-dev (>= 2.21.0) 但無(wú)法安裝它
- 解決方案:參照https://blog.csdn.net/qq_51022848/article/details/128095476
ch5/joinMap/CMakeLists.txt編譯報(bào)錯(cuò)
- 報(bào)錯(cuò)信息:
error: #error PCL requires C++14 or above
- 我的解決方案:注釋掉關(guān)于 c++11特性的設(shè)置
# set( CMAKE_CXX_FLAGS "-std=c++11 -O3")
ch5/joinMap-pcl_viewer map.pcd報(bào)錯(cuò)
-
環(huán)境:Mac中的Ubuntu22.04虛擬機(jī)
-
報(bào)錯(cuò)信息:在生成map.pcd地圖之后執(zhí)行
pcl_viewer map.pcd
報(bào)錯(cuò):$ ch5/joinMap$ pcl_viewer map.pcd 2023-07-31 21:33:35.519 ( 0.006s) [ C7314880] vtkContextDevice2D.cxx:32 WARN| Error: no override found for 'vtkContextDevice2D'. The viewer window provides interactive commands; for help, press 'h' or 'H' from within the window. > Loading map.pcd 2023-07-31 21:33:35.647 ( 0.134s) [ C7314880]vtkOpenGLRenderWindow.c:499 ERR| vtkXOpenGLRenderWindow (0x563c2ae6cf10): Unable to find a valid OpenGL 3.2 or later implementation. Please update your video card driver to the latest version. If you are using Mesa please make sure you have version 11.2 or later and make sure your driver in Mesa supports OpenGL 3.2 such as llvmpipe or openswr. If you are on windows and using Microsoft remote desktop note that it only supports OpenGL 3.2 with nvidia quadro cards. You can use other remoting software such as nomachine to avoid this issue. 2023-07-31 21:33:35.647 ( 0.134s) [ C7314880] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined. 2023-07-31 21:33:35.647 ( 0.134s) [ C7314880] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined. 2023-07-31 21:33:35.648 ( 0.134s) [ C7314880] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined. 2023-07-31 21:33:35.648 ( 0.135s) [ C7314880] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined. 2023-07-31 21:33:35.648 ( 0.135s) [ C7314880] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined. 2023-07-31 21:33:35.648 ( 0.135s) [ C7314880] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined. 2023-07-31 21:33:35.648 ( 0.135s) [ C7314880] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined. [PCLVisualizer::setUseVbos] Has no effect when OpenGL version is ≥ 2 2023-07-31 21:33:35.655 ( 0.141s) [ C7314880] vtkTextureObject.cxx:1463 ERR| vtkTextureObject (0x563c2b3b8c90): Failed to determine texture parameters. IF=0 F=6408 T=5121 2023-07-31 21:33:35.655 ( 0.141s) [ C7314880] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined. 2023-07-31 21:33:35.655 ( 0.142s) [ C7314880] vtkOpenGLState.cxx:1795 WARN| Hardware does not support the number of textures defined. 2023-07-31 21:33:35.665 ( 0.152s) [ C7314880] vtkShaderProgram.cxx:437 ERR| vtkShaderProgram (0x563c2b250fb0): 1: #version 150 2: #ifndef GL_ES 3: #define highp 4: #define mediump 5: #define lowp 6: #endif // GL_ES 7: #define attribute in 8: #define varying out 9: 10: 11: /*========================================================================= 12: 13: Program: Visualization Toolkit 14: Module: vtkPolyData2DVS.glsl 15: 16: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 17: All rights reserved. 18: See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 19: 20: This software is distributed WITHOUT ANY WARRANTY; without even 21: the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 22: PURPOSE. See the above copyright notice for more information. 23: 24: =========================================================================*/ 25: 26: // all variables that represent positions or directions have a suffix 27: // indicating the coordinate system they are in. The possible values are 28: // MC - Model Coordinates 29: // WC - WC world coordinates 30: // VC - View Coordinates 31: // DC - Display Coordinates 32: 33: in vec4 vertexWC; 34: 35: // material property values 36: //VTK::Color::Dec 37: 38: // Texture coordinates 39: in vec2 tcoordMC; out vec2 tcoordVCVSOutput; 40: 41: // Apple Bug 42: //VTK::PrimID::Dec 43: 44: uniform mat4 WCVCMatrix; // World to view matrix 45: 46: void main() 47: { 48: // Apple Bug 49: //VTK::PrimID::Impl 50: 51: gl_Position = WCVCMatrix*vertexWC; 52: tcoordVCVSOutput = tcoordMC; 53: //VTK::Color::Impl 54: } 2023-07-31 21:33:35.665 ( 0.152s) [ C7314880] vtkShaderProgram.cxx:438 ERR| vtkShaderProgram (0x563c2b250fb0): 0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES 2023-07-31 21:33:35.665 ( 0.152s) [ C7314880] vtkShaderProgram.cxx:437 ERR| vtkShaderProgram (0x563c2b246170): 1: #version 150 2: #ifndef GL_ES 3: #define highp 4: #define mediump 5: #define lowp 6: #endif // GL_ES 7: #define attribute in 8: #define varying out 9: 10: in vec4 ndCoordIn; 11: in vec2 texCoordIn; 12: out vec2 texCoord; 13: void main() 14: { 15: gl_Position = ndCoordIn; 16: texCoord = texCoordIn; 17: } 2023-07-31 21:33:35.665 ( 0.152s) [ C7314880] vtkShaderProgram.cxx:438 ERR| vtkShaderProgram (0x563c2b246170): 0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES 2023-07-31 21:33:35.665 ( 0.152s) [ C7314880]vtkOpenGLVertexArrayObj:265 ERR| vtkOpenGLVertexArrayObject (0x563c2b7bf8b0): attempt to add attribute without a program for attribute ndCoordIn 2023-07-31 21:33:35.665 ( 0.152s) [ C7314880]vtkOpenGLQuadHelper.cxx:62 WARN| Error binding ndCoords to VAO. 2023-07-31 21:33:35.665 ( 0.152s) [ C7314880]vtkOpenGLRenderWindow.c:932 ERR| vtkXOpenGLRenderWindow (0x563c2ae6cf10): Couldn't build the shader program for depth blits 段錯(cuò)誤 (核心已轉(zhuǎn)儲(chǔ))
-
核心報(bào)錯(cuò)信息:vtkShaderProgram (0x563c2b246170): 0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES
-
可能的解決方案:在Ubuntu虛擬機(jī)中運(yùn)行OpenGL程序時(shí),可能會(huì)遇到一些限制,因?yàn)樘摂M機(jī)可能無(wú)法直接訪問(wèn)主機(jī)系統(tǒng)的顯卡硬件。這可能導(dǎo)致OpenGL實(shí)現(xiàn)不支持較高版本的GLSL。要解決這個(gè)問(wèn)題,您可以嘗試以下方法:
- 啟用3D加速:確保您的虛擬機(jī)軟件(如VirtualBox、VMware等)已啟用3D加速。這通常可以在虛擬機(jī)設(shè)置的顯示或圖形部分找到。啟用3D加速后,虛擬機(jī)將嘗試使用主機(jī)系統(tǒng)的顯卡來(lái)提供更好的OpenGL支持。
-
安裝虛擬機(jī)工具:確保您已安裝了虛擬機(jī)軟件提供的增強(qiáng)工具(如VirtualBox Guest Additions、VMware Tools等)。這些工具通常包含了針對(duì)虛擬機(jī)優(yōu)化的圖形驅(qū)動(dòng)程序,可以提高OpenGL性能和兼容性。
-
使用軟件渲染(我是通過(guò)這個(gè)解決的):如果您無(wú)法啟用3D加速或安裝虛擬機(jī)工具,您可以嘗試使用軟件渲染。這將使用CPU而不是GPU來(lái)渲染OpenGL圖形,性能可能較差,但可以提供更廣泛的GLSL支持。在Ubuntu中,您可以安裝Mesa的軟件渲染器,例如llvmpipe。要安裝llvmpipe,請(qǐng)運(yùn)行以下命令:文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-621762.html
sudo apt-get install libgl1-mesa-swx11
-
安裝完成后,您可以通過(guò)設(shè)置
LIBGL_ALWAYS_SOFTWARE=1
環(huán)境變量來(lái)強(qiáng)制使用軟件渲染:文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-621762.htmlexport LIBGL_ALWAYS_SOFTWARE=1
到了這里,關(guān)于《視覺SLAM十四講》報(bào)錯(cuò)信息和解決方案的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!