[Python] ROS Noetic (Ubuntu 20.04) - CV Bridge Not Working

Discussão em 'Python' iniciado por Stack, Julho 9, 2025.

  1. Stack

    Stack Membro Participativo

    Ubuntu 20.04 LTS Python 3.8 ROS Noetic Desktop Full installed

    Confirmed I do have the file /lib/libgdal.so.26

    Performed pip3 install opencv-python already Performed sudo apt install --reinstall gdal-bin libgdal-dev python3-gdal already Performed sudo apt-get install ros-noetic-cv-bridge already -- Result of the above was that ros-noetic-cv-bridge is already at the newest version.

    However when my code hits the line

    from cv_bridge.boost.cv_bridge_boost import getCvType

    I get

    ImportError: /lib/libgdal.so.26: undefined symbol: sqlite3_column_table_name and am at a loss at how to deal with this

    NOTE : I followed the instructions at Unable to use cv_bridge with ROS Kinetic and Python3

    I tried replacing "kinetic" with "noetic" and replaced the version number with mine (1.15.0).

    Doing catkin build cv_bridge as instructed ther went through but gave me a few strange outputs.

    Warnings << cv_bridge:make /home/tdadmin/catkin_workspace/logs/cv_bridge/build.make.000.log
    cc1plus: warning: /home/tdadmin/.local/bin/python3.6m: not a directory cc1plus: warning: /home/tdadmin/.local/bin/python3.6m: not a directory cc1plus: warning: /home/tdadmin/.local/bin/python3.6m: not a directory cc1plus: warning: /home/tdadmin/.local/bin/python3.6m: not a directory cd /home/tdadmin/catkin_workspace/build/cv_bridge; catkin build --get-env cv_bridge | catkin env -si /usr/bin/make --jobserver-auth=3,4; cd -

    I'mnot sure why its looking at python3.6m for anything. I set the executable line as stated for 3.8.

    E: Below is the ~/catkin_workspace/src/vision_opencv/cv_bridge/CMakeLists.txt content.

    cmake_minimum_required(VERSION 3.0.2)
    project(cv_bridge)

    find_package(catkin REQUIRED COMPONENTS rosconsole sensor_msgs)

    if(NOT ANDROID)
    find_package(PythonLibs)

    if(PYTHONLIBS_VERSION_STRING VERSION_LESS "3.8")
    # Debian Buster
    find_package(Boost REQUIRED python37)
    else()
    # Ubuntu Focal
    find_package(Boost REQUIRED python)
    endif()
    else()
    find_package(Boost REQUIRED)
    endif()

    set(_opencv_version 4)
    find_package(OpenCV 4 QUIET)
    if(NOT OpenCV_FOUND)
    message(STATUS "Did not find OpenCV 4, trying OpenCV 3")
    set(_opencv_version 3)
    endif()

    find_package(OpenCV ${_opencv_version4} REQUIRED
    COMPONENTS
    opencv_core
    opencv_imgproc
    opencv_imgcodecs
    CONFIG
    )

    catkin_package(
    INCLUDE_DIRS include
    LIBRARIES ${PROJECT_NAME}
    CATKIN_DEPENDS rosconsole sensor_msgs
    DEPENDS OpenCV
    CFG_EXTRAS cv_bridge-extras.cmake
    )
    catkin_python_setup()

    include_directories(include ${Boost_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
    link_directories(${Boost_LIBRARY_DIRS})

    if(NOT ANDROID)
    add_subdirectory(python)
    endif()
    add_subdirectory(src)
    if(CATKIN_ENABLE_TESTING)
    add_subdirectory(test)
    endif()

    # install the include folder
    install(
    DIRECTORY include/${PROJECT_NAME}/
    DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
    )





    That said there are plenty of other CMakeLists.txt in this very directory, including

    ./src/vision_opencv/cv_bridge/python, ./src/vision_opencv/cv_bridge/test, ./src/vision_opencv/cv_bridge/, ./src/vision_opencv/cv_bridge/src

    E2 : These are the results from catkin build cv_bridge

    catkin build cv_bridge
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Profile: default
    Extending: [cached] /opt/ros/noetic
    Workspace: /home/tdadmin/catkin_workspace
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Build Space: [exists] /home/tdadmin/catkin_workspace/build
    Devel Space: [exists] /home/tdadmin/catkin_workspace/devel
    Install Space: [exists] /home/tdadmin/catkin_workspace/install
    Log Space: [exists] /home/tdadmin/catkin_workspace/logs
    Source Space: [exists] /home/tdadmin/catkin_workspace/src
    DESTDIR: [unused] None
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Devel Space Layout: linked
    Install Space Layout: merged
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Additional CMake Args: -DPYTHON_EXECUTABLE=/usr/bin/python3.8 -DPYTHON_INCLUDE_DIR=/usr/include/python3.8 -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.8.so
    Additional Make Args: None
    Additional catkin Make Args: None
    Internal Make Job Server: True
    Cache Job Environments: False
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Whitelisted Packages: None
    Blacklisted Packages: None
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Workspace configuration appears valid.
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    [build] Found '4' packages in 0.0 seconds.
    Starting >>> cv_bridge
    Finished <<< cv_bridge [ 0.9 seconds ]
    [build] Summary: All 1 packages succeeded!
    [build] Ignored: 3 packages were skipped or are blacklisted.
    [build] Warnings: None.
    [build] Abandoned: None.
    [build] Failed: None.
    [build] Runtime: 0.9 seconds total.

    Continue reading...

Compartilhe esta Página