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

Support for Opencv4 in ROS2 Foxy [WIP] #257

Merged
merged 2 commits into from
Aug 21, 2020
Merged

Conversation

fmrico
Copy link

@fmrico fmrico commented Aug 18, 2020

Warning: This is the dirtiest PR I have ever made, but it's the only way that I have found to make it works in Ubuntu 20.04 with OpenCV4

Hi All,

OpenCV 4 makes fail the compilation of darknet_ros for ROS Foxy. This PR makes it work.

Issue referenced in #234 and #200, at least.

If someone finds a better way to compile this, it is wellcome. I hope this could help someone and inspire others for a better solution.

Working on ROS2 Foxy, Ubuntu 20.04 LTS and OpenCV 4.2.0

darknert_ros_opencv4

Signed-off-by: Francisco Martin Rico [email protected]

Signed-off-by: Francisco Martin Rico <[email protected]>
@tomlankhorst
Copy link
Contributor

Thanks, were you able to test on 18.04 too?

@fmrico
Copy link
Author

fmrico commented Aug 18, 2020

Hi @tomlankhorst

No. The current version in the ros2 branch (without this PR) works in 18.04/Eloquent. This PR tries to fix the significant change to 20.04 (GCC and OpenCV).

Maybe we could have an eloquent branch and a foxy branch, and redirect this PR to foxy. What do you think, @mbjelonic?

@fmrico fmrico changed the title Support for Opencv4 [WIP] Support for Opencv4 in ROS2 Foxy [WIP] Aug 18, 2020
@mbjelonic
Copy link
Collaborator

@fmrico Yes, we could have a seperate branch for your PR. @tomlankhorst What do you think?

@tomlankhorst
Copy link
Contributor

tomlankhorst commented Aug 18, 2020

Let's start with a foxy branch, yes. Might eventually swap foxy for master and master for melodic.
@fmrico, are you able to target this PR to the newly created foxy branch?

@fmrico fmrico changed the base branch from ros2 to foxy August 19, 2020 04:50
@fmrico fmrico changed the base branch from foxy to ros2 August 19, 2020 04:51
@fmrico
Copy link
Author

fmrico commented Aug 19, 2020

Hi @tomlankhorst

Could you create the foxy branch from the ros2 branch? It seems like it was created from master, and when I change the base branch, there is a lot of conflicts.

@tomasgareau
Copy link
Contributor

Hi @fmrico -- looks like you might have meant @tomlankhorst :)

@fmrico
Copy link
Author

fmrico commented Aug 19, 2020

Yes, sorry @tomasgareau . Fixing...

@mbjelonic mbjelonic changed the base branch from ros2 to foxy August 19, 2020 07:54
@mbjelonic mbjelonic changed the base branch from foxy to ros2 August 19, 2020 07:55
@mbjelonic mbjelonic changed the base branch from ros2 to foxy August 19, 2020 07:58
@mbjelonic
Copy link
Collaborator

@fmrico I created a new branch called foxy and changed the base of this PR.

@mbjelonic
Copy link
Collaborator

@fmrico Can you please update the readme and mention that this branch ist running with ROS2 Foxy, Ubuntu 20.04 LTS and OpenCV 4.2.0?

Signed-off-by: Francisco Martin Rico <[email protected]>
@fmrico
Copy link
Author

fmrico commented Aug 20, 2020

Hi @mbjelonic

Thanks for creating the branch and changing the base!

I have updated the Readme. I also changed the compilation commands to use colcon.

@mbjelonic
Copy link
Collaborator

@fmrico thanks for the work and contributing to daknet_ros! This is great. Can't wait to switch to Ubuntu 20.04. :)

@mbjelonic mbjelonic merged commit 9e76f3b into leggedrobotics:foxy Aug 21, 2020
@fmrico
Copy link
Author

fmrico commented Aug 22, 2020

@mbjelonic Happy to help.

Please, take into account what I wrote in the head of the PR. I am not happy with the final result, but it was a way to make it works. There is duplicated code in some files, and this is very ugly. This is only a starting point ;)

@Paul-Ajay
Copy link

@fmrico I was trying to compile it with ros2 foxy and opencv 4.2.0 (output from the command python3 -c "import cv2; print(cv2.__version__)") and still getting /usr/include/opencv4/opencv2/core/cvdef.h:704:4: error: #error "OpenCV 4.x+ requires enabled C++11 support" 704 | # error "OpenCV 4.x+ requires enabled C++11 support"
Any idea what am I missing?

@fmrico
Copy link
Author

fmrico commented Mar 12, 2021

Hi @ajaypaul2008

I thought that I fixed this with this PR 🤔

In any case, this PR was a horrible patch to make darknet_ros work with the decision of OpenCV. Maybe someone should do a real fix.

@Paul-Ajay
Copy link

Paul-Ajay commented Mar 12, 2021

@fmrico Finally I got it working with opencv4 after I added changes from this PR #202 to foxy branch in my machine

Update : pushed this here https://github.com/ajaypaul2008/darknet_ros/tree/foxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error "OpenCV 4.x+ requires enabled C++11 support"
5 participants