본문 바로가기

Linux

ImportError: dynamic module does not define module export function (PyInit_cv_bridge_boost) in Xavier AGX

stackoverflow.com/questions/49221565/unable-to-use-cv-bridge-with-ros-kinetic-and-python3

 

Unable to use cv_bridge with ROS Kinetic and Python3

I had a computer vision project on Ubuntu 14.04 with ROS indigo and python3, then I had to move on Ubuntu 16.04 with ROS kinetic. Here I ran into multiple issues: 1) I installed opencv, but couldn't

stackoverflow.com

 

# `python-catkin-tools` is needed for catkin tool

# `python3-dev` and `python3-catkin-pkg-modules` is needed to build cv_bridge

# `python3-numpy` and `python3-yaml` is cv_bridge dependencies

# `ros-melodic-cv-bridge` is needed to install a lot of cv_bridge deps. Probaply you already have it installed.

sudo apt-get install python-catkin-tools python3-dev python3-catkin-pkg-modules python3-numpy python3-yaml ros-melodic-cv-bridge

# Create catkin workspace

mkdir catkin_workspace

cd catkin_workspace

catkin init

# Instruct catkin to set cmake variables

catkin config -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/include/python3.6m -DPYTHON_LIBRARY=/usr/lib/aarch64-linux-gnu/libpython3.6m.so

# Instruct catkin to install built packages into install place. It is $CATKIN_WORKSPACE/install folder

catkin config --install

# Clone cv_bridge src

git clone https://github.com/ros-perception/vision_opencv.git src/vision_opencv

# Find version of cv_bridge in your repository

apt-cache show ros-kinetic-cv-bridge | grep Version

       Version: 1.13.0-0xenial-20180416-143935-0800

# Checkout right version in git repo. In our case it is 1.12.8

cd src/vision_opencv/

git checkout 1.13.0

cd ../../

# Build

catkin build cv_bridge

# Extend environment with new package

source install/setup.bash --extend

 

 

TEST

$ python3

Python 3.5.2 (default, Nov 23 2017, 16:37:01)

[GCC 5.4.0 20160609] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> from cv_bridge.boost.cv_bridge_boost import getCvType

>>>

 

 

After build, i used catkin_make.

For catkin_make, i deleted devel & build folder

$ rm -rf devel

$ rm -rf build

$ catkin_make

 

Check one more,

$ python3

Python 3.5.2 (default, Nov 23 2017, 16:37:01)

[GCC 5.4.0 20160609] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> from cv_bridge.boost.cv_bridge_boost import getCvType

>>>

 

'Linux' 카테고리의 다른 글

Asynchronous IO Read (Direct I/O)  (0) 2022.05.19
print Memory info function  (0) 2021.05.14
Checking the cudnn 8.x version  (0) 2021.03.29
Linux Vim Setting (.vimrc)  (0) 2020.12.14
Find python, cuda code with ctags, cscope  (0) 2020.10.19