OpenCV4 compatibility#259
Conversation
|
@hgaiser Thanks for your contribution. but it fails to pass the CI, it seems that it requires to enable the rule to use OpenCV4 in the corresponding rosdistro |
|
One fix for this is to remove the version number from the top level CMakeLists.txt file. In any case this is redundant. The source-level CMakeLists file checks which version is installed, so I don't think there's no need for the top level one to force OpenCV3. Might try a separate PR for this to trigger a CI build to see if I can replicate this. Duplicate the opencv3 module to |
|
Updated the PR as @jveitchmichaelis suggested. I can't test it right now, so I'll let Travis test it for me 👍 |
|
I've been following this thread for a while and I think that by adding a |
|
Needs a slight modification. This now appears to fail because in OpenCV 2 The existing code is: So referring to my last post, this suggests we don't care about OpenCV2, but it still seems to matter for the CI... I guess a brute force option would be find_package twice, once to detect the version and once again to select which components are required depending on the library. Unless there's a way of specifying a minimum major version in See e.g. http://cmake.3232098.n2.nabble.com/How-do-I-specify-VTK-minimum-version-td7595794.html A dirty - and untested! - solution: Or we replace the else case with an error. Referring to: https://docs.opencv.org/3.4/db/dfa/tutorial_transition_guide.html |
dc7d2e6 to
8037bbf
Compare
|
I changed this PR to ignore OpenCV2.4. This PR is set to merge with the melodic branch, and according to the melodic REP, OpenCV 3.2+ is required. The current Travis tests don't seem to include OpenCV 3.2 so I am ignoring that issue for now. |
|
It's been half a year and OpenCV4 becomes more and more widely available. How about explicitly requesting v4 and if unavailable v3? I understand why you did not do this before, but it's a way to solve this dilemma. |
Sorry my previous post was a bit unclear. I meant that the current Travis configuration tests with ROS Kinetic and OpenCV 2.4. OpenCV 2.4 is not a target for Melodic, so I removed the parts of this PR that focused on support for OpenCV 2.4 since that complicated things drastically. |
|
Could you update the travis config in this branch then to check Melodic in the melodic branch instead of kinetic?
|
|
Considering my time is limited, I would have to decline. Besides, I feel Travis testing with melodic is outside of the scope of this PR. |
|
Is there any update on this? |
|
Is it accurate to say that because a build bot fails, progress is roadblocked? This seems to be a case where humans are serving a tool vs. the other way around. The bot is just some environment, no? Could a I realize this isn't such a case, but imagine someone found a vulnerability or safety risk with ROS. We would just let Captain Travis prevent a PR for this long!? Is there any reasonable alternative for moving forward, or will the team here only accept a CI pass? |
|
@ros-pull-request-builder retest this please |
|
Would like to have a working ROS melodic+OpenCV on the NVIDIA TX2 please. JetPack 4.3 comes with OpenCV 4. |
|
@hgaiser from the PR description, it seems like you initially had the OpenCV4 version in and similar for the other changes. |
|
Ah I see the CI has been updated to build opencv3. I had assumed this code would be backwards compatible to opencv3 but apparently it isn't. @timonegk could you make a PR to merge with this PR? I don't have the time at the moment to look into your suggested fix. |
|
@hgaiser and @timonegk can you take a look at the Since I'm not officially a "maintainer" on this package for ROS 1, I'm a bit reluctant to release these changes into |
|
@hgaiser I opened a pull request at fizyr-forks#1 and tested for both cv versions |
Fix module_opencv for opencv3
|
@mjcarroll I am pretty sure that https://github.com/ros-perception/vision_opencv/blob/55bf08947a302aec8c83bec1883be1880d56cff5/cv_bridge/src/module_opencv4.cpp (current noetic branch) will not build on bionic (opencv3.2):
|
|
Hello, Does the fix work? If yes, then can it be merged? Thanks |
sincerely thanks |
Since OpenCV4 is released a month ago, this package doesn't compile. This PR adds compatibility for OpenCV4.
Regarding the
module_opencv4.cpp, it's probably not the most future proof way to do this, but the package already seems to handle opencv2/3 this way so I just amended it.