"Visual SLAM Fourteen Lectures" Error Information and Solutions

ch4-SophusCompilation error

  • Error message:
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
  • Solution: Modify the so2.cpp file under Sophus
    • Modify the following:

      unit_complex_.real() = 1.;
      unit_complex_.imag() = 0.;
      
    • change into:

      unit_complex_.real(1.);
      unit_complex_.imag(0.);
      

ch5/imageBasicsError when installing opencv4.x

  • Environment: Unbuntu22.04, install opencv4.x
  • Error message:
libgtk2.0-dev : 依赖: libgdk-pixbuf-2.0-dev (>= 2.21.0) 但无法安装它 或 libgdk-pixbuf2.0-dev (>= 2.21.0) 但无法安装它

ch5/joinMap/CMakeLists.txtCompilation error

  • Error message:
error: #error PCL requires C++14 or above
  • My solution: comment out settings about c++11 features
# set( CMAKE_CXX_FLAGS "-std=c++11 -O3")

ch5/joinMap-pcl_viewer map.pcd报错

  • Environment: Ubuntu22.04 virtual machine on Mac

  • Error message: Executed after generating map.pcd mappcl_viewer map.pcdError message:

    $ 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
    段错误 (核心已转储)
    
  • Core error message: vtkShaderProgram (0x563c2b246170): 0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES

  • Possible solution: When running OpenGL programs in an Ubuntu virtual machine, you may encounter some limitations because the virtual machine may not have direct access to the host system's graphics hardware. This may result in OpenGL implementations not supporting higher versions of GLSL. To resolve this issue, you can try the following:

    • Enable 3D acceleration: Make sure your virtual machine software (such as VirtualBox, VMware, etc.) has enabled 3D acceleration. This can usually be found in the Display or Graphics section of the virtual machine settings. When 3D acceleration is enabled, the virtual machine will attempt to use the host system's graphics card to provide better OpenGL support.
    • Install virtual machine tools: Make sure you have installed the enhanced tools provided by the virtual machine software (such as VirtualBox Guest Additions, VMware Tools, etc.). These tools usually include graphics drivers optimized for virtual machines, which can improve OpenGL performance and compatibility.

    • Use software rendering (I solved it through this): If you cannot enable 3D acceleration or install virtual machine tools, you can try to use software rendering. This will use the CPU instead of the GPU to render OpenGL graphics, which may have poorer performance but provides wider GLSL support. In Ubuntu, you can install Mesa's software renderer, such as llvmpipe. To install llvmpipe, run the following command:

      sudo apt-get install libgl1-mesa-swx11
      
    • After installation is complete, you can force software rendering by setting the LIBGL_ALWAYS_SOFTWARE=1 environment variable:

      export LIBGL_ALWAYS_SOFTWARE=1 
      

Guess you like

Origin blog.csdn.net/xijuezhu8128/article/details/132035330