omrirz / pyrosenv

Set an environment for easy work with ROS in python without setting things up
MIT License
7 stars 0 forks source link

Python 2.7 / Python 3 Issue with cv_bridge #2

Open kaalessi opened 4 years ago

kaalessi commented 4 years ago

@omrirz Thanks for adding cv_bridge to your package! Since your code is meant to be run with Python 3, I am running into an issue with using cv_bridge. Here is the error that I am receiving:

    frame_0 = bridge.imgmsg_to_cv2(msg, desired_encoding = "passthrough") # Save off frame as cv_image
  File "visualize_img.py", line 67, in visualizeImage
    frame_0 = bridge.imgmsg_to_cv2(msg, desired_encoding = "passthrough") # Save off frame as cv_image
  File "/opt/ros/melodic/lib/python2.7/dist-packages/cv_bridge/core.py", line 163, in imgmsg_to_cv2
    dtype, n_channels = self.encoding_to_dtype_with_channels(img_msg.encoding)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/cv_bridge/core.py", line 99, in encoding_to_dtype_with_channels
    return self.cvtype2_to_dtype_with_channels(self.encoding_to_cvtype2(encoding))
  File "/opt/ros/melodic/lib/python2.7/dist-packages/cv_bridge/core.py", line 91, in encoding_to_cvtype2
    from cv_bridge.boost.cv_bridge_boost import getCvType
ImportError: dynamic module does not define module export function (PyInit_cv_bridge_boost)

I'm unsure whether it is an issue on my end or with the package. I am pretty sure cv_bridge is just being built with python 2.7 instead of python 3 causing the issue. Let me know if you have any suggestions. Thanks again!

omrirz commented 4 years ago

Maybe this can help: Unable to use cv_bridge with ROS Kinetic and Python3