skip to Main Content

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.   

2

Answers


  1. I believe this is an issue with mixing paths and sourcing working directories. Right now you have two copies of the cv_bridge, one in your local workspace and one in /opt. If everything is installed correctly via apt you can open a new terminal and only source the installed packages: source /opt/ros/noetic/setup.bash then with the python command line just try from cv_bridge.boost.cv_bridge_boost import getCvType and it should work. If it doesn’t you should uninstall and reinstall via sudo apt remove ros-noetic-cv-bridge. If that works, you should remove the local copy in your workspace.

    Login or Signup to reply.
  2. Worked from using plain noetic image rather using desktop full.

    FROM ros:noetic
    
    RUN apt-get update 
        && apt-get install -q -y openssh-client 
        && apt-get install -q -y python3-pip 
        && apt-get install -q -y ros-noetic-cv-bridge 
        && apt-get install -q -y python3-opencv
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search