Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vision_opencv_python3: 1.13.1-1 in 'melodic/distribution.yaml' [bloom] #32505

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

k-okada
Copy link
Contributor

@k-okada k-okada commented Mar 22, 2022

Increasing version of package(s) in repository vision_opencv_python3 to 1.13.1-1:

cv_bridge_python3

* depends on python3, change package name to cv_bridge_python3
* Contributors: Kei Okada

@github-actions github-actions bot added the melodic Issue/PR is for the ROS 1 Melodic distribution label Mar 22, 2022
@k-okada
Copy link
Contributor Author

k-okada commented Mar 22, 2022

this PR release cv_bridge linked against boost/python3, which enable melodic users to use python3 code with catkin_virtualenv environment.
The generate deb installs following files

/.
/opt
/opt/ros
/opt/ros/melodic
/opt/ros/melodic/lib
/opt/ros/melodic/lib/pkgconfig
/opt/ros/melodic/lib/pkgconfig/cv_bridge_python3.pc
/opt/ros/melodic/lib/python3
/opt/ros/melodic/lib/python3/dist-packages
/opt/ros/melodic/lib/python3/dist-packages/cv_bridge
/opt/ros/melodic/lib/python3/dist-packages/cv_bridge/__init__.py
/opt/ros/melodic/lib/python3/dist-packages/cv_bridge/__pycache__
/opt/ros/melodic/lib/python3/dist-packages/cv_bridge/__pycache__/__init__.cpython-36.pyc
/opt/ros/melodic/lib/python3/dist-packages/cv_bridge/__pycache__/core.cpython-36.pyc
/opt/ros/melodic/lib/python3/dist-packages/cv_bridge/boost
/opt/ros/melodic/lib/python3/dist-packages/cv_bridge/boost/__init__.py
/opt/ros/melodic/lib/python3/dist-packages/cv_bridge/boost/cv_bridge_boost.so
/opt/ros/melodic/lib/python3/dist-packages/cv_bridge/core.py
/opt/ros/melodic/lib/python3/dist-packages/cv_bridge_python3-1.13.0.egg-info
/opt/ros/melodic/share
/opt/ros/melodic/share/cv_bridge_python3
/opt/ros/melodic/share/cv_bridge_python3/cmake
/opt/ros/melodic/share/cv_bridge_python3/cmake/cv_bridge_python3Config-version.cmake
/opt/ros/melodic/share/cv_bridge_python3/cmake/cv_bridge_python3Config.cmake
/opt/ros/melodic/share/cv_bridge_python3/package.xml
/usr
/usr/share
/usr/share/doc
/usr/share/doc/ros-melodic-cv-bridge-python3
/usr/share/doc/ros-melodic-cv-bridge-python3/changelog.Debian.gz

to use this code, we need to add following code to your python3 code.

import sys, os; sys.path.insert(0,'/opt/ros/' +  os.environ['ROS_DISTRO'] + '/lib/python3/dist-packages/')
import cv_bridge
from cv_bridge.boost.cv_bridge_boost import getCvType

see jsk-ros-pkg/jsk_recognition#2668 (comment) for working example

Copy link
Contributor

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

vision_opencv_python3:
doc:
type: git
url: https://github.com/jsk-ros-pkg/vision_opencv_python3.git
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be good to add a top level license file

@ivanpauno
Copy link
Contributor

this PR release cv_bridge linked against boost/python3,

does this cause any issue if you also have cv_bridge installed?

@k-okada
Copy link
Contributor Author

k-okada commented Mar 26, 2022

@ivanpauno thanks for comment

I haven't seen any problem by installing both cv_bridge and cv_bridge_python3

k-okada@p51s:/tmp$ sudo apt-get install ros-melodic-cv-bridge
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  ros-melodic-cv-bridge
0 upgraded, 1 newly installed, 0 to remove and 583 not upgraded.
Need to get 0 B/90.0 kB of archives.
After this operation, 352 kB of additional disk space will be used.
Selecting previously unselected package ros-melodic-cv-bridge.
(Reading database ... 692209 files and directories currently installed.)
Preparing to unpack .../ros-melodic-cv-bridge_1.13.0-0bionic.20220127.152918_amd64.deb ...
Unpacking ros-melodic-cv-bridge (1.13.0-0bionic.20220127.152918) ...
Setting up ros-melodic-cv-bridge (1.13.0-0bionic.20220127.152918) ...
k-okada@p51s:/tmp$ sudo dpkg -i ros-melodic-cv-bridge-python3_1.13.1-1bionic_amd64.deb
(Reading database ... 692231 files and directories currently installed.)
Preparing to unpack ros-melodic-cv-bridge-python3_1.13.1-1bionic_amd64.deb ...
Unpacking ros-melodic-cv-bridge-python3 (1.13.1-1bionic) over (1.13.0-1bionic) ...
Setting up ros-melodic-cv-bridge-python3 (1.13.1-1bionic) ...

@ivanpauno
Copy link
Contributor

I haven't seen any problem by installing both cv_bridge and cv_bridge_python3

I don't mean only installing, do packages using the original cv_bridge continue working correctly?

@k-okada
Copy link
Contributor Author

k-okada commented Mar 30, 2022

I don't mean only installing, do packages using the original cv_bridge continue working correctly?

Sure cv_bridge_pytho3 installs under

/opt/ros/melodic/lib/python3/dist-packages/cv_bridge

and default melodic/setup.sh only points to /opt/ros/melodic/lib/python2.7/dist-packages, so it will not conflict on default settings,

https://github.com/ros/catkin/blob/bf5d8170cd6dca5341e94d932d568a98f7a779fc/python/catkin/builder.py#L291-L303

As I wrote #32505 (comment), we need to set

import sys, os; sys.path.insert(0,'/opt/ros/' +  os.environ['ROS_DISTRO'] + '/lib/python3/dist-packages/')

to use this pacakge.

@hidmic
Copy link
Contributor

hidmic commented Mar 30, 2022

this PR release cv_bridge linked against boost/python3, which enable melodic users to use python3 code with catkin_virtualenv environment.

@k-okada hmm this is fairly unusual, particularly for an aging ROS distribution that only supports Python 2.x. @clalancette thoughts?

@clalancette
Copy link
Contributor

@k-okada hmm this is fairly unusual, particularly for an aging ROS distribution that only supports Python 2.x. @clalancette thoughts?

It is unusual, but I know that there are people using Melodic with Python 3. As long as it doesn't collide with the original vision_opencv either at build-time or at run-time, I'm fine with taking this.

@ivanpauno
Copy link
Contributor

Thanks for the answer @k-okada !
If you can address #32505 (comment) then this is ready to merge.

@k-okada
Copy link
Contributor Author

k-okada commented Mar 31, 2022

ok, done jsk-ros-pkg/vision_opencv_python3#1

@k-okada k-okada reopened this Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
melodic Issue/PR is for the ROS 1 Melodic distribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants