Skip to content
This repository was archived by the owner on Jan 11, 2019. It is now read-only.

vision_opencv: 2.0.2-1 in 'bouncy/distribution.yaml' [bloom]#227

Closed
gaoethan wants to merge 1 commit intoros2:ros2from
gaoethan:bloom-vision_opencv-4
Closed

vision_opencv: 2.0.2-1 in 'bouncy/distribution.yaml' [bloom]#227
gaoethan wants to merge 1 commit intoros2:ros2from
gaoethan:bloom-vision_opencv-4

Conversation

@gaoethan
Copy link
Copy Markdown

Increasing version of package(s) in repository vision_opencv to 2.0.2-1:

cv_bridge

* fix rosdep keys issue of opencv3

image_geometry

  • No changes

opencv_tests

  • No changes

vision_opencv

  • No changes

@mikaelarguedas
Copy link
Copy Markdown
Member

@gaoethan Unfortunately this still doesn't compile on Ubuntu Bionic.
The rosdep keys should be updated to point to the python3 version of the packages.

@mikaelarguedas
Copy link
Copy Markdown
Member

How I tested it:

$ docker run -it -rm ubuntu:bionic
apt update && apt upgrade -y && apt install -y dirmngr lsb-release gnupg2
apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
echo "deb [arch=amd64,arm64] http://repo.ros2.org/ubuntu/testing `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list
apt update
apt install -y git python3-rosdep python3-colcon-common-extensions
mkdir -p ~/vision_opencv_ws/src && cd ~/vision_opencv_ws/src
git clone -b ros2 https://github.com/ros-perception/vision_opencv.git
cd ..
export ROSDISTRO_INDEX_URL='https://raw.githubusercontent.com/ros2/rosdistro/ros2/index.yaml'
rosdep init && rosdep update
rosdep install --from-paths src --ignore-src --rosdistro bouncy -y
source /opt/ros/bouncy/setup.bash 
colcon build

@gaoethan
Copy link
Copy Markdown
Author

gaoethan commented Jul 2, 2018

@mikaelarguedas thanks. I'm trying to fix it, but now I'm blocked by installing the apt-key even though I've already changed the other key servers, maybe this results from docker network configuration, stay tuned !

@gaoethan
Copy link
Copy Markdown
Author

gaoethan commented Jul 2, 2018

@mikaelarguedas I found the failure resulted from the missing of python3_numpy, but it doesn't work to directly add it as dependency in package.xml, because there is no rule definition in rosdep keys in python.yaml of ros2, however, it has definition to python_numpy which used to python 2.x. as follows:

python-numpy:
  arch: [python2-numpy]
  debian: [python-numpy]
  fedora: [numpy]
  freebsd: [py27-numpy]
  gentoo: [dev-python/numpy]
  macports: [py27-numpy]
  opensuse: [python-numpy]
  osx:
    pip:
      packages: [numpy]
  rhel: [numpy]
  slackware: [numpy]
  ubuntu:
    artful: [python-numpy]
    bionic: [python-numpy]
    lucid: [python-numpy]
    maverick: [python-numpy]
    natty: [python-numpy]
    oneiric: [python-numpy]
    precise: [python-numpy]
    quantal: [python-numpy]
    raring: [python-numpy]
    saucy: [python-numpy]
    trusty: [python-numpy]
    trusty_python3: [python3-numpy]
    utopic: [python-numpy]
    vivid: [python-numpy]
    wily: [python-numpy]
    xenial: [python-numpy]
    yakkety: [python-numpy]
    zesty: [python-numpy]

After I manually install via apt install -y python3_numpy, it works.

@gaoethan
Copy link
Copy Markdown
Author

gaoethan commented Jul 2, 2018

After I fixed the all the build warning, there is another different than 16.04 is that the boost python3 header checking, everything works normally in 16.04, and it can find the boost python3 library normally in 18.04, but that header checking fails, wired, let me further check.

@gaoethan
Copy link
Copy Markdown
Author

gaoethan commented Jul 3, 2018

@mikaelarguedas In ubuntu Bionic(18.04), everything can work except for the following warning:

CMake Warning at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1627 (message):
  No header defined for python3; skipping header check
Call Stack (most recent call first):
  CMakeLists.txt:20 (find_package)

That is checking boost python3 header which actually is the same as the boost python 2.x. however, in /usr/share/cmake-3.10/Modules/FindBoost.cmake:1627, it has explicit definition to python 2.x(_Boost_PYTHON_HEADERS) in its function(_Boost_COMPONENT_HEADERS component _hdrs), as follows:

  set(_Boost_PRG_EXEC_MONITOR_HEADERS    "boost/test/prg_exec_monitor.hpp")
  set(_Boost_PROGRAM_OPTIONS_HEADERS     "boost/program_options.hpp")
  set(_Boost_PYTHON_HEADERS              "boost/python.hpp")

that's why python2.x can work in Ubuntu Boinic, and there is no such kind of checking in Ubuntu 16.04 FindBoost.cmake. so it's the difference between different Ubuntu flavors. I can workaround it by adding the code set(_Boost_PYTHON3_HEADERS "${_Boost_PYTHON_HEADERS}") in FindBoost.cmake for Ubuntu 18.04 and it's validated that it's effective, but it means extra modification in Ubuntu 18.04 to use the vision_opencv component. so I'd like to check your feedback for this case, thanks !

@mikaelarguedas
Copy link
Copy Markdown
Member

the failure resulted from the missing of python3-numpy, but it doesn't work to directly add it as dependency in package.xml, because there is no rule definition in rosdep keys in python.yaml of ros2

Can you please make a pull request to add the python3-rosdep key to the rosdep database (contribution guildelines available here)?

@gaoethan
Copy link
Copy Markdown
Author

gaoethan commented Jul 6, 2018

@mikaelarguedas I tried to add the python3 rosdep key for python3_numpy and now there is a commit in my fork, Based this commit, I ran rosdep update and rosdep resolve python-numpy --os=ubuntu:xenial_python3, it outputs python3-numpy, it proves that it works.

however, you can see the --os=ubuntu:xenial_python3, how does the rosdep reflect the xenial_python3 to package.xml, I tried, it doesn't work in package.xml with dependency as python-numpy for selecting python3-numpy. because I saw there is other package to add python3 support in this way in the python.yaml, so I suppose its the standard way, or I have create another one named python3-numpy but not underneath the python-numpy to add its python3 support. thanks !

@mikaelarguedas
Copy link
Copy Markdown
Member

I tried to add the python3 rosdep key for python3_numpy and now there is a commit in my fork,

That commit is modifying the python-numpy key to add a bionic_python3 rule.
What I was referring to is adding a new key named python3-numpy, I opened ros#18380 as an example.

The platforms <DISTRO_NAME>_python3 are used for people wanting to be able to use Python3 on distribution that traditionally use Python2 as the default. This is appropriate for ROS 1. In the case of ROS 2, there is no plan on supporting Python2 so we prefer keys that resolve only to the Python3 version of the packages

@gaoethan
Copy link
Copy Markdown
Author

gaoethan commented Jul 7, 2018

Good. thanks for clarification !

@gaoethan
Copy link
Copy Markdown
Author

@mikaelarguedas In ubuntu Bionic(18.04), everything can work except for the following warning:

CMake Warning at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1627 (message):
No header defined for python3; skipping header check
Call Stack (most recent call first):
CMakeLists.txt:20 (find_package)
That is checking boost python3 header which actually is the same as the boost python 2.x. however, in /usr/share/cmake-3.10/Modules/FindBoost.cmake:1627, it has explicit definition to python 2.x(_Boost_PYTHON_HEADERS) in its function(_Boost_COMPONENT_HEADERS component _hdrs), as follows:

set(_Boost_PRG_EXEC_MONITOR_HEADERS "boost/test/prg_exec_monitor.hpp")
set(_Boost_PROGRAM_OPTIONS_HEADERS "boost/program_options.hpp")
set(_Boost_PYTHON_HEADERS "boost/python.hpp")
that's why python2.x can work in Ubuntu Boinic, and there is no such kind of checking in Ubuntu 16.04 FindBoost.cmake. so it's the difference between different Ubuntu flavors. I can workaround it by adding the code set(_Boost_PYTHON3_HEADERS "${_Boost_PYTHON_HEADERS}") in FindBoost.cmake for Ubuntu 18.04 and it's validated that it's effective, but it means extra modification in Ubuntu 18.04 to use the vision_opencv component. so I'd like to check your feedback for this case, thanks !

@mikaelarguedas Do you have any comments to the above issue ? now everything works in ubuntu 18.04 except for this system-variant issue. actually, it only outputs a warning with cmake message(WARNING ...) , but colcon doesn't allow any warning in the process of building, so it fails with that warning.

On the other hand, I have another solution that is to replace boost python with pybind11 which aligns to C++11 and later which used in ros2 as well. but it requires code change with pybind11 programming for python interfaces. moreover, I checked that Ubuntu bionic has support to the pybind11 but not in Ubuntu xenial, It seems that ROS2 doesn't involves pybind11 even the C++ has evolves to C++ 11 and later, so... please share your comments, thanks !

@mikaelarguedas
Copy link
Copy Markdown
Member

@gaoethan CMake Warnings are fine as they won't prevent the deb from being created.

If the latest state of the code is ready to be released. Please make a new release with all the fixes and close this PR.

Thanks!

On the other hand, I have another solution that is to replace boost python with pybind11which aligns to C++11 and later which used in ros2 as well. but it requires code change with pybind11 programming for python interfaces. moreover, I checked that Ubuntu bionic has support to the pybind11 but not in Ubuntu xenial, It seems that ROS2 doesn't involves pybind11 even the C++ has evolves to C++ 11 and later, so...

We explored using pybind11 for the python bindings (ros2/rclpy#173). As we currently bind only C code there was not a strong incentive to switch to pybind11 especially as the versions released in ubuntu we pretty outdated (even the one in bionic is missing some features we'd like to leverage (like py::capsule).
While it would be a valuable improvement to switch to pybind11 for vision_opencv, I think we should get this package released as is and see later for future improvements. What do you think ?

@gaoethan
Copy link
Copy Markdown
Author

ok. agree, let me file a new PR. thanks !

@gaoethan
Copy link
Copy Markdown
Author

gaoethan commented Aug 7, 2018

Now close this and a new PR #257 to release with tag 2.0.3 was created, thanks !

@gaoethan gaoethan closed this Aug 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants